PHP calls C ++ DLL

Source: Internet
Author: User
Use the DynamicWrapper method. Download DynamicWrapper. dll to phpext and windowssystem32, $ dwnewCOM (DynamicWrapper); $ dw-Register (EbUsbApi. dll, EbCreateDataFile, isls, fs, rl); $ ch $ dw-EbCreateDataFile (222,11, 22); idescri

Use the DynamicWrapper method. Download DynamicWrapper. dll to php ext and windows system32, $ dw = new COM ("DynamicWrapper"); $ dw-Register ("EbUsbApi. dll "," EbCreateDataFile ", 'I = sls'," f = s "," r = l "); $ ch = $ dw-EbCreateDataFile (" 222 ", 11, "22"); I = descri

Use the DynamicWrapper method. Download DynamicWrapper. dll to php ext and windows system32,
$ Dw = new COM ("DynamicWrapper ");
$ Dw-> Register ("EbUsbApi. dll", "EbCreateDataFile", 'I = sls', "f = s", "r = l ");
$ Ch = $ dw-& gt; EbCreateDataFile ("222", 11, "22 ");

I = describes the number and data type of the functions parameters

F = type of call _ stdcall or _ cdecl. so it can work with both ms c ++ and Borland C ++. default to _ stdcall. if that doesn't work use _ cdecl. if that doesn' t work good luck!

R = return data type.

Data types are:

Const ARGTYPEINFO ArgInfo [] =
{
{'A', sizeof (IDispatch *), VT_DISPATCH}, // a IDispatch *
{'C', sizeof (unsigned char), VT_I4}, // c signed char
{'D', sizeof (double), VT_R8}, // d 8 byte real
{'F', sizeof (float), VT_R4}, // f 4 byte real
{'K', sizeof (IUnknown *), VT_UNKNOWN}, // k IUnknown *
{'H', sizeof (long), VT_I4}, // h HANDLE
{'L', sizeof (long), VT_I4}, // l long
{'P', sizeof (void *), VT_PTR}, // p pointer
{'S ', sizeof (BSTR), VT_LPSTR}, // s string
{'T', sizeof (short), VT_I2}, // t short
{'U', sizeof (UINT), VT_UINT}, // u unsigned int
{'W', sizeof (BSTR), VT_LPWSTR}, // w wide string
}
[B]
Which of the following is the Boolean Type returned? [/B]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.