php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18900 com_invoke cannot find method
Submitted: 2002-08-14 06:54 UTC Modified: 2002-08-14 20:26 UTC
From: mlorenz at novadys dot com Assigned:
Status: Closed Package: COM related
PHP Version: 4CVS-2002-08-14 OS: Windows2000 Professional
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mlorenz at novadys dot com
New email:
PHP Version: OS:

 

 [2002-08-14 06:54 UTC] mlorenz at novadys dot com
The last line of the following script raises an error
'Unable to lookup Add'

  $myDMMain = new COM("DMServ.DMMain.1") or die("could not create main");
  $myDMConn = $myDMMain->Login("Novadys","",1033) or die("login failed");
  $myDMImporter = new COM("Documind.DmImporter.1") or die("could not create importer");
  $myDMImporter->Connection = $myDMConn;
  $myDMImporter->Archive = "files" or die ("kacke");
  $myDMImporter->JobFlags = DMDoc_Import;
  $DMDocList = $myDMImporter->Documents or die ("could not create doclist");
  $test=com_invoke($DMDocList,"Add","c:\\test.txt");
  ...

It seems that the call

  obj = (comval *)zend_list_find(Z_LVAL_P(object), &type);

returns the wrong obj because obj->resourceindex is 1 but
it has been set to 4 when the entry has been created in
php_COM_set.

Best regards,
Michael

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-14 20:26 UTC] phanto@php.net
the functional and the oo api are not yet compatible. i suggest you to stick with the oo api because it is more consistent.
com_invoke expects a resource as first parameter, but $DMDocList is an object because it was (implicitly) created with 'new' and not with com_load().
this is already unified in the upcoming new version that will ship with the next major php release (ZE2).

Harald
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 14:01:29 2024 UTC