Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPasting RTF into word automated... Pin
Braulio Dez26-Sep-01 3:26
Braulio Dez26-Sep-01 3:26 
GeneralShellExecute Pin
Steve Thresher26-Sep-01 2:47
Steve Thresher26-Sep-01 2:47 
GeneralRe: ShellExecute Pin
Tomasz Sowinski26-Sep-01 3:03
Tomasz Sowinski26-Sep-01 3:03 
GeneralRe: ShellExecute Pin
Oscar Vazquez26-Sep-01 3:30
Oscar Vazquez26-Sep-01 3:30 
GeneralMultibyte character Pin
26-Sep-01 2:11
suss26-Sep-01 2:11 
GeneralRe: Multibyte character Pin
Anders Molin26-Sep-01 2:42
professionalAnders Molin26-Sep-01 2:42 
Generaldialog in dll Pin
Bjorn26-Sep-01 0:43
Bjorn26-Sep-01 0:43 
GeneralRe: dialog in dll Pin
Oscar Vazquez26-Sep-01 3:46
Oscar Vazquez26-Sep-01 3:46 
Your dll must be an MFC Extension DLL, not a normal one.
Create a new project with AppWizard and indicate MFC AppWizard(dll), then MFC Extension DLL.

your DllMain must look like this


static AFX_EXTENSION_MODULE EcamecExtDLL = { NULL, NULL };

extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);

if (dwReason == DLL_PROCESS_ATTACH)
{
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(EcamecExtDLL, hInstance))
return 0;

// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.

new CDynLinkLibrary(EcamecExtDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// Terminate the library before destructors are called
AfxTermExtensionModule(EcamecExtDLL);
}
return 1; // ok
}
#endif

// MyDlgInclude.h
#ifdef _WINDLL
#include "resource.h"
#define DLL_FUNCTION __declspec(dllexport)
#else
#define DLL_FUNCTION __declspec(dllimport)
#endif

Then declare your Dialog class using one of this diferent approach

1- Export only the class metod you will use in your app
class CMyDlg : public CDialog
{
public:
MY_AFX_EXT_CLASS CMyDlg();
MY_AFX_EXT_CLASS int DoModal();

// Dialog Data
//{{AFX_DATA(CMyDlg)
enum { IDD = 100 };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CMyDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

2 - Export the whole class

class MY_AFX_EXT_CLASS CMyDlg : public CDialog
{
public:
CMyDlg();
int DoModal();

...... // same code
};

// MyApp.cpp
#include "MyDlgInclude.h"

CMyDlg nDlg;
nDlg.DoModal();

GeneralRe: dialog in dll Pin
#realJSOP26-Sep-01 4:29
professional#realJSOP26-Sep-01 4:29 
GeneralProblem reading string from registry Pin
26-Sep-01 0:23
suss26-Sep-01 0:23 
GeneralRe: Problem reading string from registry Pin
Michael P Butler26-Sep-01 0:33
Michael P Butler26-Sep-01 0:33 
GeneralRe: Problem reading string from registry Pin
Anders Molin26-Sep-01 0:34
professionalAnders Molin26-Sep-01 0:34 
GeneralRe: Problem reading string from registry Pin
Gavin Jerman26-Sep-01 2:06
Gavin Jerman26-Sep-01 2:06 
GeneralRe: Problem reading string from registry Pin
26-Sep-01 4:12
suss26-Sep-01 4:12 
GeneralRe: Problem reading string from registry Pin
Michael Dunn26-Sep-01 8:45
sitebuilderMichael Dunn26-Sep-01 8:45 
QuestionI was wondering - why isn't WM_LBUTTONUP received? Pin
26-Sep-01 0:23
suss26-Sep-01 0:23 
AnswerRe: I was wondering - why isn't WM_LBUTTONUP received? Pin
Tomasz Sowinski26-Sep-01 1:01
Tomasz Sowinski26-Sep-01 1:01 
GeneralRe: I was wondering - why isn't WM_LBUTTONUP received? Pin
26-Sep-01 13:47
suss26-Sep-01 13:47 
Generalslow OpenGL in MFC Pin
25-Sep-01 23:43
suss25-Sep-01 23:43 
GeneralRe: slow OpenGL in MFC Pin
26-Sep-01 7:01
suss26-Sep-01 7:01 
GeneralRe: slow OpenGL in MFC Pin
JoNy26-Sep-01 22:33
JoNy26-Sep-01 22:33 
GeneralTree Control again... Pin
25-Sep-01 23:23
suss25-Sep-01 23:23 
GeneralRe: Tree Control again... Pin
Tomasz Sowinski26-Sep-01 1:12
Tomasz Sowinski26-Sep-01 1:12 
GeneralRe: Tree Control again... Pin
26-Sep-01 3:45
suss26-Sep-01 3:45 
GeneralTimer (without message map) Pin
Le Ridder Noir25-Sep-01 23:18
Le Ridder Noir25-Sep-01 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.