Click to See Complete Forum and Search --> : Passing Control Codes (IOCTL) to DLLs from VB ?
aussiedan
Nov 5th, 2001, 01:19 PM
Does anyone know if it is possible to pass IO Control Codes (IOCTL) to DLLs from VB ? I have come across the format of the codes in C++ documentation but I am not sure how to declare and pass them from VB. Hoping someone here as done it before and can advise. My email is dspence@3pea.com. Thanks in advance.
Dan Spence
jim mcnamara
Nov 5th, 2001, 04:02 PM
You mean like 0x41 == semaphore... ?
They are enumerations in C++ - that means the compiler puts them into the smallest possible datatype. If I remember these things correctly, they are all less than 0xFF - so they are unsigned char in C++, Byte in VB. Assuming I'm right use Byte datatypes.
Watch out for C expecting pointers. like myDll(char *i) - this expects a pointer. You can pass them either way. but they have to match what C wants:
(ByVal Iocode as Byte)
(ByRef Iocode as Byte)
Be sure to use hex codes to assign them in VB:
Iocode = &H41, for example.
That what you meant?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.