Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

What would cause LCDSmartie to exit?

Discussing issues that occur during plugin development.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
grantb3
Posts: 50
Joined: February 10th, 2008, 4:27 pm

What would cause LCDSmartie to exit?

Post by grantb3 »

I am building a display driver and so far the initialization function is working fine. I have also implemented the cursor position function and data write function. When I run LCDSmartie with my DLL the com port opens correctly, the LCD is cleared (my init routine works), but then LCDSmartie promptly closes the com port and exits. I can run LCDSmartie again and the process repeats. Why would it close on it's own? Any ideas?

grantb3
Posts: 50
Joined: February 10th, 2008, 4:27 pm

Post by grantb3 »

I'm still working on this issue.

Note that I'm using Visual C++ 6.0 running the compiler on Win2k. Any reason that should break LcdSmartie? I had to change the function declarations a bit to get them to compile:

Code: Select all

extern "C" __declspec(dllexport) char * DISPLAYDLL_Init(LCDS_BYTE size_x,LCDS_BYTE size_y,char *startup_parameters,LCDS_BOOL *ok)
Instead of:

Code: Select all


#define DLL_EXPORT(type) extern "C" __declspec(dllexport) type __stdcall

DLL_EXPORT(char *) DISPLAYDLL_Init(LCDS_BYTE size_x,LCDS_BYTE size_y,char *startup_parameters,LCDS_BOOL *ok)
It's not my first DLL, but I don't claim to be an expert either. There is no question that the DISPLAYDLL_Init() function is operating correctly, but then LCD Smartie promptly exits... ?? Also if I deliberately make a mistake with the startup parameters, the correct error message is displayed (and LCD Smartie does not then close).

grantb3
Posts: 50
Joined: February 10th, 2008, 4:27 pm

Post by grantb3 »

OK, I think I got it. Definitely a problem with the calling conventions. I have a crude version working now and I'll pretty it up and upload to the plugin forum when I'm done.

This web page helped:
http://zone.ni.com/devzone/cda/tut/p/id/3056

grantb3
Posts: 50
Joined: February 10th, 2008, 4:27 pm

Post by grantb3 »


Post Reply