Link to home
Start Free TrialLog in
Avatar of james henderson
james hendersonFlag for United States of America

asked on

Calling a Windows dll from PHP 5.2.3

I am using php 5.2.3 and would like to call a windows dll I wrote. The dll is an mfc dll, but the functions are exported as      extern "C" VOID PASCAL EXPORT MyFunction(char* name, char* city).  Any help appreciated.
Avatar of Rurne
Rurne
Flag of United States of America image

If your DLL contains a COM server and implements IDispatch, then you should be able to load it.  If not, then you're probably going to have to write a custom PECL/Zend extension to load the DLL.
Avatar of sakuya_su
sakuya_su

these are better handle either with a extension, or in some cases a call to a console application written in C/C++ etc
Avatar of james henderson

ASKER

Thanks for the response.  How would I add a com server to my dll and implement IDispatch?  I'm not a MS C++ developer, so I would appreciate some guidance here, maybe some example code I can try.  I'm also unclear how I would call a console app from PHP if I can't call a dll.
ASKER CERTIFIED SOLUTION
Avatar of sakuya_su
sakuya_su

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial