>Has anyone encountered the same scenario? Should i program it now in unmanaged code using .NET's interop services if im unsuccessful of doing the latter one?

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Using P/Invoke how would i know that i should be passing "by value" or "by reference" to the arguments of a method or function of the DLL
2. Equivalent type in .Net of the used data type for each variable (e.g what's the equivalent type of BSTR in VB.Net/C#
3. In the type library it says
VARIANT_BOOL _stdcall NE_QueryElementByID
[in] long net,
[in] ElementTypeEnum eltype,
[in, out] IDAttRec* id,
[in, out] HandleAttRec* h)
This is the way i called it in VB.Net...is this correct
..
<DllImport("neteng.dll")>
Public Shared Function NE_QueryElementByID(ByRef net As Long, ByRef eltype As ElementTypeEnum, ByRef id As IDAttRec, ByRef h As HandleAttRec) As Boolea
End Functio
..
Dim h1 As HandleAttRec
hi.Handle =
Dim id1 As IDAttRec
Dim m_startid As Int32 = 442
id1.UserID = 9
id1.LayerKey =
dim bol as Boolean = NE_QueryElementByID(net, ElementTypeEnum.NE_EDGE, id1, h1
Tnx a lot!
Mattias Sj?gren - 12 May 2004 08:58 GMT
>2. Equivalent type in .Net of the used data type for each variable (e.g what's the equivalent type of BSTR in VB.Net/C#?
<MarshalAs(UnmanagedType.BStr)> String
>This is the way i called it in VB.Net...is this correct?
>...
><DllImport("neteng.dll")> _
>Public Shared Function NE_QueryElementByID(ByRef net As Long, ByRef eltype As ElementTypeEnum, ByRef id As IDAttRec, ByRef h As HandleAttRec) As Boolean
>End Function
No, but try
Public Shared Function NE_QueryElementByID(ByVal net As Integer, ByVal
eltype As ElementTypeEnum, ByRef id As IDAttRec, ByRef h As
HandleAttRec) As <MarshalAs(UnmanagedType.VariantBool)> Boolean
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.