Hi Ralph. Well i'm declaring the winscard.DLL procedure in my VB project so
i guess that makes it C to VB. I was looking through MSDN's converting C
declarations to VB
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vb
condeclaringdllprocedure.asp)
but it didnt state the declarations i should use for the two data types
LCByte and LPByte. Any help in clearing this one up will really be
appreciated.
Thx
> > Hi Guys, I need to use winscard.dll and hence am declaring the functions
> that
[quoted text clipped - 11 lines]
>
> -ralph
Ralph - 27 Feb 2005 04:54 GMT
> Hi Ralph. Well i'm declaring the winscard.DLL procedure in my VB project so
> i guess that makes it C to VB. I was looking through MSDN's converting C
> declarations to VB
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/ht
ml/vbcondeclaringdllprocedure.asp)
> but it didnt state the declarations i should use for the two data types
> LCByte and LPByte. Any help in clearing this one up will really be
> appreciated.
>
> Thx
Use "ByRef lpByte As Byte
Ralph - 27 Feb 2005 05:51 GMT
> Hi Ralph. Well i'm declaring the winscard.DLL procedure in my VB project so
> i guess that makes it C to VB. I was looking through MSDN's converting C
> declarations to VB
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/ht
ml/vbcondeclaringdllprocedure.asp)
> but it didnt state the declarations i should use for the two data types
> LCByte and LPByte. Any help in clearing this one up will really be
> appreciated.
>
> Thx
I don't have access to wincard at the moment so I can't see the signatures,
but try
ByRef lpByte As Byte ' Byte is an 8-bit number
ByRef lpcByte As Byte
"Constantance" is a concept only known to C, so lpc and lp are the same to
VB.
"ByRef" is the default. All VB variables are 'references' by default. So
ByRef passes a pointer to a 'container'. ByVal would pass the 'value'. So by
committing a bit of heresy...
A C signature of "unsigned char* lpByte;" is a VB signature of "ByRef
lpByte As Byte".
A C signature of "char cByte;" is a VB signature of "ByVal cByte As Byte".
Note: VB only truly understands the parameter attributes of [in] and [in,
out]. (Well, also [in, retval], but that's another story.) It doesn't
understand [out] by value very well at all, but always gives it a good old
try.
If you don't mind ugly, you can always use ...
ByRef lpByte As Any and in VB use...
SomeVar = CByte(lpByte)
<g>
hth
-ralph