COM object failed with error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

COM object failed with error

BryanT07
I have a lot of MATLAB code which runs an API through the COM interface, and I am trying to see if I can port the code over into Octave.

The software I am running through the API is SAP2000, and here is a sample code that runs within MATLAB, but will error out in Octave:

% run only in MATLAB
if ~isoctave
    % pass data to Sap2000 as one-dimensional arrays
    feature('COM_SafeArraySingleDim', 1);
    % pass non-scalar arrays to Sap2000 API by reference
    feature('COM_PassSafeArrayByRef', 1);
end
% create Sap2000 object
SapObject = actxserver('Sap2000v15.SapObject');
% start Sap2000 application
SapObject.ApplicationStart;
% create SapModel object
SapModel = SapObject.SapModel;
% initialize model
ret = SapModel.InitializeNewModel;
% create new blank model
ret = SapModel.File.NewBlank;


The command "pkg load windows" is added to the .octaverc file, and it looks like it successfully runs the actxserver command. However, I get the following error when "SapObject.ApplicationStart" is executed:

error: com_get: property/method invocation on the COM object failed with error `0x8002000e'


Does anyone know why I am getting this error?

The code runs in MATLAB when the two feature() commands are given, and I am wondering if I need a similar command in Octave.

Thanks in advance for the help!

Regards,
Bryan
Reply | Threaded
Open this post in threaded view
|

Re: COM object failed with error

PhilipNienhuis
BryanT07 wrote
I have a lot of MATLAB code which runs an API through the COM interface, and I am trying to see if I can port the code over into Octave.

The software I am running through the API is SAP2000, and here is a sample code that runs within MATLAB, but will error out in Octave:

% run only in MATLAB
if ~isoctave
    % pass data to Sap2000 as one-dimensional arrays
    feature('COM_SafeArraySingleDim', 1);
    % pass non-scalar arrays to Sap2000 API by reference
    feature('COM_PassSafeArrayByRef', 1);
end
% create Sap2000 object
SapObject = actxserver('Sap2000v15.SapObject');
% start Sap2000 application
SapObject.ApplicationStart;
% create SapModel object
SapModel = SapObject.SapModel;
% initialize model
ret = SapModel.InitializeNewModel;
% create new blank model
ret = SapModel.File.NewBlank;


The command "pkg load windows" is added to the .octaverc file, and it looks like it successfully runs the actxserver command. However, I get the following error when "SapObject.ApplicationStart" is executed:

error: com_get: property/method invocation on the COM object failed with error `0x8002000e'


Does anyone know why I am getting this error?

The code runs in MATLAB when the two feature() commands are given, and I am wondering if I need a similar command in Octave.
What Octave version, what windows package version?

Just type "ver" (w/o quote) in the Octave terminal.

Philip
Reply | Threaded
Open this post in threaded view
|

Re: COM object failed with error

BryanT07
Octave version is: 4.0.3
and
Windows package version is: 1.2.3

-Bryan

On Wed, Jul 20, 2016 at 8:46 AM, PhilipNienhuis [via Octave] <[hidden email]> wrote:
BryanT07 wrote
I have a lot of MATLAB code which runs an API through the COM interface, and I am trying to see if I can port the code over into Octave.

The software I am running through the API is SAP2000, and here is a sample code that runs within MATLAB, but will error out in Octave:

% run only in MATLAB
if ~isoctave
    % pass data to Sap2000 as one-dimensional arrays
    feature('COM_SafeArraySingleDim', 1);
    % pass non-scalar arrays to Sap2000 API by reference
    feature('COM_PassSafeArrayByRef', 1);
end
% create Sap2000 object
SapObject = actxserver('Sap2000v15.SapObject');
% start Sap2000 application
SapObject.ApplicationStart;
% create SapModel object
SapModel = SapObject.SapModel;
% initialize model
ret = SapModel.InitializeNewModel;
% create new blank model
ret = SapModel.File.NewBlank;


The command "pkg load windows" is added to the .octaverc file, and it looks like it successfully runs the actxserver command. However, I get the following error when "SapObject.ApplicationStart" is executed:

error: com_get: property/method invocation on the COM object failed with error `0x8002000e'


Does anyone know why I am getting this error?

The code runs in MATLAB when the two feature() commands are given, and I am wondering if I need a similar command in Octave.
What Octave version, what windows package version?

Just type "ver" (w/o quote) in the Octave terminal.

Philip


If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/COM-object-failed-with-error-tp4678684p4678685.html
To unsubscribe from COM object failed with error, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: COM object failed with error

Philip Nienhuis
Please do not top-post.
See below

BryanT07 wrote
On Wed, Jul 20, 2016 at 8:46 AM, PhilipNienhuis [via Octave] <
[hidden email]> wrote:

> BryanT07 wrote
> I have a lot of MATLAB code which runs an API through the COM interface,
> and I am trying to see if I can port the code over into Octave.
>
> The software I am running through the API is SAP2000, and here is a sample
> code that runs within MATLAB, but will error out in Octave:
>
> % run only in MATLAB
> if ~isoctave
>     % pass data to Sap2000 as one-dimensional arrays
>     feature('COM_SafeArraySingleDim', 1);
>     % pass non-scalar arrays to Sap2000 API by reference
>     feature('COM_PassSafeArrayByRef', 1);
> end
> % create Sap2000 object
> SapObject = actxserver('Sap2000v15.SapObject');
> % start Sap2000 application
> SapObject.ApplicationStart;
> % create SapModel object
> SapModel = SapObject.SapModel;
> % initialize model
> ret = SapModel.InitializeNewModel;
> % create new blank model
> ret = SapModel.File.NewBlank;
>
>
> The command "pkg load windows" is added to the .octaverc file, and it
> looks like it successfully runs the actxserver command. However, I get the
> following error when "SapObject.ApplicationStart" is executed:
>
> error: com_get: property/method invocation on the COM object failed with
> error `0x8002000e'
>
>
> Does anyone know why I am getting this error?
>
> The code runs in MATLAB when the two feature() commands are given, and I
> am wondering if I need a similar command in Octave.
>
> What Octave version, what windows package version?
>
> Just type "ver" (w/o quote) in the Octave terminal.

Octave version is: 4.0.3
and
Windows package version is: 1.2.3
So those are the latest versions....

(just a hunch) Any chance Octave runs out of memory? Assuming you got the binary installer from the main ftp site, you have a 32-bit version there.
Maybe permissions? firewalls? anti-virus SW?

As the very first method on the COM object returned from actxserver() already fails, I'm a bit out of ideas, sorry.

Would you be able to find out what other methods can be invoked on that object and try those? Unfortunately, "methods (<COM object>)" doesn't work like it does for e.g., Java objects, so you'd need documentation.

Philip