Solved

Connecting two projects

Posted on 2000-05-15
9
147 Views
Last Modified: 2013-11-20
Hi,
  Is it possible to connect two different projects. Say, a dialog application on clicking the ok button,should open another project,which is an MDI Application.

Thanx,
Thiru
0
Comment
Question by:thirumaran
  • 4
  • 4
9 Comments
 
LVL 3

Expert Comment

by:MDarling
ID: 2810171
connect? do you mean communicate between the 2 processes just have the dialog spawn the other exe.

if the latter thejust use CreateProcess.

regards,
Mike.
0
 
LVL 3

Expert Comment

by:shaig
ID: 2810230
If you mean "projects" then:
Create a workspace that contains the two projects.
0
 

Author Comment

by:thirumaran
ID: 2810366
Hi,
     I have to call another exe,as soon as i click the ok button in the dialog box after checking all the necessary validations.This is what i want.Just help me out in this problem.
Thanx,
Thiru
0
 
LVL 3

Expert Comment

by:MDarling
ID: 2811078
use CreateProcess in OnOK


    STARTUPINFO SI;
    PROCESS_INFORMATION PI;
    ZeroMemory(&SI,sizeof(STARTUPINFO));
    SI.cb=sizeof(STARTUPINFO);
    if(CreateProcess(0,strExeToSpawn.GetBuffer(0),0,0,0,0,0,0,&SI,&PI)==0)
    {
        MessageBox(0,"Failed to Start Program...","Error",MB_OK);

regards,
Mike.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:thirumaran
ID: 2813044
Hi Mike,
  Will it be possible for you to explain the code a bit. I am not able to get the usage of strExetoSpawn in createprocess function.
I have to call another project from this dialog based application.The called project is an MDI application.Is this possible.Please give me an example.

Thanx,
Thiru
0
 
LVL 3

Accepted Solution

by:
MDarling earned 20 total points
ID: 2813515
yeah sure, strExeToSpawn is just a CString containing the name of your program.

the code could just as easily be...

STARTUPINFO SI;
    PROCESS_INFORMATION PI;
    ZeroMemory(&SI,sizeof(STARTUPINFO));
    SI.cb=sizeof(STARTUPINFO);
    if(CreateProcess(0,"MyApp.exe",0,0,0,0,0,0,&SI,&PI)==0)
    {
        MessageBox(0,"Failed to Start Program...","Error",MB_OK);

ok?

Have you got the help files for Windows.  It's all explained in there.

regards,
Mike.



0
 

Author Comment

by:thirumaran
ID: 2815914
HI Mike,
    The program is showing assertion error.If you please give me your mailid i will be able to mail u both the projects,so that you can tell me where i made the mistake.

Thanx,
Thiru
0
 

Author Comment

by:thirumaran
ID: 2815924
Hi Mike,
   Sorry for the previous comment. I made it without fully checking my code.
Now i ahd made it work.
Thanx for your timely help,
Thanx again,
Thiru
0
 
LVL 3

Expert Comment

by:MDarling
ID: 2816288
no problem, glad you got it working.

regards,
Mike.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 29
Host to IP 7 77
notReplace  challenge 53 116
sum13 challenge 24 90
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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now