Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am having an MFC application of SDI document with multiple views developing in Visual Studio 2010. I have shown functionality of each view in individual tab. Even the ribbon bar will show buttons related to both views.
Currently I am having one project showing each view in different tabs/windows.

Now I want to add some different functionality in that application, to be shown in new tab means one more view. It will have forms/dialogs to show controls in that tab. I prefer to separate the functionality and code files from the main project, so created a new project and created a form/dialog. So now I have two projects in same solution. This form/dialog will have its unique ID. This new project will also have .rc file and resoure.h. So when I use the source file of form/dialog created in new project, in main project, it is not able to identify the ID.

It is possible to maintain different projects in such situation, and access forms/dialogs of other project in main project in same application solution? How can I achieve this? Or is there any other way to maintain integrity of different functionalities in same solution?


Thanks in advance.
Posted
Updated 11-Sep-15 0:51am
v7
Comments
Sergey Alexandrovich Kryukov 11-Sep-15 3:13am    
Not clear how you view that. Why? What is "same application code"?
—SA
Sweta Mittal 11-Sep-15 3:28am    
I mean in one document has multiple views and each view is associated with each tab. With "same application code" I mean to say that multiple projects in same solution. Thanks

Sergey Alexandrovich Kryukov 11-Sep-15 3:32am    
You express yourself in extremely unclear way, sorry; the term "same application code" is a bright illustration. I wish you could explain the rest as clearly as the part "multiple projects in the same solution".
—SA
Richard MacCutchan 11-Sep-15 4:27am    
You could create each of your viewing projects as a library (static or DLL), with their own resource file. You then use the main project to call their functions as you need them. The real issue is whether the work to create these projects would make it easier to maintain.
Sweta Mittal 11-Sep-15 8:52am    
I tried by creating static library, normal functions are called. But how to access form/dialog to be shown in tab. Its resource id is not identified in main project.

1 solution

Yes. The concept of solutions in Visual Studio is to include multiple projects and build targets. If you right click in the project explorer at the solution you should find a menu to add a project.

To organize it, it is best to create subfolders on disc to store the different project files separate. Use macros to separate some additional code or resources. It can get tricky, so make regularly a backup.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900