Reply

Return values index in Solid Edge

[ Edited ]

Anybody have a reference for return values when a  function runs?

 

For instance:  RetVal = objLinkDoc.Replace(NewFile)

 

What do the return values mean?


Thanks,
Ken

Production: ST9 MP7
Testing: ST10
3 REPLIES

Re: Return values index in Solid Edge

Ken,

I am not sure if I understand your question, as the call you are indicating does NOT exist in the API.

For the open call I would expect the RetVal to be a SolidEdgeDocument, but in general, when RetVal is of type Integer, I would consider it a HRESULT.

HRESULT is a C-type to return standard error codes by COM objects and some typical values can be found here.

You can also check Wiki on how a HRESULT value is constructed.

Re: Return values index in Solid Edge

I used the wrong thing which I fixed in my original post.  This is using the revman API.  The function is supposed to return a status as to it's success but I don't know what the returned integers mean.  I'm not sure they are the same as the HRESULT.


Thanks,
Ken

Production: ST9 MP7
Testing: ST10

Re: Return values index in Solid Edge

[ Edited ]

Ken,

 

It's not just you. The Revision Manager API is not designed the same as the Solid Edge API that we're used to working with. I've worked with their raw COM Type Libraries for a long time now and it's something that I've noticed too. My suspicion is that the Revision Manger API was not developed by the folks in Huntsville. I say that because the core Solid Edge APIs are fairly consistent in the way they're designed but the Revision Manager API doesn't seem to follow all of the same patterns.

 

For example, it is very unusual for a COM method to return a long unless the method is flagged as a property. Here is the raw COM IDL definition of the method you're trying to use. Note that it returns a long, again very unusual and very unclear. The consumer of this API has no clue what they are getting back from the method and it's not documented.

 

dispinterface IDocAuto {
	methods:
		[id(0x00000006), helpcontext(0x000186ae)]
		long Replace(
						BSTR NewFileName, 
						[in, optional] VARIANT Options);
};

 

Here is a similar example from the core Solid Edge API. It returns an HRESULT which is very clear. By clear I mean that there is no question on what we're getting back from the method.

 

interface _IApplicationAuto : IUnknown {
	[helpstring("...."), helpcontext(0x0000c393)]
	HRESULT _stdcall ReplaceReference(
					[in, optional] VARIANT FromReference, 
					[in, optional] VARIANT ToReference, 
					[in, optional] VARIANT Scope, 
					[in, optional] VARIANT Recursive);
};

So due to the design of the Revision Manager API, it's almost impossible to definitively answer your question without conversing with someone from development. All that I know to do as customers is bring it to their attention and hope they either fix it or at least document what we should expect to get back from calling the method.

Jason Newell
Applications Architect
www.jasonnewell.net