How to support passing non-pointered value .use DLL


//BmOpcDaClt_API BOOL __stdcall BMDAC_ReadItem(DWORD ServerHandle,DWORD GroupHandle,DWORD ItemHandle,VARIANT* Value,FILETIME* pTimeStamp,WORD* pQuality)

var Value *ole.VARIANT
Value1 := ole.VARIANT{}
Value = &Value1

var pTimeStamp *w32.FILETIME
pTimeStamp1 := w32.FILETIME{}
pTimeStamp = &pTimeStamp1
var pQuality *uint16
var pQuality1 uint16 = 0
pQuality = &pQuality1

BMDAC_ReadItem.Call(uintptr(ConnectHandle), uintptr(GroupHandle), uintptr(ItemHandle), uintptr(unsafe.Pointer(Value)), uintptr(unsafe.Pointer(pTimeStamp)), uintptr(unsafe.Pointer(pQuality)))

// this is ok!!!

//BmOpcDaClt_API BOOL __stdcall BMDAC_WriteItem(DWORD ServerHandle,DWORD GroupHandle,DWORD ItemHandle,VARIANT Value, BOOL DoAsync)

BMDAC_WriteItem.Call(uintptr(ConnectHandle), uintptr(GroupHandle), uintptr(ItemHandle), ???, uintptr(0))

//How to do ?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.