Hello Michel,
Please explain.. I have made my project with "Register for COM Interop". I
have also done a regasm /tlb:.....
All my functions are ComVisible().
Since there is a difference in the VB.Net DLL's and classic Win32 DLL's,
I've even done the IL tweaking to ensure that my functions are being exported.
I can't figure out how to get Char** marshalled into my managed code ?
The combinations Ive tried are
1. <MarshalAs(Unma nagedType.SafeA rray, SafeArraySubTyp e:=VarEnum.VT_B STR)>
ByVal argv as string()
This gives me an error saying SafeArray of rank 11888 has been passed to a
method expecting an array of rank 1
2. <MarshalAs(Unma naged.LPArray)B yRef argv as string
This gives me an error saying cannot marshal 'parameter #2' : Invalid
managed/unmanaged type combination (string parameters and return types must
be paired with LPStr, LPWStr, LPTStr, BSTR, TBStr, VBByRefStr, or AnsiBStr).
and combiantions of the above with char()() instead of string() etc, etc.
x--
Ravi Shankar
"Michel Posseth [MCP]" wrote:
I do all my vb6 interop through COM , this works great
maybe this is an idea for you to ?
Regards
Michel
"Ravi Shankar" <sh*********@ne wsgroup.nospams chreef in bericht
news:4F******** *************** ***********@mic rosoft.com...
Hi,
I have a requirement where I need to call methods written in VB.Net from a
C++ code. I have been going crazy reading various articles on the net
w.r.t
interop and marshalling but an more confused now that before.
the signature I need to conform in the VB.Net DLL is
int MyAppInitFunc(i nt argc, char** argv)
To this extent I have tried the following
Public Function MyAppInitFunc(B yVal argc as integer, ByRef argv as string)
as Integer
Public Function MyAppInitFunc(B yVal argc as Int32, ByVal argv() as string)
as Int32
... based on some posts I even tried
Public Function MyAppInitFunc(B yVal argc as Int32, ByVal argv as IntPtr)
as
Int32
but have not been able to get anything to work.
Is there perhaps some reading I'm missing up on ?
Regards.
--
Ravi Shankar