|
-
January 20th, 2013, 03:49 PM
#18
Re: How to call Dialog window (formed as resource) from a .DLL
Dear Paul,
I've followed your advise and tried to debug with WS. Here below is situation after "Break All". What useful information can I extract from this ? As I've already mentionned, this GUI interface is important, but not principal part of the project. I have merely no time to become guru in MFC development, study in depth dbug techniques, etc. I would like to terminate this phase as soon as possible - other part, essential one is waiting for me. Thank you for your comprehension.
Pixie3_GUI_Debug.jpg
So I dare to reformulate the problem hoping that there is more simple solution.
Here is the project that is work properly - at least as I want.
Application Class declaration
Code:
// vpi_MFC_regular.h : main header file for the vpi_MFC_regular DLL
//
#pragma once
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#include "resource.h" // main symbols
// Cvpi_MFC_regularApp
// See vpi_MFC_regular.cpp for the implementation of this class
//
class Cvpi_MFC_regularApp : public CWinApp
{
public:
Cvpi_MFC_regularApp();
// Overrides
public:
virtual BOOL InitInstance();
DECLARE_MESSAGE_MAP()
};
Application class implementation:
Code:
#include "stdafx.h"
#include "vpi_MFC_regular.h"
#include "vpi_user.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// Cvpi_MFC_regularApp
BEGIN_MESSAGE_MAP(Cvpi_MFC_regularApp, CWinApp)
END_MESSAGE_MAP()
// Cvpi_MFC_regularApp construction
Cvpi_MFC_regularApp::Cvpi_MFC_regularApp()
{
vpi_printf("Inside of Application Constructor\n");
}
// The one and only Cvpi_MFC_regularApp object
Cvpi_MFC_regularApp theApp;
class CMyWindow : public CFrameWnd
{
CStatic* cs;
public:
CMyWindow();
};
CMyWindow::CMyWindow()
{
Create(NULL, L"MyWindow", WS_VISIBLE, CRect(0,0,200,200));
cs = new CStatic();
cs->Create(L"AAAAAAAAAAAAAA", WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(50, 80, 150, 150), this);
vpi_printf("Inside of Window Constructor\n");
}
// Cvpi_MFC_regularApp initialization
BOOL Cvpi_MFC_regularApp::InitInstance()
{
vpi_printf("Inside of Application InitInstance\n");
CWinApp::InitInstance();
m_pMainWnd = new CMyWindow();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
The problem with this realization - it doesn't use resources, so all controls and theirs handler on windows must be created manually. As interface can be quite comlicated it could take considerable time. So, the question:
What should I change in this working application in order to add resource building facility ?
Sure there will be additional class. But what about application class - what changes should I do there ??
Here is the result of previous working approach:
working_application.JPG
Regards,
Pavel.
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
|