Pass by value or by reference?

Apr 23 2004 3:33 AM
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? ... _ 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 ... Dim h1 As HandleAttRec hi.Handle = 0 Dim id1 As IDAttRec Dim m_startid As Int32 = 4424 id1.UserID = 99 id1.LayerKey = 1 dim bol as Boolean = NE_QueryElementByID(net, ElementTypeEnum.NE_EDGE, id1, h1) Tnx a lot!