|
|
i have 7dialogs and i have inlinks between them,the problem occured when i tried to add coding to backtraverse between the dialogs and in the first dialog has only this code,
newdlg onclick;
onclick.Domodal
and the error is in dlgdata.cpp,here
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1);
HWND hWndCtrl;
COleControlSite* pSite = NULL;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
pSite = m_pDlgWnd->GetOleControlSite(nIDC);
if (pSite == NULL)
{
TRACE(traceAppMsg, 0, _T("Error: no data exchange control with ID 0x%04X.\n"), nIDC);
ASSERT(FALSE);------------------------------------------>ERROR
AfxThrowNotSupportedException();
}
}
m_idLastControl = nIDC;
m_bEditLastControl = FALSE;
return hWndCtrl;
}
Raja
|
|
|
|
|
I think you must change your code to this:
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl != NULL)
and you must be check hWndCtrl before return hWndCtrl;
if (hWndCtrl )
return hWndCtrl;
else
return NULL;
|
|
|
|
|
where should i do this coding change,wil you please say me from where(websites) i should learn basics to create an application for MFC
Raja
|
|
|
|
|
You must be change this line if (hWndCtrl == NULL) to if (hWndCtrl != NULL) and instead return hWndCtrl; insert this code if (hWndCtrl) return hWndCtrl; else return NULL.
|
|
|
|
|
how to create handle controls??
Raja
|
|
|
|
|
You can use of GetDlgItem or you can declare a variable for it,is this your question?
|
|
|
|
|
First of all, when asking a question about why an ASSERT fails post some code around the ASSERT : 9 times out of 10 this is all that is needed to answer the question. I see you've given the file's name the line number, but what version of MFC are you using?
In my version of MFC line 43 contains an ASSERT(FALSE); and line 42 looks as follows:
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
You should see this message in the debugger. This should answer your question or at least put you on the right track. Don’t be afraid to look at the source!
Steve
|
|
|
|
|
yes,i do have error at the same line saying no dataexchange,what should be done??
Raja
|
|
|
|
|
The error message is saying, quite clearly, that a control with the id in question does not exist. Go through the data exchange map and the dialog template and find the mismatch. This should be a cakewalk.
Steve
|
|
|
|
|
Hi to all,
How to write a constant member function in Managed C++ class.
public ref class CMyClass
{
public :
void Function(void) const
{
}
}
Here I got error as,
error C3842: 'Function': 'const' and 'volatile' qualifiers on member functions of managed types are not supported
- Aniket A. Salunkhe
|
|
|
|
|
[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
Please try this technique,
public ref class CMyClass
{
public:
void Function(void) const;
};
void CMyCLass::Function() const
{
.
.
.
}
Wish you Good Luck...
Jagdish Bhimbha
S/W Developer
|
|
|
|
|
Aniket Salunkhe wrote: error C3842: 'Function': 'const' and 'volatile' qualifiers on member functions of managed types are not supported
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The error message pretty much says it all. I can't understand why you felt the need to post the question.
Steve
|
|
|
|
|
I think there is a wider question here - are we saying that the .net languages do not support const correctness at all, or is the syntax just different? Unless you didn't guess I am from a C++ background! For instance if I have a const handle to an object, how do I restrict the caller to only calling certain functions - for instance getters which do not modify the object and not setters which would cause the object to be modified?
|
|
|
|
|
how to get individualvalues(month,day,year) from a datetimepicker???
Raja
|
|
|
|
|
Deja vu.
The MFC way:
Use CDateTimeCtrl::GetTime to retrieve a COleDateTime object, then call COleDateTime::GetMonth , COleDateTime::GetDay , COleDateTime::GetYear .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
I have listctrl and status bar in my parent window(which is invisible window). When i use WM_PRINT i am not able to capture horizontal and vertical lines in the listctrl. if i use listctrl printing by printing the contents and lines i am not getting the parent window's controls.
Please suggest any method to print the window with all the controls(which incluldes pritning the vertical and horizontal lines along with the content of listctrl).
Regards
|
|
|
|
|
Can I write native C++ code which will run without the help of .NET Framework in VC++ 8.0?
I tried New Project -> VC++ -> Win32 -> Win32 Project. But it is not working without the help of Framework.
Regards,
Hogan
|
|
|
|
|
hogan.john wrote: But it is not working without the help of Framework.
How did you confirm that?
|
|
|
|
|
VC++ 8.0 and Framework 3.5 installed in my development machine. So I build it then copied the release folder into another machine that doesn’t have Framework. It showed the error message “The application is failed to start because the configuration is incorrect”. I assume this error because of the lack of framework.
Please let me know is it possible to write native code in VC++ 8.0 which will run without the help of Framework.
|
|
|
|
|
|
Thanks for your great help. So we need at least this service pack on the target machine. This is annoying me. Every one said that VC++ 8.0 is the best modern compiler. But the programs developed in this required a helper software. Ok once again thanks for your kind response
|
|
|
|
|
You can also link statically to the C-runtime library. I guess in that case you won't need to install the redist package. Not sure because I never worked with VC2008.
Of course in that case your exe will be larger.
|
|
|
|