mfoster711
13 years agoRegular Contributor
Error trying to use DLL
I am getting the following error when trying to use a custom DLL function from TC. Error:
An exception occurred in the "Unit1" unit at line 78:
An exception occurred: 0xC0000005; class: ; description: ''
Here is the code I am trying to execute. The error occurs on the last line:
Set DefDLL = DLL.DefineDLL("MyDLL")
Call DefDLL.DefineProc("MyDLLOpenConnection", VT_I4, VT_I4)
Set Lib = DLL.Load("c:\MyApp\system\MyDLL.dll", "MyDLL")
Log.Message "CurrHwnd:" & CurrWindHwnd
Call Lib.MyDLLOpenConnection(CurrWindHwnd)
I have been using this custom DLL from Rational Robot for years. Here is how I define the function from withint Robot:
Declare Function MyDLLOpenConnection Lib "c:\MyApp\system\MyDLL.dll" (ByVal hWnd as Long) as Long
An exception occurred in the "Unit1" unit at line 78:
An exception occurred: 0xC0000005; class: ; description: ''
Here is the code I am trying to execute. The error occurs on the last line:
Set DefDLL = DLL.DefineDLL("MyDLL")
Call DefDLL.DefineProc("MyDLLOpenConnection", VT_I4, VT_I4)
Set Lib = DLL.Load("c:\MyApp\system\MyDLL.dll", "MyDLL")
Log.Message "CurrHwnd:" & CurrWindHwnd
Call Lib.MyDLLOpenConnection(CurrWindHwnd)
I have been using this custom DLL from Rational Robot for years. Here is how I define the function from withint Robot:
Declare Function MyDLLOpenConnection Lib "c:\MyApp\system\MyDLL.dll" (ByVal hWnd as Long) as Long