I am unable to call the latest ClearWin+ from a 32 bit app built using Microsoft C as it crashes. I am able to call it from the same source compiled for 64 bit (swapping the lib / dll to the 64 bit ones).
Details
I have managed to build a small 'hello world' executable using the Microsoft C compiler (cl.exe) and link it against the v13 DLL / LIB of ClearWin+ (as obtained from the 'new features in ClearWin' post, here - https://forums.silverfrost.com/Forum/Topic/3127).
In a 64 bit build, there is a separate LIB and DLL (ClearWin64.lib/ClearWin64.dll) and this executable works as expected (a window with a caption is created).
When linking in 32 bit, I use salflibc.lib / salflibc.dll as there does not seem to be an independent ClearWin32 build any more (there was one, available from http://www.silverfrost.com/57/using_clearwin_with_non-silverfrost_c_compilers.aspx but it is outdated now). This compiles and links fine, but throws an exception of;
Unhandled exception at 0x100BE928 (salflibc.dll) in mshello32.exe: 0xC0000005: Access violation reading location 0x00000000.
I do not have any other DLLs or libraries used in these examples. Should I be calling an 'init' function before calling ClearWin in 32 bit? I see '__initialise_clearwin_plus' in the exports, but no documentation.
'Hello ClearWin+ source'
extern int _cdecl __winio(char* format, ...);
int main()
{
__winio('%ca[Window caption]');
return 0;
}
To compile the 32 bit I use;
cl mshello.c salflibc.lib
To compile the 64 bit I use;
cl mshello.c ClearWin64.lib
The 32 bit code can be made to work by going back to the ClearWin32 lib / dll in the 'Using ClearWin+ with non-Silverfrost C compilers' post linked above but this would mean the 32 and 64 bit versions of the app depend on different releases of ClearWin+.
Any help would be appreciated.
Ryan