Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1660
  • Last Modified:

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.
0
dhenderson12
Asked:
dhenderson12
  • 2
1 Solution
 
RurneCommented:
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.
0
 
sakuya_suCommented:
these are better handle either with a extension, or in some cases a call to a console application written in C/C++ etc
0
 
dhenderson12Author Commented:
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.
0
 
sakuya_suCommented:
if it is an MFC then it should be native to C++, you can call those like any other dll. So all you ened to do is start a console application, then in the int main block simply call the function of an external dll, and off you go xD

to call function from a DLL:
http://www.goffconcepts.com/techarticles/development/cpp/calldll.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now