php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12718 com_invoke always seems to return false
Submitted: 2001-08-13 11:35 UTC Modified: 2001-08-13 20:43 UTC
From: n dot morse at hyperknowledge dot com Assigned: phanto (profile)
Status: Closed Package: COM related
PHP Version: 4.0.6 OS: Win 2k
Private report: No CVE-ID: None
 [2001-08-13 11:35 UTC] n dot morse at hyperknowledge dot com
I created a simple COM objecj in Vis C++.  It has a method "hello" on it that does nothing except return S_OK, and a property "bar" that returns a string.

I can use com_load to create the object and I can get the property string back out (com_propget), but if I call "hello" then it returns FALSE.

$svr = com_load( "SIMPLECOMASP.NKMSimpleObj" );
$foo = com_invoke( $svr, "hello" );

if ( $foo )
  echo $foo;
else
  echo "No";

I created another method taking a BSTR input and a BSTR* output and that always returns false with the output being empty.  I tried the calls from VB as well, and they seem to work OK, so the COM oject looks functional. If I run the COM exe from the debugger, I can trace through the functions - so they *are* being called, just a bogus return code from somewhere.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-13 12:46 UTC] n dot morse at hyperknowledge dot com
Just to add to this: If I make the return value a "retval" in the IDL then I can use com_invoke and it works (for the same reason that a propget works). It just doesn't seem to like "normal" HRESULT return
 [2001-08-13 16:37 UTC] phanto@php.net
ok, i'll check this

just beeing nosily, what does

$svr = new COM("SIMPLECOMASP.NKMSimpleObj");
echo $svr->hello();


return ?
 [2001-08-13 20:43 UTC] phanto@php.net
fixed in cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 13:01:30 2024 UTC