Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
How can I pass a byte parameter to a dll?
I need to pass a parameter to a dll function using an unsigned byte and am having some problems.
DECLARE INTEGER LoadToRam IN Hc11DownLoaderDll INTEGER,STRING,STRING
retval = LoadToRam(portnum,CHR(255),NULL)
I need to pass the CHR(255) and the portnum as unsigned char but Foxpro sends it as a signed char.
A VB implementation uses the following.
Private Declare Function LoadToRam Lib "Hc11DownLoaderDll.dll" _
(ByVal comPort_ As Byte, ByVal commandCode_ As Byte, _
ByRef progressBarPtr_ As Any) As Integer
command = CByte(&HFF)
comport = CByte(cboComPort.Text)
result = LoadToRam(comport, command, vbNullString)
A C++ implementation of course just does a cast to unsigned char for the character byte 0xFF.
I need a way to do it in VFP 6.0 if it is possible.
Any help is appreciated
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement