Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Projects in 1 Workspace

Status
Not open for further replies.

NiFi

Programmer
Nov 21, 2000
2
FR
Hello!

I created a project (using VC++ 5.0), named "TestWindow" - SDI (Simple document interface).
And I added one more project ("TestDialog" - CDialog class) to the same workspace.

So I got paths like this: Projects\TestWindow and Projects\TestWindow\TestDialog

I would like to call dialog window of TestDialog project from the menu of Window of TestWindow project. So I have:

MainFrm.cpp
...

#include "TestDialog\TestDialog.h"
#include "TestDialog\TestDialogDlg.h"

...

void CMainFrame::OnDialogStartdialog() // Menu selection handler
{
CTestDialogDlg testDlg;
testDlg.DoModal();
}

And I have this link error:

error LNK2001: unresolved external symbol "public: __thiscall CTestDialogDlg::CTestDialogDlg(class CWnd *)" (??0CTestDialogDlg@@QAE@PAVCWnd@@@Z)
Debug/TestWindow.exe : fatal error LNK1120: 1 unresolved externals

Plz help! =)
 
NiFi,

It sounds like you're going to too much work; you don't need to create a separate project to add a dialog box to your program. And you probably don't want to. If I understand this correctly, you have two EXEs -- TestWindow.exe and TestDialog.exe -- and thus you really have two programs, not a dialog that is part of your main SDI app.

I would recommend deleting the second project ( after a backup, of course ) and then adding "TestDialogDlg.h" and "TestDialogDlg.cpp" to the TestWindow project. This can be done via the "Add To Project" option under the VC++ Project menu. You'll also have to copy the dialog resource ( IDD_TESTDIALOG, or whatever it is ) into the TestWindow workspace, but this can be done via a copy-and-paste operation. If you then change the include statement in MainFrm.cpp to

#include "TestDialogDlg.h"

I think you'll be able to compile and link.

An example that might help is to look at the code surrounding IDD_ABOUTBOX, the About dialog that App Wizard generates by default.

Anyway, I hope this helps.

Keith Brautigam
 
Keith Brautigam,

Thanx for the answere, but the problem is that I have not only one dialog window in my "TestDialog" project, but ALOT of them... so it would be really a HARD work to add all cpp and header files to "TestWindow" project.

So actually I want to make a call of my MAIN dialog window from the menu of window of "TestWindow" project (so I will have all bunch of dialogs followed by my main dialog)... and I have a link error....


NiFi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top