October 30, 2025, 01:33:45 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Lost in Translation VB -> EB & boolean

Started by XaGo, April 08, 2009, 06:02:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

XaGo

Hello,
I want to transate :

Declare Sub hidSetReadNotify Lib "mcHID.dll" Alias "SetReadNotify" (ByVal pHandle As Long, ByVal pValue As Boolean)
hidSetReadNotify DeviceHandle, True

I try this :

Declare import, hidSetReadNotify (pHandle As int,pValue as int)
hidSetReadNotify(handle,0)

But i've got this messages:
Unresolved external __imp_hidSetReadNotify
Error: Unresolved extern __imp_hidSetReadNotify

I've tried others solutions with same result.
The rest of my code is good.

Have you an idea ?




sapero

Hello, you'll need to include the library for the compilation time.
Add in your program the following line:
$use "mcHID.lib"
Then click 'Create import library' from the Tools menu, navigate to your mcHID.dll, select it and click OK.
Ready to compile!

XaGo

Thank's for the reply.

I already do that, here is my code:


$USE "mcHID.lib"
Declare import, hidConnect Alias "Connect" (pHostWin As int)
Declare import, hidDisconnect Alias "Disconnect" ()
Declare import, hidGetItem Alias "GetItem" (pIndex As int),int
Declare import, hidGetItemCount Alias "GetItemCount" (),int
Declare import, hidRead Alias "Read" (pHandle As int, pData As char)
Declare import, hidWrite Alias "Write" (pHandle As int,pData As char)
Declare import, hidReadEx Alias "ReadEx" (pVendorID As int,pProductID As int,pData As char)
Declare import, hidWriteEx Alias "WriteEx" (pVendorID As int,pProductID As int,pData As char)
Declare import, hidGetHandle Alias "GetHandle" (pVendoID As int,pProductID As int),int
Declare import, hidGetVendorID Alias "GetVendorID" (pHandle As int),int
Declare import, hidGetProductID Alias "GetProductID" (pHandle As int),int
Declare import, hidGetVersion Alias "GetVersion" (pHandle As int),int
Declare import, hidGetVendorName Alias "GetVendorName" (pHandle As int,pText As String,pLen As int),int
Declare import, hidGetProductName Alias "GetProductName" (pHandle As int,pText As String,pLen As int),int
Declare import, hidGetSerialNumber Alias "GetSerialNumber" (pHandle As int,pText As String,pLen As int),int
Declare import, hidGetInputReportLength Alias "GetInputReportLength" (pHandle As int),int
Declare import, hidGetOutputReportLength Alias "GetOutputReportLength" (pHandle As int),int
Declare import, hidIsReadNotifyEnabled Alias "IsReadNotifyEnabled" (pHandle As int)
Declare import, hidIsAvailable Alias "IsAvailable" (pVendorID As int, pProductID As int)
Declare import, hidSetReadNotify (pHandle As int,pValue as int)

const VendorID = 4660
const ProductID = 0001

def bufferin[3] as char
def VendorName,ProductName as STRING
def hProgress,handle as int
WINDOW w1

OPENWINDOW w1,0,0,1000,350,@MINBOX|@MAXBOX|@SIZE,0,"Simple Window",&main
hProgress = GETCONTROLHANDLE(w1, 0)
hidDisconnect()
hidconnect(hProgress)

Handle = hidGetHandle(VendorID,ProductID)
hidGetVendorName(Handle,VendorName, 255)
hidGetProductName(Handle,ProductName, 255)

Print w1,VendorName+" "
Print w1,ProductName+" "
Print w1,hidGetVendorID(handle)

hidSetReadNotify(handle,0)

DO
hidRead(Handle,bufferin[0])
print w1,str$(bufferin[1])
wait
until w1 = 0
END

SUB main
    IF @CLASS = @IDCLOSEWINDOW
CLOSEWINDOW w1
    ENDIF
RETURN
ENDSUB





LarryMc

There is no hidSetReadNotify in that library.

You used this :Declare import, hidSetReadNotify (pHandle As int,pValue as int)when you should have used this:Declare import, hidSetReadNotify Alias "SetReadNotify" (pHandle As int,pValue as int)

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

XaGo