|
thanks, i have already checked every where, which should marked as debug and i also send my project to another friend, who has also vs 2005, and he can debug it in his computer, so I think, it's a weird problem, which is not so easy to resolve, maybe something in windows core is damaged, because even after I reinstall the visual studio, the problem is not solved!
|
|
|
|
|
hello guys...well I have a sample from some web site. Upon building this sample, I get this follwing error.
fatal error C1189: #error: _WIN32_WINNT settings conflicts with _WIN32_IE setting
The code looks like this
#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
#endif
how to resolve this error...
thnx
modified on Thursday, September 30, 2010 10:16 AM
|
|
|
|
|
I feel your Windows version & Internet Explorer version are conflicting. May be your windows version is Windows 98 & IE version might be IE 7.
|
|
|
|
|
overloaded Name wrote: how to resolve this error...
Change the values of those preprocessor directives until either of the conditions evaluates to false.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
can i use a DoModal function without actually making the dialog in the resources.
Pritha
modified on Friday, October 1, 2010 12:47 PM
|
|
|
|
|
If you mean by creating your dialog template in memory, then you can do it after intialising with the CDialog::InitModalIndirect()[^] method.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Is the CDialog::InitModalIndirect different for different versions of Visual Studio
|
|
|
|
|
prithaa wrote: Is the CDialog::InitModalIndirect different for different versions of Visual Studio
Not that I am aware of; check the documentation page(s) that I posted in my previous answer.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
hello,
thankyou for replying.
there seems no difference in calling the InitModalIndirect() but when I changed the version of my project I getting debug just before when the dialog opens and the same dialog was fine in the Visul studio 6.0.
Pritha
|
|
|
|
|
prithaa wrote: when I changed the version of my project I getting debug just before when the dialog opens and the same dialog was fine in the Visul studio 6.0.
Sorry, but I am not sure what you mean by this, or what it has to do with your original question. Do you have a problem that you cannot resolve, and if so what is the code that is failing?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
thanks for replies
I made a class derived from CDialog with memery allocations for DLGTEMPLATE structure.Basically doing what was required to do for making a dialog without resources and was working fine with Visual Studio 6.But the sames classes, objects r not working with Visual Studio 2005 though I m not getting any compile time error.
So I read through the documetation of any differnece for making the dialogs but it was not helpful.
Any suggestions
|
|
|
|
|
prithaa wrote: But the sames classes, objects r not working with Visual Studio 2005
What does "not working" mean, it explains nothing; try and be more specific about the results you expect and what you see. Are you sure that all your dialog items are correctly aligned to WORD or DWORD boundaries, as required?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
thanks I will check with that.
But not working means I am getting Debug Assertion failure for DoModal() function.
Can u please clear
Are you sure that all your dialog items are correctly aligned to WORD or DWORD boundaries, as required?
Pritha
|
|
|
|
|
prithaa wrote: I am getting Debug Assertion failure for DoModal() function.
Well that should give you a clue; look at the details of the assertion and try to figure out why it is getting thrown, and which parameter in your dialog may be causing the problem.
prithaa wrote: Can u please clear ...
I mean, check the positioning of all your dialog items in memory to ensure that they are correctly aligned, before you call DoModal() ; for further information see here[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
So does this solve the problem?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
No but then I got a few guidelines towards the solutions.
can i paste my code hear .It is about memory allocation and then calling InitModalIndirect
Pritha
|
|
|
|
|
prithaa wrote: can i paste my code hear
Sure, if you think it will be useful for others.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
int MFC::Dialog::DoModal()
{
int cWC = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, NULL, 0);
int szBoxLen = cWC + 1;
WCHAR *szBoxCaption = new WCHAR[szBoxLen];
// Copy the string...
MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, (LPWSTR) szBoxCaption, cWC);
szBoxCaption[cWC] = 0;
szBoxLen = (cWC) * sizeof(WCHAR);
int nBufferSize = sizeof(DLGTEMPLATE) + (2 * sizeof(WORD)) /*menu and class + szBoxLen /*size of caption*/
+ sizeof(WORD) /*fontsize*/ ;//+ nFontNameLen /*size of fontname*/;
HLOCAL hLocal = LocalAlloc(LHND, nBufferSize);
if (hLocal != NULL) {
BYTE* pBuffer = (BYTE*)LocalLock(hLocal);
if (pBuffer == NULL) {
LocalFree(hLocal);
AfxMessageBox(_T("D::DoModal() : LocalLock Failed"));
}
BYTE *pdest = pBuffer;
// transfer DLGTEMPLATE structure to the buffer
memcpy(pdest, &m_DialogTemplate, sizeof(DLGTEMPLATE)); // DLGTemplate
pdest += sizeof(DLGTEMPLATE);
*(WORD*)pdest = 0;// no menu -- WORD to say it is 0 bytes
pdest += sizeof(WORD); // Increment
*(WORD*)(pdest + 1) = 0; // use default window class -- WORD to say it is 0 bytes
pdest += sizeof(WORD); // Increment
memcpy(pdest, szBoxCaption, szBoxLen); // Caption
pdest += szBoxLen;
//These are the MFC functions, which do the job...
InitModalIndirect((LPDLGTEMPLATE)pBuffer, m_pParentWnd);
int iRet =0;
iRet = CDialog::DoModal();
LocalUnlock(hLocal);
LocalFree(hLocal);
return 0;
}
else {
AfxMessageBox(_T("D::DoModal() : LocalAllock Failed"));
return -1;
}
}
|
|
|
|
|
Please could you put <pre></pre> tags around your code so that it is readable (just edit your message and use the code block button). Also use the Preview button before you post to make sure it is all formatted correctly. Your code looks like:
int MFC::Dialog::DoModal()
{
int cWC = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, NULL, 0);
int szBoxLen = cWC + 1;
WCHAR *szBoxCaption = new WCHAR[szBoxLen];
// ...
it should look like:
int MFC::Dialog::DoModal()
{
int cWC = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, NULL, 0);
int szBoxLen = cWC + 1;
WCHAR *szBoxCaption = new WCHAR[szBoxLen];
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
DLGTEMPLATE m_DialogTemplate;
int MFC::Dialog::DoModal()
{
//For OK and Cancel buttons??
m_DialogTemplate.cy+=(DlgControls.size()*4);
AddOkCancel();
int iRet=0;
//presetting for caption in the dialog....
int cWC = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, NULL,0);
int szBoxLen = cWC + 1;
WCHAR *szBoxCaption = new WCHAR[szBoxLen];
// Copy the string...
MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, (LPWSTR)szBoxCaption, cWC);
szBoxCaption[cWC] = 0;
szBoxLen = (cWC) * sizeof(WCHAR);
int nBufferSize = sizeof(DLGTEMPLATE) + (2 * sizeof(WORD)) /*menu and class*/ + szBoxLen /*size of caption*/
+ sizeof(WORD) /*fontsize*/ ;//+ nFontNameLen /*size of fontname*/;
HLOCAL hLocal = LocalAlloc(LHND, nBufferSize);
if (hLocal != NULL) {
BYTE* pBuffer = (BYTE*)LocalLock(hLocal);
if (pBuffer == NULL) {
LocalFree(hLocal);
AfxMessageBox(_T("D::DoModal() : LocalLock Failed"));
}
BYTE *pdest = pBuffer;
// transfer DLGTEMPLATE structure to the buffer
memcpy(pdest, &m_DialogTemplate, sizeof(DLGTEMPLATE)); // DLGTemplate
pdest += sizeof(DLGTEMPLATE);
*(WORD*)pdest = 0; // no menu -- WORD to say it is 0 bytes
pdest += sizeof(WORD); // Increment
*(WORD*)(pdest + 1) = 0; // use default window class -- WORD to say it is 0 bytes
pdest += sizeof(WORD); // Increment
memcpy(pdest, szBoxCaption, szBoxLen);
// Caption
pdest += szBoxLen;
//These are the MFC functions, which do the job...
InitModalIndirect((LPDLGTEMPLATE)pBuffer, m_pParentWnd);
iRet = CDialog::DoModal();
LocalUnlock(hLocal);
LocalFree(hLocal);
return iRet;
}
else {
AfxMessageBox(_T("D::DoModal() : LocalAllock Failed"));
return -1;
}
}
|
|
|
|
|
Well I guess you missed most of my message where I said:
1. Edit your message, i.e. the one where you posted the code.
2. Use <pre></pre> tags around your code.
3. Use the Preview button to check that what you have posted is correct.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
sorry i m posting code for the first time
int MFC::Dialog::DoModal()
{
m_DialogTemplate.cy+=(DlgControls.size()*4);
AddOkCancel();
int iRet=0;
int cWC = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, NULL, 0);
int szBoxLen = cWC + 1;
WCHAR *szBoxCaption = new WCHAR[szBoxLen];
MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, (LPWSTR) szBoxCaption, cWC);
szBoxCaption[cWC] = 0;
szBoxLen = (cWC) * sizeof(WCHAR);
int nBufferSize = sizeof(DLGTEMPLATE) + (2 * sizeof(WORD)) + szBoxLen
+ sizeof(WORD) ;
HLOCAL hLocal = LocalAlloc(LHND, nBufferSize);
if (hLocal != NULL) {
BYTE* pBuffer = (BYTE*)LocalLock(hLocal);
if (pBuffer == NULL) {
LocalFree(hLocal);
AfxMessageBox(_T("D::DoModal() : LocalLock Failed"));
}
BYTE *pdest = pBuffer;
memcpy(pdest, &m_DialogTemplate, sizeof(DLGTEMPLATE));
pdest += sizeof(DLGTEMPLATE);
*(WORD*)pdest = 0;
pdest += sizeof(WORD);
*(WORD*)(pdest + 1) = 0;
pdest += sizeof(WORD);
memcpy(pdest, szBoxCaption, szBoxLen);
pdest += szBoxLen;
InitModalIndirect((LPDLGTEMPLATE)pBuffer, m_pParentWnd);
iRet = CDialog::DoModal();
LocalUnlock(hLocal);
LocalFree(hLocal);
return iRet;
}
else {
AfxMessageBox(_T("D::DoModal() : LocalAllock Failed"));
return -1;
}
}
|
|
|
|
|
|
I am programming a model for Process state simulation
In my model the program logic is similar to logic gates. The state of different boolean variables changes from 1 to 0 or vice versa.
Eg: The value of A, B, C and other variables changes from 0 to 1 and viceversa depending on some calculation and behaviour of the model.
There are some dependant variables X, Y, Z and other variables whose state changes accordingly the same depending on A, B and C. The dependant variables should not change immediately but with a delay that is set by the user.
My requirement is I need a function where if I call the function by passing the variable name, dependant variable name and the time delay so that the dependant variable changes according to the variable only after the set time delay. The function call should not disturb or create time delay in the model. It should only create a delay after which the dependant variable is assigned with the value.
Kindly help.
Thanks,
Mohan
|
|
|
|
|