[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62019] [octave forge] (windows) actxserver is
From: |
John Donoghue |
Subject: |
[Octave-bug-tracker] [bug #62019] [octave forge] (windows) actxserver is unable to create a server instance with a custom COM object |
Date: |
Tue, 15 Feb 2022 08:55:39 -0500 (EST) |
Follow-up Comment #1, bug #62019 (project octave):
Octave is using:
CoCreateInstance (clsID, NULL, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER,
IID_IDispatch, (void**)&disp)
So is probally the same issue as you guessed as python.
Untested ... but maybe will work by changing __COM__.cc per the diff below:
diff -r fc0ddf4d5b22 src/__COM__.cc
--- a/src/__COM__.cc Tue Feb 15 07:45:37 2022 -0500
+++ b/src/__COM__.cc Tue Feb 15 08:53:39 2022 -0500
@@ -514,6 +514,7 @@
std::wstring progID = string_to_wstring (args (0).string_value
());
CLSID clsID;
IDispatch *disp;
+ IUnknown *unknown;
if (CLSIDFromProgID (progID.c_str (), &clsID) != S_OK)
{
@@ -521,12 +522,19 @@
return retval;
}
if (CoCreateInstance (clsID, NULL,
CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER,
- IID_IDispatch, (void**)&disp) != S_OK)
+ IID_IUnknown, (void**)&unknown) != S_OK)
{
error ("actxserver: unable to create server instance for
`%s'",
args (0).string_value ().c_str ());
return retval;
}
+ if (unknown->QueryInterface(IID_IDispatch, (void **)disp) != S_OK)
+ {
+ unknown->Release ();
+ error ("actxserver: unable to get dispatch interface for
`%s'",
+ args (0).string_value ().c_str ());
+ return retval;
+ }
retval = octave_value (new octave_com_object (disp, false));
}
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62019>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/