G
Guest
i really hope im just overlooking something very simple bc i have an API call
in VB.net that doesnt work, yet the same call in C# works....in VB i get an
error saying the Entry Point cannot be found....code below
[DllImport("setupapi.dll", SetLastError=true)]
static extern unsafe int SetupDiGetDeviceInterfaceDetail(
int DeviceInfoSet,
ref SP_DEVICE_INTERFACE_DATA lpDeviceInterfaceData,
int* aPtr,
int detailSize,
ref int requiredSize,
int* bPtr);
[DllImport("setupapi.dll", SetLastError=true)]
static extern unsafe int SetupDiGetDeviceInterfaceDetail(
int DeviceInfoSet,
ref SP_DEVICE_INTERFACE_DATA lpDeviceInterfaceData,
ref PSP_DEVICE_INTERFACE_DETAIL_DATA myPSP_DEVICE_INTERFACE_DETAIL_DATA,
int detailSize,
ref int requiredSize,
int* bPtr);
SetupDiGetDeviceInterfaceDetail(
hDevInfo,
ref mySP_DEVICE_INTERFACE_DATA,
null,
DeviceInterfaceDetailDataSize,
ref RequiredSize,
null);
Friend Declare Function SetupDiGetDeviceInterfaceDetail Lib "setupapi.dll"
(ByVal DeviceInfoSet As Integer, _
ByRef lpDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _
ByRef myPSP_DEVICE_INTERFACE_DETAIL_DATA As
PSP_DEVICE_INTERFACE_DETAIL_DATA, _
ByVal detailSize As Integer, ByRef requiredSize As Integer, _
ByRef bPtr As Integer) As Integer
Friend Declare Function SetupDiGetDeviceInterfaceDetail Lib
"setupapi.dll" (ByVal DeviceInfoSet As Integer, _
ByRef lpDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _
ByRef aPtr As Integer, ByVal detailSize As Integer, _
ByRef requiredSize As Integer, ByRef bPtr As Integer) As Integer
Dim results As Integer = SetupDiGetDeviceInterfaceDetail(hDevInfo,
myInfo, myPspInfo, DeviceInterfaceDetailDataSize, _
RequiredSize, Nothing)
in VB.net that doesnt work, yet the same call in C# works....in VB i get an
error saying the Entry Point cannot be found....code below
[DllImport("setupapi.dll", SetLastError=true)]
static extern unsafe int SetupDiGetDeviceInterfaceDetail(
int DeviceInfoSet,
ref SP_DEVICE_INTERFACE_DATA lpDeviceInterfaceData,
int* aPtr,
int detailSize,
ref int requiredSize,
int* bPtr);
[DllImport("setupapi.dll", SetLastError=true)]
static extern unsafe int SetupDiGetDeviceInterfaceDetail(
int DeviceInfoSet,
ref SP_DEVICE_INTERFACE_DATA lpDeviceInterfaceData,
ref PSP_DEVICE_INTERFACE_DETAIL_DATA myPSP_DEVICE_INTERFACE_DETAIL_DATA,
int detailSize,
ref int requiredSize,
int* bPtr);
SetupDiGetDeviceInterfaceDetail(
hDevInfo,
ref mySP_DEVICE_INTERFACE_DATA,
null,
DeviceInterfaceDetailDataSize,
ref RequiredSize,
null);
Friend Declare Function SetupDiGetDeviceInterfaceDetail Lib "setupapi.dll"
(ByVal DeviceInfoSet As Integer, _
ByRef lpDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _
ByRef myPSP_DEVICE_INTERFACE_DETAIL_DATA As
PSP_DEVICE_INTERFACE_DETAIL_DATA, _
ByVal detailSize As Integer, ByRef requiredSize As Integer, _
ByRef bPtr As Integer) As Integer
Friend Declare Function SetupDiGetDeviceInterfaceDetail Lib
"setupapi.dll" (ByVal DeviceInfoSet As Integer, _
ByRef lpDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _
ByRef aPtr As Integer, ByVal detailSize As Integer, _
ByRef requiredSize As Integer, ByRef bPtr As Integer) As Integer
Dim results As Integer = SetupDiGetDeviceInterfaceDetail(hDevInfo,
myInfo, myPspInfo, DeviceInterfaceDetailDataSize, _
RequiredSize, Nothing)