Click here to Skip to main content
15,888,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: synchronous Communication between 2 applications in separate machines in LAN Pin
Richard MacCutchan20-Sep-13 3:19
mveRichard MacCutchan20-Sep-13 3:19 
QuestionCan we place MFC Controls in RunningObjectTable? Pin
Rajendarmanda19-Sep-13 22:41
Rajendarmanda19-Sep-13 22:41 
SuggestionRe: Can we place MFC Controls in RunningObjectTable? Pin
Richard MacCutchan19-Sep-13 23:17
mveRichard MacCutchan19-Sep-13 23:17 
GeneralRe: Can we place MFC Controls in RunningObjectTable? Pin
Rajendarmanda20-Sep-13 1:42
Rajendarmanda20-Sep-13 1:42 
GeneralRe: Can we place MFC Controls in RunningObjectTable? Pin
Richard MacCutchan20-Sep-13 1:50
mveRichard MacCutchan20-Sep-13 1:50 
GeneralRe: Can we place MFC Controls in RunningObjectTable? Pin
Rajendarmanda20-Sep-13 2:01
Rajendarmanda20-Sep-13 2:01 
GeneralRe: Can we place MFC Controls in RunningObjectTable? Pin
Richard MacCutchan20-Sep-13 2:18
mveRichard MacCutchan20-Sep-13 2:18 
QuestionWhat is "dialog template resource"? Pin
Vaclav_19-Sep-13 4:55
Vaclav_19-Sep-13 4:55 
I am trying to run a modal dialog in a property page.
The dialog is located in static library.

Here is the implemetation of DoModal

int C_MAINPropertyPage4::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CPropertyPage::OnCreate(lpCreateStruct) == -1)
return -1;

pCWaveInFFTDlg.DoModal();

return 0;
}

And here is where CDialog fails, in FindResource:

// load resource as necessary
LPCDLGTEMPLATE lpDialogTemplate = m_lpDialogTemplate;
HGLOBAL hDialogTemplate = m_hDialogTemplate;
HINSTANCE hInst = AfxGetResourceHandle();
if (m_lpszTemplateName != NULL)
{
hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);

hInst looks OK

HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);

hResource is NULL, so it fails from here on.

hDialogTemplate = LoadResource(hInst, hResource);
}
if (hDialogTemplate != NULL)
lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);

// return -1 in case of failure to load the dialog template resource
if (lpDialogTemplate == NULL)
return -1;


When I run this dialog in its own project the hInst returns same value as when I run it in my application. The m_lpszTemplateName is also same , empty, when run in its own project or in my application.
I did run the DoModal in property page OnInitDialog with same result.

I did copy the source from the original to my static library and I am at lost what “resource template” is missing.
Any help would be appreciated. Of course I am still using VC 6.0 and MFC.

Cheers
Vaclav
AnswerRe: What is "dialog template resource"? Pin
pasztorpisti19-Sep-13 6:32
pasztorpisti19-Sep-13 6:32 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_20-Sep-13 4:06
Vaclav_20-Sep-13 4:06 
GeneralRe: What is "dialog template resource"? SOLVED Pin
pasztorpisti20-Sep-13 4:31
pasztorpisti20-Sep-13 4:31 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_20-Sep-13 5:46
Vaclav_20-Sep-13 5:46 
Questionhow to registered activex contols Pin
joshikkishore18-Sep-13 7:48
joshikkishore18-Sep-13 7:48 
AnswerRe: how to registered activex contols Pin
Richard Andrew x6418-Sep-13 10:21
professionalRichard Andrew x6418-Sep-13 10:21 
AnswerRe: how to registered activex contols Pin
«_Superman_»18-Sep-13 18:35
professional«_Superman_»18-Sep-13 18:35 
QuestionHow to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 3:49
Vaclav_18-Sep-13 3:49 
AnswerRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 4:22
pasztorpisti18-Sep-13 4:22 
GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 7:43
Vaclav_18-Sep-13 7:43 
GeneralRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 10:58
pasztorpisti18-Sep-13 10:58 
GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 12:01
Vaclav_18-Sep-13 12:01 
Questionbytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 18:55
Le@rner17-Sep-13 18:55 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 21:06
mveRichard MacCutchan17-Sep-13 21:06 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 21:27
Le@rner17-Sep-13 21:27 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 21:35
mveRichard MacCutchan17-Sep-13 21:35 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 21:38
Le@rner17-Sep-13 21:38 

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.