FAQ Search Memberlist RSS Feed Register Profile Log in to check your private messages Log in
How COM and OPC assigns HRESULT codes

 
Post new topic   Reply to topic    OPC Foundation Message Board Forum Index -> AE (Alarms & Events) FAQ
View previous topic :: View next topic  
Author Message
Randy



Joined: 27 Feb 2003
Posts: 3532
Location: OPC Foundation

PostPosted: Wed Nov 30, 2005 2:54 pm    Post subject: How COM and OPC assigns HRESULT codes Reply with quote

The OPC specifications follow the convention recommended by Microsoft when it comes assigning numeric values to OPC defined errors. Unfortunately, this means that OPC defined error codes can conflict with error codes defined by other applications such as COM+. The text of the recommendation can be found here:

Quote:
…”For most status codes returned from interface methods. The actual meaning of the error is defined by the interface. That is, two HRESULTs with exactly the same 32-bit value returned from two different interfaces might have different meanings. “…

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/97e68708-eb62-4481-af03-cf8b80304103.asp

Therefore, all applications processing error codes returned from an OPC interfaces (i.e. by calling FormatMessage) should assume that the error code is an OPC code first. If no matching OPC code is found then the application should look for system defined codes. An application that looks for system defined codes first could incorrectly identify an OPC error as a system error.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OPC Foundation Message Board Forum Index -> AE (Alarms & Events) FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group