|
The right place is OnInitDialog [^].
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
[My articles]
|
|
|
|
|
What do you think about Constructor or WM_INITDIALOG?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Member 4250705 wrote: But my problem is , where to write the code for a newly created dialog (if i want to do something when the dialog gets loaded)
In MFC for every dialog there must be a class that's generated by the class wizard. Also it generates a function for this class called OnInitDialog , this function is called after the dialog and it's controls are created but not bound to data exchange member variables, which will be done when we call CDialog::OnInitDialog from our OnInitDialog .
There must be a comment in your OnInitDialog function which says
// Add your initialization code here
So after this call you can add your code for intialization.
|
|
|
|
|
i have call a dialog class on button click of another dialog class, i want to close the dialog from where i have clicked the button. is there any method or function to handle this event?
|
|
|
|
|
Have a look at this nice article [^].
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
[My articles]
|
|
|
|
|
Hi
Can AnyBody tell me How to sort out these errors....i am using Vs2005 (VC++)
Compiling...
CommonHeader.cpp
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(382) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(452) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(476) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(477) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(485) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(486) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(502) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(504) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(505) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(580) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(594) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(619) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(621) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2065: '__in_z' : undeclared identifier
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2761: 'BOOL CHttpServerContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(62) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2761: 'BOOL CHttpFilterContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(121) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2761: 'BOOL CHttpFilterContext::AddResponseHeaders(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(127) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2447: '{' : missing function header (old-style formal list?)
DatabaseHandler.cpp
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(382) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(452) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(476) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(477) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(485) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(486) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(502) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(504) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(505) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(580) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(594) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(619) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(621) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2065: '__in_z' : undeclared identifier
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2761: 'BOOL CHttpServerContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(62) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2761: 'BOOL CHttpFilterContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(121) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2761: 'BOOL CHttpFilterContext::AddResponseHeaders(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(127) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2447: '{' : missing function header (old-style formal list?)
eScanISARegister.cpp
GENERAL.CPP
main.cpp
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(382) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(383) : error C2143: syntax error : missing ')' before ';'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(452) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(476) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(477) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(485) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(486) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(502) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(504) : error C2061: syntax error : identifier '__in_z_opt'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(505) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(580) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(594) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(619) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.h(621) : error C2061: syntax error : identifier '__in_z'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2065: '__in_z' : undeclared identifier
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(61) : error C2761: 'BOOL CHttpServerContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(62) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(63) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(120) : error C2761: 'BOOL CHttpFilterContext::GetServerVariable(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(121) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(122) : error C2447: '{' : missing function header (old-style formal list?)
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2146: syntax error : missing ')' before identifier 'LPTSTR'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(126) : error C2761: 'BOOL CHttpFilterContext::AddResponseHeaders(void)' : member function redeclaration not allowed
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(127) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxisapi.inl(128) : error C2447: '{' : missing function header (old-style formal list?)
Generating Code...
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 8.00.50727
Copyright (C) Microsoft Corporation. All rights reserved.
Build log was saved at "file://e:\source\ESSource\ISA Proxy\eScanISA\eScanISAonVS2005\Debug\BuildLog.htm"
eScanISA - 93 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|
Do you like to more explain about your problem I cant see your monitor its so far?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Oopt!
where is your codes that generated these error ?
|
|
|
|
|
void *ptrList [30];
char ss [40];
for (i = 0; i<26; i++)
{
if (ptrList [i])
sprintf(ss, "%s", *(CString *) ptrList [i]);
}
What do those code do?
Thanks.
|
|
|
|
|
hung1984 wrote: if (ptrList [i])
sprintf(ss, "%s", *(CString *) ptrList [i]);
From the code...
ptrList is an array of CString pointers which for some reason is kept as void pointers, but the developer knows it's internally CString* so he is "confidently" casting it to CString* then copying the CString value to a character buffer (ss ).
Confusing at times and also he forgot another step to cast *(CString*) to LPCTSTR and to use _stprintf instead of sprintf .
So after correction the code will look like...
void *ptrList [30];
char ss [40];
for (i = 0; i<26; i++)
{
if (ptrList [i])
{
LPCTSTR lpctszStr = (LPCTSTR)(*(CString *) ptrList [i]);
_stprintf(ss, "%s", lpctszStr);
}
}
|
|
|
|
|
hung1984 wrote: if (ptrList [i])
sprintf(ss, "%s", *(CString *) ptrList [i]);
it's copying content of ptlist to ss!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
what the statement for if here ?
if (ptrList [i])
|
|
|
|
|
You just only declare a array of void pointer like void* ptrList[30]; and no initialize for them.
so ptrList[i] point to a value that has no type (and thus also an undetermined length and undetermined dereference properties). ptrList[i] is now == 0x??????????
and if(ptrList[i]) is now similar if(true)
let me know if i am wrong
|
|
|
|
|
Can't you just use the debugger to find out? Otherwise, you're just programming "in the dark."
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Looks like bad code to me.
Steve
|
|
|
|
|
Hi all,
I m using a List control of Report view type.
Item text in list control display in sigle line.
There are many column when i print data of list control all column are not print .
i want to use property fit to page width.
i want all column are print with full data.
please tell me how can i do this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
$h@nky_ with another problem about print how did you try to print them?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
there is only one problem that is fit to page width remain other problems are now short out.
thats why i need a help from u.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I think you will get your answer of troduction to MFC Printing[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Sir i m already check this article.
i think u dont understand my problem.
printing is done in my application.but the problem is that if List have 15 column and according the Page width all 15 are not print.
i want to adjust columns width according to page width.
thats why all number of column are print.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
The program do a lot of hard disk reading and writing,
so other application became very slow,
any way to make it work when the hard disk is not busy?
|
|
|
|
|
My suggestion is to use Memory Mapped Files[^]. It will definitely improve the file access performance. You can use CMemMapFile[^] class for making your task easier.
Just try it and check whether the MemoryMapped files improves the performance in your case. Good Luck!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi Experts,
I am learning threading concept in vc++. I have gone through the basics.
I would like to clear my doubts for the following.
1. when do we used
. a. afxBeginthread
. b. beginThread
. c. createThread
2. to communicate between different threads
3. thread synchronisation.
Could u please advice me any link (or if I can get any documents) from where I can learn the same ( specially for point 2 and 3 )
Thank You So much in advance
Himangshu
Bangalore
|
|
|
|
|
See C++ Multithreading Tutorial[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
thax a lot for ur reply hamid....I will go through it and post here again
|
|
|
|