Click here to Skip to main content
15,914,165 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to Monitor "Internet explorer" ? Pin
mohamed hedi19-Oct-08 23:30
mohamed hedi19-Oct-08 23:30 
QuestionNever Created a ATL project from scratch on VC2003 - Manging COM ATL output files Pin
Stone Free16-Oct-08 6:12
Stone Free16-Oct-08 6:12 
AnswerRe: Never Created a ATL project from scratch on VC2003 - Manging COM ATL output files Pin
Stone Free16-Oct-08 6:32
Stone Free16-Oct-08 6:32 
QuestionRe: Never Created a ATL project from scratch on VC2003 - Manging COM ATL output files Pin
Stone Free16-Oct-08 6:49
Stone Free16-Oct-08 6:49 
QuestionReturning any HRESULT from FinalConstruct other than S_OK, results in client receiving REGDB_E_CLASSNOTREG Pin
Stone Free15-Oct-08 7:33
Stone Free15-Oct-08 7:33 
AnswerRe: Returning any HRESULT from FinalConstruct other than S_OK, results in client receiving REGDB_E_CLASSNOTREG Pin
Stuart Dootson15-Oct-08 10:09
professionalStuart Dootson15-Oct-08 10:09 
GeneralRe: Returning any HRESULT from FinalConstruct other than S_OK, results in client receiving REGDB_E_CLASSNOTREG Pin
Stone Free15-Oct-08 23:35
Stone Free15-Oct-08 23:35 
GeneralRe: Returning any HRESULT from FinalConstruct other than S_OK, results in client receiving REGDB_E_CLASSNOTREG Pin
Stuart Dootson16-Oct-08 2:57
professionalStuart Dootson16-Oct-08 2:57 
Ah, sorry - didn't quite pick up on that Frown | :-(

Anyway - I knocked up a little ATL server project and a client and I get the same behaviour as you (good start). Stepping back through the call stack (and keeping an eye on the value of EAX as that's where function return values are stored), it would seem that the REGDB_E_CLASSNOTREG is introduced inside ole32.dll, i.e. by Windows, because after your InprocServer fails to construct properly, OLE attempts to load your class using other COM server types (e.g. out-of-process server).

To cut a long story short, the correct HRESULT gets passed back to your client so long as you use the correct <a href="http://msdn.microsoft.com/en-us/library/ms693716(VS.85).aspx">CLSCTX</a>[<a href="http://msdn.microsoft.com/en-us/library/ms693716(VS.85).aspx" target="_blank" title="New Window">^</a>] enumeration in your call to CoCreateInstance.

Here's the code I used which picks up the correct HRESULT - my server is an in-process server (i.e. implemented in an ATL DLL project).


::CoInitialize(0);
CComPtr<IUnknown> wibble;
HRESULT hr = wibble.CoCreateInstance(CLSID_paf, 0, CLSCTX_INPROC_SERVER);


To re-iterate, using the appropriate CLSCTX enumeral should allow you to retrieve the correct HRESULT.
GeneralRe: Returning any HRESULT from FinalConstruct other than S_OK, results in client receiving REGDB_E_CLASSNOTREG Pin
Stone Free16-Oct-08 4:37
Stone Free16-Oct-08 4:37 
QuestionC#.net and VC++ Pin
balu1234514-Oct-08 7:23
balu1234514-Oct-08 7:23 
AnswerRe: C#.net and VC++ Pin
Stuart Dootson14-Oct-08 21:46
professionalStuart Dootson14-Oct-08 21:46 
QuestionIs it safe to use a iterator to keep a reference to an element in a container? Pin
followait10-Oct-08 17:34
followait10-Oct-08 17:34 
AnswerRe: Is it safe to use a iterator to keep a reference to an element in a container? Pin
Stuart Dootson11-Oct-08 7:44
professionalStuart Dootson11-Oct-08 7:44 
QuestionAssertion failed: _pAtlModule == 0 Pin
Christian Bayer8-Oct-08 23:32
Christian Bayer8-Oct-08 23:32 
AnswerRe: Assertion failed: _pAtlModule == 0 Pin
led mike10-Oct-08 5:22
led mike10-Oct-08 5:22 
GeneralRe: Assertion failed: _pAtlModule == 0 Pin
Christian Bayer12-Oct-08 22:14
Christian Bayer12-Oct-08 22:14 
GeneralRe: Assertion failed: _pAtlModule == 0 Pin
led mike13-Oct-08 6:07
led mike13-Oct-08 6:07 
GeneralRe: Assertion failed: _pAtlModule == 0 Pin
Christian Bayer13-Oct-08 9:40
Christian Bayer13-Oct-08 9:40 
GeneralRe: Assertion failed: _pAtlModule == 0 Pin
led mike13-Oct-08 9:56
led mike13-Oct-08 9:56 
GeneralRe: Assertion failed: _pAtlModule == 0 Pin
Christian Bayer13-Oct-08 12:38
Christian Bayer13-Oct-08 12:38 
QuestionAutomatically Start Windows Service on Startup [modified] Pin
narayanagvs6-Oct-08 22:10
narayanagvs6-Oct-08 22:10 
AnswerRe: Automatically Start Windows Service on Startup Pin
KarstenK6-Oct-08 23:22
mveKarstenK6-Oct-08 23:22 
AnswerRe: Automatically Start Windows Service on Startup Pin
Stuart Dootson6-Oct-08 23:53
professionalStuart Dootson6-Oct-08 23:53 
Questionwhy use parenthsis ? Pin
palmer774-Oct-08 17:47
palmer774-Oct-08 17:47 
Answer[Message Deleted] Pin
Steve Echols4-Oct-08 19:41
Steve Echols4-Oct-08 19:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.