Page 1 of 1
What would cause LCDSmartie to exit?
Posted: February 13th, 2008, 1:41 am
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?
Posted: February 13th, 2008, 6:29 pm
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).
Posted: February 13th, 2008, 7:50 pm
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
Posted: February 14th, 2008, 12:12 am
by grantb3