Hi All,
I've searched around all day but can't find any good info on this. I need to convert some old VB3 applications to .NET. They read/write from a 15+ year old Btrieve database.
First of all, is it possible to import functions from a 16 bit DLL? If so, then why won't this work?
Declare Function btrcall Lib "c:\WINDOWS\WBTRCALL.DLL" (ByVal iop As Int16, Curr As Object, DataBuff As Object, DataLen As Int16, KeyBuff As Object, ByVal KeyLen As Int16, ByVal KeyNum As Int16) As Int16
I've also tried the DllImport version. Here is the working VB3 code that imports this function:
Declare Function btrcall Lib "c:\WINDOWS\WBTRCALL.dll" (ByVal iop As Integer, Curr As Any, DataBuff As Any, DataLen As Integer, KeyBuff As Any, ByVal KeyLen%, ByVal KeyNum%) As Integer
Edit:
This is the exception
System.BadImageFormatException was unhandled
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Any help is appreciated,
Jason
I've searched around all day but can't find any good info on this. I need to convert some old VB3 applications to .NET. They read/write from a 15+ year old Btrieve database.
First of all, is it possible to import functions from a 16 bit DLL? If so, then why won't this work?
Declare Function btrcall Lib "c:\WINDOWS\WBTRCALL.DLL" (ByVal iop As Int16, Curr As Object, DataBuff As Object, DataLen As Int16, KeyBuff As Object, ByVal KeyLen As Int16, ByVal KeyNum As Int16) As Int16
I've also tried the DllImport version. Here is the working VB3 code that imports this function:
Declare Function btrcall Lib "c:\WINDOWS\WBTRCALL.dll" (ByVal iop As Integer, Curr As Any, DataBuff As Any, DataLen As Integer, KeyBuff As Any, ByVal KeyLen%, ByVal KeyNum%) As Integer
Edit:
This is the exception
System.BadImageFormatException was unhandled
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Any help is appreciated,
Jason