Click here to Skip to main content
15,927,593 members
Home / Discussions / COM
   

COM

 
GeneralActiveX and IE Events Pin
7-Jan-02 11:16
suss7-Jan-02 11:16 
GeneralRe: ActiveX and IE Events Pin
Todd Smith7-Jan-02 11:18
Todd Smith7-Jan-02 11:18 
GeneralRe: ActiveX and IE Events Pin
7-Jan-02 11:21
suss7-Jan-02 11:21 
General(KERNEL32.DLL): 0x000006F4: (no name) Pin
4-Jan-02 4:59
suss4-Jan-02 4:59 
GeneralRe: (KERNEL32.DLL): 0x000006F4: (no name) Pin
7-Jan-02 0:26
suss7-Jan-02 0:26 
GeneralCOM_INTERFACE_ENTRY brings nothing Pin
2-Jan-02 23:07
suss2-Jan-02 23:07 
GeneralRe: COM_INTERFACE_ENTRY brings nothing Pin
Not Active3-Jan-02 6:39
mentorNot Active3-Jan-02 6:39 
GeneralRe: COM_INTERFACE_ENTRY brings nothing Pin
7-Jan-02 21:09
suss7-Jan-02 21:09 
Calling DllGetClassObject directly is not restricted by any standard, as I know. This approach eliminates the necessity to register a server in the system registry, moreover such a server may be located in arbitrary way implied by software. But this is not the question. Do you mean that ATL does not conform to all generally allowed methods of interactions?

After a little investigation of ATL headers I've found out that my problem arises from the fact, that OBJECT_ENTRY macro uses standard ATL's class factory class, namely CComClassFactory. Then a client asks a server to create an object with some interface, supported by my custom COM object, ATL makes a call to CComClassFactory. The ATL templates are written in such a way, that CComClassFactory does not know anything about my custom interface (it knows only IClassFactory) and returns an error. So, now, the question is, how to bind custom interfaces to standard CComClassFactory?

The other possible decision is to change client application.
I've tried to call DllGetClassObject requesting IID_IClassFactory
first, and then use an aquired pointer to call CreateInstance for
custom interface. This is the standard approach. But it doesn't
work in very strange manner:
the call to DllGetClassObject returns success and
fills provided IClassFactory pointer with _something_ like
an object without IClassFactory methods!

// obtaining &DllGetClassObject for pGetClass
...
if( SUCCEEDED((*pGetClass)(clsid, IID_IClassFactory, &pVoid)))
{
pUnk = ((LPUNKNOWN)pVoid);
pCF = (LPCLASSFACTORY)pUnk; // dummy line
// pCF->AddRef(); // if uncommented, works fine
// pCF->LockServer(TRUE); // memory exception, if uncomment
if( SUCCEEDED(pCF->CreateInstance(NULL, riid, &pVoid))) // memory
exception
{
}
// pCF->LockServer(FALSE);
pCF->Release();
return pVoid;
}

Because I haven't even started to write applied code, the results are from ATL itself. I'm confused by now.

GeneralDCOM, Events and Performance Pin
Firoz31-Dec-01 18:55
Firoz31-Dec-01 18:55 
GeneralRe: DCOM, Events and Performance Pin
Anand Amirineni15-Mar-02 9:35
Anand Amirineni15-Mar-02 9:35 
GeneralATL ASP Global.asa Pin
jubinishoo27-Dec-01 18:41
jubinishoo27-Dec-01 18:41 
QuestionApartment? Pin
ragamuffin26-Dec-01 19:29
ragamuffin26-Dec-01 19:29 
AnswerRe: Apartment? Pin
geoff3-Jan-02 18:13
geoff3-Jan-02 18:13 
GeneralRe: Apartment? Pin
Not Active4-Jan-02 20:15
mentorNot Active4-Jan-02 20:15 
GeneralRe: Apartment? Pin
geoff5-Jan-02 2:38
geoff5-Jan-02 2:38 
GeneralHelp! How to understanding marshaling! Pin
Kang wenzhen24-Dec-01 22:16
Kang wenzhen24-Dec-01 22:16 
GeneralRe: Help! How to understanding marshaling! Pin
Tim Smith25-Dec-01 2:36
Tim Smith25-Dec-01 2:36 
GeneralProblems with class header of COM object Pin
IGx8922-Dec-01 8:52
IGx8922-Dec-01 8:52 
GeneralRe: Problems with class header of COM object Pin
IGx8922-Dec-01 8:56
IGx8922-Dec-01 8:56 
GeneralRe: Problems with class header of COM object Pin
Michael Dunn22-Dec-01 14:51
sitebuilderMichael Dunn22-Dec-01 14:51 
GeneralRe: Problems with class header of COM object Pin
IGx8922-Dec-01 16:01
IGx8922-Dec-01 16:01 
Generalusing IDirectDraw7 in a type library Pin
20-Dec-01 15:36
suss20-Dec-01 15:36 
GeneralATL and MFC OnIdle() Pin
Jamie Hale18-Dec-01 6:01
Jamie Hale18-Dec-01 6:01 
GeneralProblem identified... Pin
Jamie Hale18-Dec-01 9:27
Jamie Hale18-Dec-01 9:27 
GeneralRe: Problem identified... Pin
Ernest Laurentin18-Dec-01 9:48
Ernest Laurentin18-Dec-01 9:48 

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.