Click here to Skip to main content
16,017,069 members
Home / Discussions / COM
   

COM

 
GeneralRe: Connection Points and [out] parameters Pin
geo_m26-May-03 7:41
geo_m26-May-03 7:41 
GeneralCOM Client problem Pin
YSRao14-May-03 1:15
YSRao14-May-03 1:15 
GeneralRe: COM Client problem Pin
valikac14-May-03 8:27
valikac14-May-03 8:27 
GeneralRe: COM Client problem Pin
Anonymous14-May-03 19:07
Anonymous14-May-03 19:07 
GeneralRe: COM Client problem Pin
balcn14-May-03 8:51
balcn14-May-03 8:51 
GeneralRe: COM Client problem Pin
Anonymous14-May-03 18:42
Anonymous14-May-03 18:42 
GeneralRe: COM Client problem Pin
valikac14-May-03 19:55
valikac14-May-03 19:55 
GeneralRe: COM Client problem Pin
balcn16-May-03 8:05
balcn16-May-03 8:05 
Here I have given a sample working code for a COM client

// COMClientDlg.cpp : implementation file

#include "stdafx.h"
#include "COMClient.h"
#include "COMClientDlg.h"

#include "COMServer.h"
#include "COMServer_i.c"

............................
............................
............................

HRESULT hr;
IMessage *msg;

hr = CoInitialize(0);
//initialize COM

if( SUCCEEDED(hr) )
{
hr = CoCreateInstance(
CLSID_Message,
NULL,
CLSCTX_INPROC_SERVER,
IID_IMessage,
(void **)&msg

);

if( SUCCEEDED(hr) )
{
msg->Show();
msg->Release();
}
else
{
AfxMessageBox("Cannot create COM object");
}

CoUninitialize();
//uninitialize COM
}
else
{
AfxMessageBox("Cannot initialize COM");
}

This code worked fine when I tested under an MFC dialog project.

The server was created as a DLL by the ATL wizard. While creating a simple object
the following options were selected.

Threading Model - apartment
Interface - dual
Aggregation - yes


If you still have trouble you can mail your code to me

R.BALACHANDRAN
GeneralRe: COM Client problem Pin
Dudi Avramov18-May-03 23:11
Dudi Avramov18-May-03 23:11 
GeneralHelp : About Active Document Pin
twinkle_star13-May-03 16:59
twinkle_star13-May-03 16:59 
QuestionDifference between Webbrowser contorl and InternetExplorer object ? Pin
GriffonRL13-May-03 3:51
GriffonRL13-May-03 3:51 
QuestionCan a method of COM-server return a string pointer Pin
Bash12-May-03 19:52
Bash12-May-03 19:52 
AnswerRe: Can a method of COM-server return a string pointer Pin
justanotherprogrammer12-May-03 21:13
justanotherprogrammer12-May-03 21:13 
GeneralRe: Can a method of COM-server return a string pointer Pin
valikac13-May-03 16:01
valikac13-May-03 16:01 
GeneralRe: Can a method of COM-server return a string pointer Pin
Renjith Ramachandran15-May-03 5:57
Renjith Ramachandran15-May-03 5:57 
Generalactivex parent Pin
Shotgun12-May-03 15:28
Shotgun12-May-03 15:28 
GeneralSAFEARRAY question Pin
Stephane Routelous12-May-03 8:15
Stephane Routelous12-May-03 8:15 
GeneralRetrieving Pointer to IOleClientSite Pin
GeorgT12-May-03 4:15
GeorgT12-May-03 4:15 
GeneralUsing Updated Interface Pin
swarup12-May-03 3:17
swarup12-May-03 3:17 
Generalerror calling method in event Pin
particle2k11-May-03 23:44
particle2k11-May-03 23:44 
GeneralRe: error calling method in event Pin
Vi215-May-03 3:43
Vi215-May-03 3:43 
Generalexe-server component's interface related Pin
satishsilla11-May-03 20:54
satishsilla11-May-03 20:54 
GeneralRe: exe-server component's interface related Pin
valikac13-May-03 16:04
valikac13-May-03 16:04 
Generalexe-server component's interface related Pin
satishsilla11-May-03 20:53
satishsilla11-May-03 20:53 
GeneralMSHTML & IStream Pin
luda10-May-03 13:13
luda10-May-03 13:13 

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.