orbits
October 12th, 2001, 04:32 AM
We are using Third party DLL with our VB project. To call functions
from within the DLL, we are using the Public Declare statement.
The prototype of the function and structure definition from the
third party is as follows
typedef struct _MTDAC_EVENT {
ULONG Status;
DWORD TimeStamp;
ULONG EventCode;
ULONG SubReason;
ULONG Board;
ULONG Channel;
ULONG UserEvent;
PVOID UserData;
} MTDAC_EVENT, *PMTDAC_EVENT;
ULONG MTDACStartLink(MTDAC_EVENT_CALLBACK callback);
The corresponding declarations in our Visual Basic Project
is as follows :-
Public Type MTDAC_EVENT
Status As Long
TimeStamp As Long
EventCode As Long
SubReason As Long
Board As Long
channel As Long
UserEvent As Long
UserData As Long
End Type
Public Declare Function MTDACStartLink Lib "MTDACLNK.DLL" _
(ByVal CallBackFunction As Long) As Long
We are facing a peculiar problem. In the project mode, the above function
is being called successfully and the callback routine is also invoked
without any problems. But when we make an Executable, the function
is being called successfully, but when the callback routine is being
invoked, we get a Dr. Watson error specifying "Memory could not be read"
or Memory could not be written".
Since, it is EXE mode, we are not able to trace which particular
line is causing the problem.
It is very difficult to understand, how come the project mode
is working fine, but the EXE is failing.
Platform
Visual Basic 6.0 (SP5)
O/S : Windows 2000 Advanced Server.
Any answers?
Thks in advance.
from within the DLL, we are using the Public Declare statement.
The prototype of the function and structure definition from the
third party is as follows
typedef struct _MTDAC_EVENT {
ULONG Status;
DWORD TimeStamp;
ULONG EventCode;
ULONG SubReason;
ULONG Board;
ULONG Channel;
ULONG UserEvent;
PVOID UserData;
} MTDAC_EVENT, *PMTDAC_EVENT;
ULONG MTDACStartLink(MTDAC_EVENT_CALLBACK callback);
The corresponding declarations in our Visual Basic Project
is as follows :-
Public Type MTDAC_EVENT
Status As Long
TimeStamp As Long
EventCode As Long
SubReason As Long
Board As Long
channel As Long
UserEvent As Long
UserData As Long
End Type
Public Declare Function MTDACStartLink Lib "MTDACLNK.DLL" _
(ByVal CallBackFunction As Long) As Long
We are facing a peculiar problem. In the project mode, the above function
is being called successfully and the callback routine is also invoked
without any problems. But when we make an Executable, the function
is being called successfully, but when the callback routine is being
invoked, we get a Dr. Watson error specifying "Memory could not be read"
or Memory could not be written".
Since, it is EXE mode, we are not able to trace which particular
line is causing the problem.
It is very difficult to understand, how come the project mode
is working fine, but the EXE is failing.
Platform
Visual Basic 6.0 (SP5)
O/S : Windows 2000 Advanced Server.
Any answers?
Thks in advance.