Click here to Skip to main content
15,919,898 members
Home / Discussions / COM
   

COM

 
GeneralRe: Drag n drop within IE Pin
Per-Olov Jernberg8-Jul-02 4:40
Per-Olov Jernberg8-Jul-02 4:40 
GeneralRe: Drag n drop within IE Pin
Per-Olov Jernberg10-Jul-02 4:09
Per-Olov Jernberg10-Jul-02 4:09 
GeneralRe: Drag n drop within IE Pin
Paul Ingles20-Jul-02 13:50
Paul Ingles20-Jul-02 13:50 
GeneralAdd ActiveX Control To ActiveX Pin
7-Jul-02 3:11
suss7-Jul-02 3:11 
GeneralMultiple clients accessing a COM component Pin
Atin Kumar5-Jul-02 17:53
Atin Kumar5-Jul-02 17:53 
GeneralRe: Multiple clients accessing a COM component Pin
Vivek Rajan12-Jul-02 10:15
Vivek Rajan12-Jul-02 10:15 
GeneralRe: Multiple clients accessing a COM component Pin
Atin Kumar14-Jul-02 15:05
Atin Kumar14-Jul-02 15:05 
GeneralInheritence & Virtual functions with COM/ATL Pin
Ed K5-Jul-02 8:39
Ed K5-Jul-02 8:39 
Disclaimer: I am not an ATL guru....want to be but that is another disclaimer!

I have not been able to find any samples to follow that use inheritence and virtual functions in com using atl. I guess the first question should be can it be done? Here is what I am trying to accomplish...

I have a parent object (PObject) that has a virtual function (ExecuteService), and several pure virtual functions such as Display(). I want to extend that class with several subclasses that would implement the specific service. (We need an insert diagram here button on this forum!)

I want a factory which takes a string or int which gives me the correct subclass depending upon the parameter value.

This should work:

void RunService(CString name)
{
    IServiceFactoryPtr ptrFact(__uuidof(ServiceFactory));
    IPObjectPtr ptrObj = ptrFact->GetServiceByName(name.AllocSysString());
    ptrObj->ExecuteService();
}


I've been able to get the factory working, I actually end up with the correct object when I make the call to GetServiceByName, however when calling ExecuteService I get an exception.

So, how do I set up the classes using ATL to get this to work??? It's a basic factory pattern. Good basis for an article if someone could get me past this hump!


Thanks,

ed
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
mhamsa8-Jul-02 6:38
mhamsa8-Jul-02 6:38 
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
soptest8-Jul-02 7:37
soptest8-Jul-02 7:37 
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
Vivek Rajan11-Jul-02 11:10
Vivek Rajan11-Jul-02 11:10 
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
Ed K11-Jul-02 15:42
Ed K11-Jul-02 15:42 
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
Vivek Rajan12-Jul-02 6:44
Vivek Rajan12-Jul-02 6:44 
GeneralRe: Inheritence & Virtual functions with COM/ATL Pin
Ed K12-Jul-02 8:44
Ed K12-Jul-02 8:44 
QuestionHow to use one instance of a COM object in different processes? Pin
Jawid5-Jul-02 5:37
Jawid5-Jul-02 5:37 
AnswerRe: How to use one instance of a COM object in different processes? Pin
Scot T Brennecke6-Jul-02 4:53
Scot T Brennecke6-Jul-02 4:53 
GeneralRe: How to use one instance of a COM object in different processes? Pin
8-Jul-02 4:22
suss8-Jul-02 4:22 
AnswerRe: How to use one instance of a COM object in different processes? Pin
8-Jul-02 4:17
suss8-Jul-02 4:17 
AnswerRe: How to use one instance of a COM object in different processes? Pin
Pedro Miranda8-Jul-02 4:47
Pedro Miranda8-Jul-02 4:47 
AnswerRe: How to use one instance of a COM object in different processes? Pin
Jawid9-Jul-02 16:18
Jawid9-Jul-02 16:18 
GeneralRe: How to use one instance of a COM object in different processes? Pin
Ed K12-Jul-02 8:09
Ed K12-Jul-02 8:09 
QuestionCan somebody please answer this? Pin
JohnnyG3-Jul-02 14:26
JohnnyG3-Jul-02 14:26 
AnswerRe: Can somebody please answer this? Pin
soptest3-Jul-02 14:39
soptest3-Jul-02 14:39 
GeneralRe: Can somebody please answer this? Pin
JohnnyG3-Jul-02 14:59
JohnnyG3-Jul-02 14:59 
GeneralRe: Can somebody please answer this? Pin
JohnnyG3-Jul-02 15:36
JohnnyG3-Jul-02 15:36 

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.