I'm trying to communicate with an external .Net dll that controls a hand reader. I'm not having much luck. I can't come up with the first step that would allow me to look at the classes etc that are contained in the dll.
Here's what I know: the instructions from the external dll tell me that its namespace is "RecogSys.RdrAccess". One of the many classes contained in the dll is called "CRsiComWinSock" and is required to establish an ethernet connection with the hand reader. The dll is called "RSIDotNetDLL.DLL" and I've placed a copy of the dll in A5's dot net path.
A5 has a number of methods such as RegisterAssembly, RegisterNamespace, RegisterClass etc and most of the examples provided use the RegisterClass method.
Here's what I've tried with RegisterClass
This returns a '.Net Assembly dll not found" error.
If I try to register the assembly as follows:
I get:
"Error in DotNet::Services::RegisterAssembly - Exception loading assembly
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\RSIDotNetDLL.dll'
or one of its dependencies. An attempt was made to load a program with an incorrect format."
I've also tried RegisterNamespace without success.
The dll publisher has provided a demo program using the dll that establishes communication with the reader, so it is possible.
Can anyone spot syntax errors or suggest an approach that will help me get past the first hurdle?
Thanks
Here's what I know: the instructions from the external dll tell me that its namespace is "RecogSys.RdrAccess". One of the many classes contained in the dll is called "CRsiComWinSock" and is required to establish an ethernet connection with the hand reader. The dll is called "RSIDotNetDLL.DLL" and I've placed a copy of the dll in A5's dot net path.
A5 has a number of methods such as RegisterAssembly, RegisterNamespace, RegisterClass etc and most of the examples provided use the RegisterClass method.
Here's what I've tried with RegisterClass
Code:
Dim Sv as DotNet::Services Dim Assy as DotNet::AssemblyReference Dim Namespace as C = "RecogSys.RdrAccess" Assy.FileName = DotNetPath() + "RSIDotNetDLL.dll" if .not. file.exists(assy.filename) then ui_msg_box("","File not there.") END end if rc = Sv.RegisterClass("RecogSys.RdrAccess", "MyComWinsock","CRsiComWinsock",Assy)
If I try to register the assembly as follows:
Code:
Dim Sv as DotNet::Services Dim Assy as DotNet::AssemblyReference Dim Namespace as C = "RecogSys.RdrAccess" Assy.FileName = DotNetPath() + "RSIDotNetDLL.dll" if .not. file.exists(assy.filename) then ui_msg_box("","File not there.") END end if rs = sv.RegisterAssembly(NameSpace,Assy) if .not. rs then UI_Msg_Box("Error registering assembly " + Assy.fileName, sv.CallResult.Text) End End if showvar(sv.callResult.text)
"Error in DotNet::Services::RegisterAssembly - Exception loading assembly
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\RSIDotNetDLL.dll'
or one of its dependencies. An attempt was made to load a program with an incorrect format."
I've also tried RegisterNamespace without success.
The dll publisher has provided a demo program using the dll that establishes communication with the reader, so it is possible.
Can anyone spot syntax errors or suggest an approach that will help me get past the first hurdle?
Thanks
Comment