I have C proggram as follow:
BOOL Init(FARPROC scDone, FARPROC fpError)
This inisialise one of Mydll which will callback fpError procedure when it detectes some error.
The fpError procedure is as follows:
void fpError(DWORD MyError, DWORD MyType)
{ }
Now I wanted to convert this code to Powerbasic so I did the following:
' Declare the Function
Declare FUNCTION Init LIB "Mydll.dll" ALIAS "Init" (ByVal scDone AS long, ByVal fpError AS long) AS LONG
'Do the inisialisation
i = Init(CODEPTR(scDone),CODEPTR(fpError))
'fpError Procedure
FUNCTION fpError(MyError As long, MyType As long) As long
MSGBOX Str$(TypeErr) & "-" & Str$(MyError)
FUNCTION = 1
END FUNCTION
Now I have tried changing the long Type to DWord but with both types
Whenever there is a callback my progg. crashes.
This works fine in VB with Addressof but I wanted to use PB.
If I do not put the parameters MyError and MyType it does not crash.
Can anyone understand this and help me out.
Thank You
-------------
Niraj Bhatt
BOOL Init(FARPROC scDone, FARPROC fpError)
This inisialise one of Mydll which will callback fpError procedure when it detectes some error.
The fpError procedure is as follows:
void fpError(DWORD MyError, DWORD MyType)
{ }
Now I wanted to convert this code to Powerbasic so I did the following:
' Declare the Function
Declare FUNCTION Init LIB "Mydll.dll" ALIAS "Init" (ByVal scDone AS long, ByVal fpError AS long) AS LONG
'Do the inisialisation
i = Init(CODEPTR(scDone),CODEPTR(fpError))
'fpError Procedure
FUNCTION fpError(MyError As long, MyType As long) As long
MSGBOX Str$(TypeErr) & "-" & Str$(MyError)
FUNCTION = 1
END FUNCTION
Now I have tried changing the long Type to DWord but with both types
Whenever there is a callback my progg. crashes.
This works fine in VB with Addressof but I wanted to use PB.
If I do not put the parameters MyError and MyType it does not crash.
Can anyone understand this and help me out.
Thank You
-------------
Niraj Bhatt
Comment