|
Does anyone know if there is a mechanism by which you can convert/format an HRESULT value (say 0x80004005) to a human readable equivalent (in the case of the example 0x80004005 = "E_FAIL")
Obviously I could create a static map of HRESULTS to Message Text, just wondered if there was a pre-existing way to do it?
- "I'm not lying, I'm just writing fiction with my mouth"Phil Harding. myBlog [^] | mySite [^]
|
|
|
|
|
FormatMessage will convert to the 'user-friendly' error message. It's not that user-friendly, of course, because the message is necessarily generic. The English message text is given in WinError.h , in a comment above the definition of the message constant.
Be aware that errors with codes 0x8004nnnn are relative to the COM interface you used (4 is FACILITY_ITF ) and will have different meanings for different interfaces.
I'm not sure if FormatMessage will directly handle error codes in the 0x8007nnnn (FACILITY_WIN32 ) range, which are mapped from the Win32 error codes below 65536 (using HRESULT_FROM_WIN32 ).
|
|
|
|
|
You're not thinking about ::FormatMessage() , are you?
It would give you the string "Unspecified error." for the error code E_FAIL .
But you want the string "E_FAIL", right?
If your answer is 'yes' I don't think there exist such a mapping between a C++ identifier and a string. At least not any I know.
But it does however make me question if the string should be considered "human readable"...
If I really needed that I would parse <winerror.h>.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Hi,
I want to know what is the use of "extern C" in the following code snippet from a header file:
extern "C"
{
// {CA76604A-8402-472b-B115-138BAF2178BF}
extern const IID IID_IX =
{ 0xca76604a, 0x8402, 0x472b, { 0xb1, 0x15, 0x13, 0x8b, 0xaf, 0x21, 0x78, 0xbf } };
}
Vinod.C.S
|
|
|
|
|
Specifies C linkage instead of the C++ one.
see [^] and [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
But here v can see no functions only constant varibles .
Is the function rule applies to variable name also?
Vinod.C.S
|
|
|
|
|
Vinod CS wrote: Is the function rule applies to variable name also?
Yes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi folks,
I've built an ActiveX control successfully, can view it in OleView, it's working fine.
I'd like to embed it in an HTML web page. Obviously, users that don't have this installed will need to run my MSI installer program that registers the ActiveX control, writes some things to the registry, etc. How do I tell the web page to use my MSI installer if the user doesn't have the ActiveX control already installed?
|
|
|
|
|
I have a dll written in C++ running in a Linux machine. Now i want to move that dll to a Windows system and use it with a Windows application.
How can i do that?
Can you please tell what all are the performance issues i face?
What all are the dependencies?
Thanks in advance
|
|
|
|
|
- The source code needs to be made compatible across the platforms and compilers used on Linux and Windows (Boost & STL are usefull in this case and versions of it are available for Win/Linux compiler environments)
- Platform specific APIs need to be conditionally compiled (to retain the same code base across environments) or replaced
- On Windows you'll need to write some DLL module code (DllMain mostly) and expose your codes functions as DLL exports (decorate a function with __declspec(export) or use the .DEF file method)
- Compile the code and link as a DLL (library)
- "I'm not lying, I'm just writing fiction with my mouth"Phil Harding. myBlog [^] | mySite [^]
|
|
|
|
|
please help me to get the code of Ant on a Chessboard .....
|
|
|
|
|
|
|
Hai all,
Do anyone know , how to pass a C++ class from a VC++ Client to a COM EXE Server, through VARIANT.
Thanks,
George.
|
|
|
|
|
see here [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi all!
I want to know how to write a method of interface like SORT that is able to sort
any kind of data(float,long,string) passes to it from VB,VC++ client.
Thanks in Advance.
Viral Joshi.
|
|
|
|
|
A COM server accepts typed data. So, in principle you have to do some workaround to obtain generality.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi!
Thanks for the reply.
But i am not clear with the solution any related material or example will
help me better.
Thanks,
Viral Joshi.
|
|
|
|
|
I am using following code
COSERVERINFO serverinfo;<br />
COSERVERINFO* pServerInfo = new COSERVERINFO;;<br />
COAUTHINFO* pCOMAuthInfo = new COAUTHINFO;<br />
<br />
serverinfo.dwReserved1 = 0;<br />
serverinfo.dwReserved2 = 0;<br />
serverinfo.pwszName = m_strServerAddress.AllocSysString();<br />
pCOMAuthInfo->dwAuthnLevel = RPC_C_AUTHN_LEVEL_NONE;<br />
serverinfo.pAuthInfo= pCOMAuthInfo;<br />
<br />
if (m_strServerAddress.IsEmpty())<br />
pServerInfo = NULL;<br />
else<br />
pServerInfo = &serverinfo;<br />
<br />
MULTI_QI qi = {&IID_ICRSObj, NULL, 0};<br />
<br />
hr = CoCreateInstanceEx(CLSID_CCRSObj,NULL, CLSCTX_ALL, <br />
pServerInfo, 1, &qi);
but when i call CoCreateInstanceEx i get the error : hr 0x800703e6 Invalid access to memory location.
Regards,
Mushq
|
|
|
|
|
Hi all!
I want to pass the object(say studentobj having members:id,name,sub1mark,sub2mark)from VB client to the method of interface.
requirements:
1) I want that the passed object's should be stored in COM servers student class (a class added in the com server) other than the interface class.
2) COM Server is having a method in interface that returns the student object that has got the 1st rank among the other student.
All I want to know is only how to pass and return objects to and from COM Servers.
Thanks in Advance.
Viral Joshi.
|
|
|
|
|
Have a look at this[^] article. It states how to use such struct in COM objects.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi!
Prasad_som thanks very much for the support.
I'll see the details of this article and will definately revert back to you.
And it is sure that i am going to take your help whenever there are problems in the road
of COM & ActiveX In ATL.
Once again very much thanks for the cooperation.
Viral Joshi
|
|
|
|
|
Hi I created an ASP.NET application in VS 2005, IIS 5.1 (which would login to a site like gmail.com after taking the user & password details), using vb.I am using interop.shdocvw.dll to invoke the internet explorer through which i am navigating the elements of the html document and passing the values(User Name And Password). When I run this URL in the windows 2003 server machine (local host where application is installed) it works fine ,but when i am trying to access the same url from other client machines ,it is promting me to enter username & password for the windows 2003 server.
How do I bypass the user / password validation for windows 2003.
arumugam_mr
|
|
|
|
|
Hi,
I m new to COM/DCOM world. May any one plz tell me that is it possible to share data/information of a DLL Surrogate between multiple clients. Any
Thanks,
Touseef Afzal
"I only fail when i give up "
|
|
|
|