D
Dave
I have an existing VC6 ATL COM DLL. It has a number of methods within it
that take a byte array as the methods parameters. Here's what the IDL looks
like in the VC6 DLL:
[id(32), helpstring("method GetSystemConfig")] HRESULT GetSystemConfig([in,
out] SAFEARRAY(unsigned char) *pData, [out, retval] long *retval);
As you can see it is a byte array (SAFEARRAY)
In the VB.NET object browser the the prototype looks like this:
Public Function GetSystemConfig(ByRef pData as System.Array) as Integer
PROBLEM: Everyone of the API calls made in the following code section throws
an error:
"Specified array was not of the expected type. Err.Number = 5 "
I currently have VB.NET up in the VC 6 debugger just to see if the interface
ever gets called, and it does not. Which means my problem is in the interop
dll that Dot net creates automatically.
Public Function GetSystemConfig(ByRef pBytes As System.Array) As Integer
On Error GoTo processerror
Dim pByte() As Byte
GetSystemConfig = (ESITapi.GetSystemConfig(pByte) = S_OK)
Dim pByt(512) As Byte
GetSystemConfig = (ESITapi.GetSystemConfig(pByt) = S_OK)
Dim chars As Byte() = System.Text.Encoding.ASCII.GetBytes("hello
world")
GetSystemConfig = (ESITapi.GetSystemConfig(chars) = S_OK)
Dim arr As Array
GetSystemConfig = (ESITapi.GetSystemConfig(arr) = S_OK)
Dim strArr() As String = {"1", "2", "3"}
GetSystemConfig = (ESITapi.GetSystemConfig(strArr) = S_OK)
Dim pB(512) As Char
GetSystemConfig = (ESITapi.GetSystemConfig(pB) = S_OK)
End Function
Is there any way I can debug VB.NETS interop DLL ?
Any idea's what's wrong with the parameters I'm passing ?
FYI, I'm using VS 2005
This ATL control was written for use with VB6 and has been in production for
years, I'm trying to reuse it in the Dot Net world.
Anyone got any ideas ?
Dave
that take a byte array as the methods parameters. Here's what the IDL looks
like in the VC6 DLL:
[id(32), helpstring("method GetSystemConfig")] HRESULT GetSystemConfig([in,
out] SAFEARRAY(unsigned char) *pData, [out, retval] long *retval);
As you can see it is a byte array (SAFEARRAY)
In the VB.NET object browser the the prototype looks like this:
Public Function GetSystemConfig(ByRef pData as System.Array) as Integer
PROBLEM: Everyone of the API calls made in the following code section throws
an error:
"Specified array was not of the expected type. Err.Number = 5 "
I currently have VB.NET up in the VC 6 debugger just to see if the interface
ever gets called, and it does not. Which means my problem is in the interop
dll that Dot net creates automatically.
Public Function GetSystemConfig(ByRef pBytes As System.Array) As Integer
On Error GoTo processerror
Dim pByte() As Byte
GetSystemConfig = (ESITapi.GetSystemConfig(pByte) = S_OK)
Dim pByt(512) As Byte
GetSystemConfig = (ESITapi.GetSystemConfig(pByt) = S_OK)
Dim chars As Byte() = System.Text.Encoding.ASCII.GetBytes("hello
world")
GetSystemConfig = (ESITapi.GetSystemConfig(chars) = S_OK)
Dim arr As Array
GetSystemConfig = (ESITapi.GetSystemConfig(arr) = S_OK)
Dim strArr() As String = {"1", "2", "3"}
GetSystemConfig = (ESITapi.GetSystemConfig(strArr) = S_OK)
Dim pB(512) As Char
GetSystemConfig = (ESITapi.GetSystemConfig(pB) = S_OK)
End Function
Is there any way I can debug VB.NETS interop DLL ?
Any idea's what's wrong with the parameters I'm passing ?
FYI, I'm using VS 2005
This ATL control was written for use with VB6 and has been in production for
years, I'm trying to reuse it in the Dot Net world.
Anyone got any ideas ?
Dave