?
Solved

COM

Posted on 2003-02-19
4
Medium Priority
?
255 Views
Last Modified: 2013-11-25
hi,
I have 2 application say a and b. When i start the application a, that moment i want to invoke the application b via COM. Is any body can help me this?
please send me your suggestions with example.

Thanks in advance
abhi
0
Comment
Question by:Abhilashars
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
rsanwatsarkar earned 200 total points
ID: 7981078
Its very simple, create instance of b in constructor of main class(coclass) of a.
An example, in ATL project
CMyClient::CMyClient()
{
     CComPtr<IMyServer> pIMyServer;
     pIMyServer.CoCreateInstance(CLSID_MyServer);
}
To understand above code, you need to learn at least basics of COM (and bit of ATL for above code).

Go to the following link to find loads of ways, info/tutorial of achieving it.
http://www.codeproject.com/com/

Also take a look at
http://www.codeguru.com/activex/COMStepByStep.html
http://www.codeguru.com/activex/ComTutorial.shtml

This should be enough to give you a good headstart
 
Good luck,
rsan
0
 
LVL 22

Assisted Solution

by:ambience
ambience earned 200 total points
ID: 7986515
what you are trying to do is termed as automation. Your application b has to be an EXE COM automable server.

Are you going to write both applications or that you already have b (for e.g. b can be MSWORD) ?

www.cetus-links.org

has tons of links related to COM and automation etc.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question