alex723
September 8th, 2008, 04:49 PM
I have old working VB6 application which uses IOTSLPIB.DLL to communicate with external device. IOTSLPIB.DLL file is in Windows\system32 folder. The application has module IOTIEEE.bas which contains various function declarations such as
[code]Declare Function _
MakeDevice Lib "IOTSLPIB.DLL" _
(ByVal devHandle As Integer, ByVal name As String) As Integer[code]
This function is called from other modules as
[code]
iRet = MakeDevice(handle,name)
[code]
And everythig works OK.
Now I need to use the same DLL in VB.NET application. First I tried to add it as a reference but it does not allow with error msg that “ A reference to IOTSLPIB.DLL could not be added… Make sure that it is a valid assembly or COM component”. From similar forum messages I learned that such DLL is Windows DLL and not .NET assembly and supposed to be used in VB.net different way declaring dll functions. I thought this is what I have in my VB module but it does not work. I added IOTIEEE.VB module in my project, also placed 'IOTSLPIB.DLL' file into application’s BIN folder as somebody suggested. But when it calls
[code]iRet = MakeDevice(handle,name) [code]
I still get an error
Unable to load DLL 'IOTSLPIB.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Where is my mistake?
Thanks
[code]Declare Function _
MakeDevice Lib "IOTSLPIB.DLL" _
(ByVal devHandle As Integer, ByVal name As String) As Integer[code]
This function is called from other modules as
[code]
iRet = MakeDevice(handle,name)
[code]
And everythig works OK.
Now I need to use the same DLL in VB.NET application. First I tried to add it as a reference but it does not allow with error msg that “ A reference to IOTSLPIB.DLL could not be added… Make sure that it is a valid assembly or COM component”. From similar forum messages I learned that such DLL is Windows DLL and not .NET assembly and supposed to be used in VB.net different way declaring dll functions. I thought this is what I have in my VB module but it does not work. I added IOTIEEE.VB module in my project, also placed 'IOTSLPIB.DLL' file into application’s BIN folder as somebody suggested. But when it calls
[code]iRet = MakeDevice(handle,name) [code]
I still get an error
Unable to load DLL 'IOTSLPIB.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Where is my mistake?
Thanks