Newbie asks about accessing COM from C...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I've got a series of COM objects that I thought I'd be able to access
through PHP, but it looks like I'll need to write a C "PHP Extension" to do
the work and pass data to the PHP scripts. I understand how to write an
extension, I'm well acquainted with working with developing DLLs in C.

The part I don't know is the syntax of using COM and I'm pretty rusty with
C++. I have an interface diagram and know the methods I need to call. But
I have some IDL/TLB files that I'm not sure how to use. I added the IDL
files to a quick project that I was toying with and I can browse them in the
Class View...

1) Is there a baby-step guide for instantiating these objects (I don't know
a CLSID from an IID - I'm not even sure where to look these up)?

2) The other question is how to integrate a blob of C++ code into a C DLL.
The C file is pretty heavily entrenched in "C-ville", there are a ton of
macros and things I don't want to think about converting. Plus I need to
make sure that the DLL is loadable/callable by the server. So unless I code
the COM interface piece in C, I'll have to mix the languages.


Thanks for any help,

LeeStewart @ gmail.com


.



Relevant Pages

  • Re: php e c++
    ... dovrei far in modo di inviare un comando dalla pagina php ad una dll, ... I sort of deduct you want to know how to invoke a DLL from within a PHP ... function/method in the C++ program, ...
    (comp.lang.php)
  • Re: PHP has encountered an access violation...
    ... I uninstalled PHP 5.2.5 and installed 5.2.6. ... correct dll to be used...thus solving your problem and the related symptoms. ... IIS, i've run several web servers with it, private and commercial, and never ...
    (comp.lang.php)
  • Re: [PHP] Missing DLLs
    ... Is that something in PHP source that could be fixed to specify WHICH dll is really missing? ... I'm happy to put it in bugs.php.net as a feature request, if it's actually IN php, but don't want to waste the resources to mark it as junk if there's no way PHP could do that. ... It's been a while since I've done Windows development, but IIRC PHP will only be able to tell that the DLL could not be loaded, I don't believe Windows exposes exactly what the problem was. ... Because I can recall other times that you got the urge to hit your head on the keyboard multiple times in order to get over the fact that the problem that caused the error was so ...king obvious. ...
    (php.general)
  • Re: [PHP] Missing DLLs
    ... Is that something in PHP source that could be fixed to specify WHICH dll is really missing? ... I'm happy to put it in bugs.php.net as a feature request, if it's actually IN php, but don't want to waste the resources to mark it as junk if there's no way PHP could do that. ... It's been a while since I've done Windows development, but IIRC PHP will only be able to tell that the DLL could not be loaded, I don't believe Windows exposes exactly what the problem was. ... Because I can recall other times that you got the urge to hit your head on the keyboard multiple times in order to get over the fact that the problem that caused the error was so ...king obvious. ...
    (php.general)
  • Re: Using C libraries and PHP - calling functions in external libraries
    ... Unfortunately, my .dll is a Windows .dll, ... not a PHP extension - and it needs to run on my hosted UNIX server, ... PHP call to it to respond properly. ...
    (alt.php)