Click here to Skip to main content
15,926,939 members
Home / Discussions / COM
   

COM

 
GeneralRe: Acessing ActiveX Component Interfaces/ Library not registered Pin
Florian Storck2-Jun-05 23:34
Florian Storck2-Jun-05 23:34 
GeneralRe: Acessing ActiveX Component Interfaces/ Library not registered Pin
Jörgen Sigvardsson17-Jun-05 22:06
Jörgen Sigvardsson17-Jun-05 22:06 
GeneralRe: Acessing ActiveX Component Interfaces/ Library not registered Pin
Florian Storck19-Jun-05 21:03
Florian Storck19-Jun-05 21:03 
GeneralLocking Display Of ActiveX Control Pin
AntonioKeh31-May-05 14:47
AntonioKeh31-May-05 14:47 
GeneralAxShockwaveFlashObjects.AxShockwaveFlash Flashvars Pin
davidhart31-May-05 3:59
davidhart31-May-05 3:59 
QuestionHow to write IE toolbar without ATL (on win32API)? Pin
Anonymous30-May-05 9:53
Anonymous30-May-05 9:53 
AnswerRe: How to write IE toolbar without ATL (on win32API)? Pin
Andy Moore6-Jun-05 8:03
Andy Moore6-Jun-05 8:03 
General"No such interface supported" returned from CoCreateInstance on successful IClassFactory->CreateInstance Pin
T-Wilson28-May-05 4:26
T-Wilson28-May-05 4:26 
Hi,

I have an exe server and a client exe, the server starts up and does a CoRegisterClassObject for an IClassFactory implementation that provides "ComTestObject" instances.

The Client does " CoCreateInstance", while debugging the server I can see that the object requested ("IComTestObject") is created in the Class Factory and the pointer from the client is set. The IClassFactory returns S_OK

Now, I jump back to debugging the client, and CoCreateInstance returns 0x80004002 = "No such interface supported"

I really don't understand why this is being returned. When I clearly saw the server code create a new ComTestObject and return S_OK

What am I doing wrong, is there some common mistake here?

Here is the code for the Factory CreateInstance method, in the server:

/*--------------*/

STDMETHODIMP ComTestObjectFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv){



ComTestObject *p_obj;
HRESULT hr;

if (pUnkOuter)
return (CLASS_E_NOAGGREGATION);

if (IsEqualIID (riid, IID_IUnknown) ||
IsEqualIID (riid, IID_IComTestObject)) {

// Create New menu item object.
p_obj = new ComTestObject();
if (!p_obj)
return E_OUTOFMEMORY;
// See if object exports the proper interface.
hr = p_obj->QueryInterface (riid, ppv);
// This will cause an object delete unless interface found.
p_obj->Release ();
return hr;
}
return E_NOINTERFACE;

}

/*--------------*/

Here is the client code that asks for the object:


void makeObject(){

CoInitialize(NULL);

ComTestObject *p_obj;

HRESULT res=CoCreateInstance(CLSID_ComTestObject,NULL,
CLSCTX_LOCAL_SERVER,IID_IComTestObject,(void**)&p_obj);

}




Thanks for any help with this.



- Tom
GeneralMS Excel COM Interface description Pin
rantotiaray27-May-05 4:06
rantotiaray27-May-05 4:06 
GeneralVariants Pin
ursus zeta28-May-05 8:18
ursus zeta28-May-05 8:18 
GeneralRe: MS Excel COM Interface description Pin
Veera Raghavendra17-Jun-05 19:35
Veera Raghavendra17-Jun-05 19:35 
GeneralWMI and COM Pin
macakd24-May-05 12:54
macakd24-May-05 12:54 
GeneralRe: WMI and COM Pin
Member 19404227-Jun-05 3:55
Member 19404227-Jun-05 3:55 
GeneralProbably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck18-May-05 3:34
Florian Storck18-May-05 3:34 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
hanofee27-May-05 4:28
hanofee27-May-05 4:28 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck27-May-05 4:43
Florian Storck27-May-05 4:43 
GeneralRe: Probably dumb question: passing IUnknown** to VB/MCPP/C# Pin
Florian Storck1-Jun-05 23:06
Florian Storck1-Jun-05 23:06 
GeneralOk. The dumbest 2 questions Pin
CherezZaboro16-May-05 4:53
CherezZaboro16-May-05 4:53 
GeneralRe: Ok. The dumbest 2 questions Pin
rwestgraham16-May-05 10:55
rwestgraham16-May-05 10:55 
GeneralRe: Ok. The dumbest 2 questions Pin
CherezZaboro16-May-05 11:01
CherezZaboro16-May-05 11:01 
GeneralRe: Ok. The dumbest 2 questions Pin
rwestgraham16-May-05 11:37
rwestgraham16-May-05 11:37 
GeneralRe: Ok. The dumbest 2 questions Pin
User 21559721-May-05 0:38
User 21559721-May-05 0:38 
GeneralDCOM and C# Pin
Millzy14-May-05 10:22
Millzy14-May-05 10:22 
GeneralSharing enums between COM objects Pin
Sir Garence12-May-05 23:52
sussSir Garence12-May-05 23:52 
GeneralRe: Sharing enums between COM objects Pin
User 21559719-May-05 21:45
User 21559719-May-05 21:45 

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.