Considerations for calling DLL (COM) in PHP: 1. In the function parameters, the last parameter function is the return value and must be of the retval type. 2. When passing a string type parameter to an interface, do not use BSTR * type, but use BSTR because BSTR itself is already a pointer. 3. The number 0 in PHP does not correspond to 0 or NULL in CC ++, but has another value. 4. PHP
Considerations for calling DLL (COM) in PHP: 1. In the function parameters, the last parameter function is the return value and must be of the retval type. 2. When passing a string type parameter to an interface, do not use BSTR * type, but use BSTR because BSTR itself is already a pointer. 3. The number 0 in PHP does not correspond to 0 or NULL in C/C ++, but has another value. 4. PHP
Notes for calling DLL (COM) in PHP:
1. In function parameters, the last parameter function is the return value, which must be of the retval type.
2. When passing a string type parameter to an interface, do not use BSTR * type, but use BSTR because BSTR itself is already a pointer.
3. The number 0 in PHP does not correspond to 0 or NULL in C/C ++, but has another value.
4. The NULL String "" in PHP does not correspond to NULL in C/C ++. It is best to determine whether it is a NULL string by calculating whether its length is 0.
5. If the interface output externally can be placed in a class, it is best to put them in a class. The class used in the output interface function is not used to export the function (but in the ATL Project), and the function is unavailable, it is unclear whether the interface is related to whether it is not in the same class.
6. Use: SysAllocString () to allocate space for the string and release it with: SysFreeString (mem. This is not necessary, but many examples on the Internet use this function to allocate and release space.
I am new to PHP and COM. If any of the above statements is incorrect, please leave a message to discuss them.
There are many resources on the Internet for creating DLL files that can be called by PHP. The following connection:
Http://www.360doc.com/content/10/0512/14/722458_27221569.shtml