|
-
February 14th, 2011, 07:05 AM
#1
Multiple instance - MDI problem
I have an application which invokes my dll app using loadlibrary.
In my dll application i create few documents using this
pDocTemplate = new CMultiDocTemplate(
IDR_MDTYPE,
RUNTIME_CLASS(CTestMDIDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTestMDIView));
AddDocTemplate(m_pSettingsTemplate);
and point m_pMainWnd with the newly created mainframe window everytime when new instance is required.
m_pMainWnd = pMainFrame;
Problem is when user invokes the same application twice and tries to show views in first instances it loads the view in the last instance created. It works absolutly fine with single instance.
The document count keeps on increasing with the number of instances.
I maintain pDocTemplate and open views using OpenDocumentFile.
pDocTemplate->OpenDocumentFile(NULL);
I guess it is to do with the lastly created and maintained mainframe?
m_pMainWnd = pMainFrame;
What would be the problem? and how to solve it?
My requirement is first instances should show first instances views in its own mainframe window and second instances should show views in its own mainframe window.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|