I Wrote a dll that has a global variable used by both c programs and vb program. is as follows:
#define FunctionTypeModifier __stdcall
__declspec(thread) UINT igNumber;
void SetNumber(UINT iNumber)
igNumber = iNumber;
void FunctionTypeModifier vbSetNumber(
igNumber = (UINT) lNumber;
c programs calls SetNumber
vb programs calls vbSetNumber
this works ok with c
but with vb i get the following message
Unhandled Exception in [test.exe]; 0xC0000005: Access violation.
vb codes is as follows
Declare Function vbSetNumber Lib "pUtils.dll" (ByVal iNumber As Integer) As Integer
Call vbSetNumber (455)
Can anyone tell me what I am doing wrong?