Hi, I am writing a php application to use a com object that is defined in my OS, but I have difficulties getting a (smart)pointer from another com-object.
Here is the code (untill the error):
$ConnectionObj = new COM("Falcon.ConnectionObject") or die("Unable to instanciate ConnectionObject"); //First COM-object !!!!
print "Loaded ConnectionObject\n";
$GroupDataObj = new COM("Falcon.GroupData") or die("Unable to instanciate GroupDataObject"); //Second COM-object!!!
print "Loaded GroupDataObject\n";
$devOpenErr = $ConnectionObj->Open2("FalconEdi.Pei16Edi.1","COM1");//);
$result = $GroupDataObj->Connection($ConnectionObj);
At this last line I get the error Invoke() failed:exception occured. I
think this is because I don't know how to get a smartpointer to that $ConnectionObject. Because a paramter in the GroupDataObj must be a pointer to the first COM-object and this is done throught this function (GroupDataObj->Connection) which takes a pointer to that interface (com-object).
The function GroupDataObj->Connection is defined as follows:
HRESULT IGroupDataTransfer::Connection ( [in] IConnection * newVal )
with "IConnection" the Interface "Falcon.ConnectionObject" like in my php code above.
In C++, my last line of code, would have been done as follows:
HRESULT hr = GroupdataObj->Connection
(IConnectionPtr(IConnectionObj));
But in C++ the header function is used and this is what I found for
the definition of IConnectionPtr:
#if defined(__cplusplus) && defined(_MSC_VER) && defined(_COM_SMARTPTR_TYPEDEF)
_COM_SMARTPTR_TYPEDEF(IConnection, __uuidof(IConnection));
Anybody knows ho to do that in PHP ? 🙁
Are thes variables I created abov, "$ConnectionObj" and
"$GroupDataObj" pointers or php-com-structures and if the last how can
you get a pointer to it then ?
Thank you very much !!