Home > Software engineering >  Vc production of vb how to call DLL
Vc production of vb how to call DLL

Time:10-19

When a vc DLL, in which a function is
Extern "C" INTERFACE_API int XSPEC_getIntegrationTime (USB_SPEC * PTR);

The definition of the USB_SPEC is
Typedef struct usb_spec {
Char filename [LIBUSB_PATH_MAX];
Char devnum;
Usb_dev_handle * usb_dev;
Void * context0;
Void * context1;
Int flag;
Usb_spec * next;
} USB_SPEC;

I don't know vb to call, USB_SPEC structure how to write?

Hope you a great god directions!!!!!!

CodePudding user response:

Typedef struct usb_spec {
Char filename [LIBUSB_PATH_MAX];
Char devnum;
Usb_dev_handle * usb_dev;
Void * context0;
Void * context1;
Int flag;
Usb_spec * next;
} USB_SPEC;

VB can be similar to define a type type, but the char part may have a problem, VB usually 4 byte alignment algorithm based on boundary, you see no member of the alignment of the border, and then corresponding in VB; Pointers can be used long data members, also must use a long int

CodePudding user response:

You see alignment of each member of the border

CodePudding user response:

To define a corresponding data type, if for alignment reasons, both is inconsistent, write a function, their processing this inconsistency,
If VC DLL can modify, change is best, can't modify, their processing,

CodePudding user response:

I remember like VB is unable to use VC passed in the structure of the body,
  •  Tags:  
  • API
  • Related