Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Convert project VC++6.0 to VC++.Net [modified] Pin
S Douglas2-Jan-07 23:32
professionalS Douglas2-Jan-07 23:32 
QuestionHow to Invoke Resource-Only DLL Dialogs Pin
Pradeep.Reddy2-Jan-07 1:29
Pradeep.Reddy2-Jan-07 1:29 
QuestionRe: How to Invoke Resource-Only DLL Dialogs Pin
prasad_som2-Jan-07 1:35
prasad_som2-Jan-07 1:35 
AnswerRe: How to Invoke Resource-Only DLL Dialogs Pin
Pradeep.Reddy3-Jan-07 7:17
Pradeep.Reddy3-Jan-07 7:17 
AnswerRe: How to Invoke Resource-Only DLL Dialogs Pin
prasad_som3-Jan-07 19:03
prasad_som3-Jan-07 19:03 
AnswerRe: How to Invoke Resource-Only DLL Dialogs Pin
Johan Pretorius2-Jan-07 2:42
Johan Pretorius2-Jan-07 2:42 
GeneralRe: How to Invoke Resource-Only DLL Dialogs Pin
Pradeep.Reddy3-Jan-07 7:13
Pradeep.Reddy3-Jan-07 7:13 
AnswerRe: How to Invoke Resource-Only DLL Dialogs Pin
Cristian Amarie2-Jan-07 6:50
Cristian Amarie2-Jan-07 6:50 
If is a MFC dll, make the project MFC extension dll, load the dll normally with LoadLibrary or AfxLoadLibrary, and use it directly.
For example, you may have a dialog implemented in DlgCustom.cpp/.h in DlgCustom.dll but resource is actually in DlgCustomRC.dll.
A possible implementation can be
// DlgCustom.h
#include "../DlgCustomRC/resource.h"

class CDlgCustom
{
  // ...
  enum IDD = { IDD_CUSTOM }; // defined in the resource project
  // ...
protected:
  HMODULE m_hRC;
};

// DlgCustom.cpp
CDlgCustom::CDlgCustom()
{
  m_hRC = LoadLibrary(_T("DlgCustomRC.dll"));
}

CDlgCustom::~CDlgCustom()
{
  FreeLibrary(m_hRC);
}

and instantiation can simply be
void CParentWindow::onCallCustom()
{
  CDlgCustom dlg(this);
  dlg.DoModal();
}


The DlgCustom.dll will export the class CDlgCustom, that will manage itself the loading of resource-only dll DlgCustomRC.dll.

VERY important is to have resources in all those binaries that do not overlap.
So NO two dialogs with the same ID in the same executable space. I had to write tools that detects and reports such "resource clash" conditions.

If you want to do the job manually, load the library with "load library as data file" since is a resource dll, locate the resource with RT_DIALOG and corresponding IDD, create the DLGTEMPLATE and then use a CreateDialogXXX call. MFC does this - consult the implementation of CreateDialog (I think is in ../mfc/src/dlgcore.cpp).
GeneralRe: How to Invoke Resource-Only DLL Dialogs Pin
Pradeep.Reddy3-Jan-07 7:11
Pradeep.Reddy3-Jan-07 7:11 
GeneralRe: How to Invoke Resource-Only DLL Dialogs Pin
Cristian Amarie3-Jan-07 8:00
Cristian Amarie3-Jan-07 8:00 
QuestionThe Active X control cannot be instantiated Pin
nripun2-Jan-07 1:20
nripun2-Jan-07 1:20 
GeneralRe: The Active X control cannot be instantiated Pin
prasad_som2-Jan-07 1:32
prasad_som2-Jan-07 1:32 
GeneralRe: The Active X control cannot be instantiated Pin
nripun2-Jan-07 1:45
nripun2-Jan-07 1:45 
GeneralRe: The Active X control cannot be instantiated Pin
prasad_som2-Jan-07 1:54
prasad_som2-Jan-07 1:54 
QuestionDll exception Pin
manu_22052-Jan-07 0:56
manu_22052-Jan-07 0:56 
AnswerRe: Dll exception Pin
CPallini2-Jan-07 2:25
mveCPallini2-Jan-07 2:25 
QuestionRe: Dll exception Pin
Hamid_RT2-Jan-07 17:48
Hamid_RT2-Jan-07 17:48 
QuestionInternet and C++ Pin
Malini Nair2-Jan-07 0:53
Malini Nair2-Jan-07 0:53 
AnswerRe: Internet and C++ Pin
David Crow2-Jan-07 3:09
David Crow2-Jan-07 3:09 
AnswerRe: Internet and C++ Pin
ThatsAlok2-Jan-07 18:51
ThatsAlok2-Jan-07 18:51 
Questionopening a contact in Outlook DLL, locks up outlook Pin
gdolling2-Jan-07 0:35
gdolling2-Jan-07 0:35 
QuestionMoving The Mouse/Cursor Then Button Click ? Pin
Fritzables2-Jan-07 0:31
Fritzables2-Jan-07 0:31 
QuestionRe: Moving The Mouse/Cursor Then Button Click ? Pin
David Crow2-Jan-07 3:15
David Crow2-Jan-07 3:15 
AnswerRe: Moving The Mouse/Cursor Then Button Click ? Pin
Fritzables2-Jan-07 10:36
Fritzables2-Jan-07 10:36 
AnswerRe: Moving The Mouse/Cursor Then Button Click ? Pin
Walter_H2-Jan-07 4:11
Walter_H2-Jan-07 4:11 

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.