COM client hresult error -2147467259

COM client hresult error -2147467259

I kepp getting the same error and don't know how to proceed.

We're testing the COM extension in IVF to exchange data with C#. We created a simple COM server with 2 classes - Node and NodeList. The Node class has 2 real variables x, y with methods enabling to set/get their values. The NodeList class has a simple list of Node objects, having two methods AddNode(NodeList,Node) and GetNode(NodeList,Node), each of them setting and getting a Node-Object in/from the list.

In Fortran, I successfully create NodeList and Node objects by calling COMCreateObjectByGUID. Setting and getting x and y valuesin Node-Object by calling functions generated by the IVF wizzard works ok. However, the AddNode function returns a non-zero result (-2147467259).

I've tried to set a pointer on an interface different than the one created by the IVF-Wizzard (IID_INode) by calling COMQueryInterface, but without success. I've tried IID_IDispatch, IID_IUnknown. What is wrong? We trei the server with C# and Delphi and it works ok.

I also found an actaul post with a similar problem: Does this mean, that using object pointers as arguments in COM functions (beside the pointer of the objects containing the function itself) does not work with IVF?



Downloadapplication/octet-stream cpm-client.f901.43 KB
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Just showing the Fortran code is probably insufficient. You're going to need to debug-step into the routine generated by the module wizard and see which line there is triggering the error. When I have had to debug such issues in the past, I needed a working copy of the COM object to test against.

Don't assume that other reports of the same error have the same cause. That is almost never the case - especially with COM errors.

Retired 12/31/2016

Steve is particularly correct for your particular error number. If you feed that to the Error Lookup tool, it will tell you that your value which corresponds to 0x80004005 in hex is reported for an "Unspecified Error" which means that there is something wrong that the author of you COM interface didn't anticipate. Any COM interface could give this message for innumerable causes.

Thanks for your comments. We solved the problem by adjusting the COM-Server in C#. The AddNode-Method now creates a new object, puts it in the NodeList and returns the Node-Pointer to the COM-client (Fortran). So the Node Object must not be created in Fortran COM-client with COMCreateObject.
The question remains, why was I able to use the 'old' COM-server with Delphi but not with Fortran. It seems that IVF COM-extension supports only basic COM features. Is it possible, for example, to create child objects in the COM client by using COMCreateObject function and then to use them with the root object or all child objects must be created by methods of the root object?
Generally, I think that the COM extension in Fortran is very useful, however, the explanation in the help on this extension does not give enough information to use it. It would be a good idea to expand the help file with more explanation and more examples. For example, we needed a few days to figure out how to implement COM Server Properties in Fortran by using get and put. It would be much better to explain this on an example in the help file.

Leave a Comment

Please sign in to add a comment. Not a member? Join today