0

我有函数PLInsert2D 它也有这样的非托管代码描述:

HRESULT PLInsert2D(
[in] IPARTLibProvider* aPLClient;
[in] IBOResponseDisp* aMethodResponse;
[in] Double aX, aY, aAngle;
[out, retval] long* result); 

我从 vb.net vs 2017 win8.1 64bit 调用这个函数:

<DllImport("C:\Program Files\ASCON\KOMPAS-3D v17\Libs\PARTLib\Clients\plclient_kompas.dll", BestFitMapping:=True, CallingConvention:=CallingConvention.StdCall, EntryPoint:="LIBRARYENTRY")>
    Public Shared Function PLInsert2D(<MarshalAs(UnmanagedType.Interface)> ByVal aPLClient As IPARTLibProvider, <MarshalAs(UnmanagedType.Interface)> ByVal aMethodResponse As IBOResponse, ByVal aX As Double, ByVal aY As Double, ByVal aAngle As Double) As IntPtr
    End Function

我在这样的托管代码中使用它:

Dim insert2dpart As IntPtr
        insert2dpart = PLInsert2D(aPLClient, aMethodResponse, aX, aY, aAngle)

它返回&H0000000000000001这是什么?这是好事还是坏事?我可以用这个值做什么?它应该返回宏元素的引用,但我认为这不是我所期望的。任何帮助,将不胜感激。谢谢!

4

0 回答 0