|
EnableWindow(GetDlgItem(hPWnd,PSBTN_OK),FALSE);
use IDOK inplace of PSBTN_OK. and should do after the dialog is created say in WM_INITDIALOG handler.
Ashish Chauhan wrote: But i'm sure hPWnd is Property sheet Handle.
It is not the hPWnd is invalid, since GetDlgItem() returns a invalid handle EnableWindow end up with error.
If you are going for modeless property sheet, you can create your own dialog box layout.
|
|
|
|
|
Ashish Chauhan wrote: But i'm sure hPWnd is Property sheet Handle.
GetLastError() returned 1400 (invalid window handle), because GetDlgItem() failed. And Rajkumar has already explained why it is so. Is the problem solved now?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yep..It works..
Thanks Rajesh and Rajkumar...
If possible can you tell me what's the identifier for Apply Button??
Ash..
|
|
|
|
|
Ashish Chauhan wrote: what's the identifier for Apply Button??
ID_APPLY_NOW
Please do a Google and CP Search, before asking very simple questions. An instant search got me the following result:
Hacking the CPropertySheet[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
if you are looking for disabling APPLY button, have a look at PSM_CHANGED and PSM_UNCHANGED message.
|
|
|
|
|
Yeah..
PSM_UNCHANGED..That's what i looking for...
ID_APPLY_NOW didn't work..
Error shows undeclared variable..
Neverthless Problem solved..
thanks..
Ash..
|
|
|
|
|
What about EnableWindow ?
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
|
|
|
|
|
How to get foder size?
eg:there is a folder "new" in c:\\ i want to get size of this folder how to get this in VC++ dialog based application.
|
|
|
|
|
sushildaga1984 wrote: How to get foder size?
eg:there is a folder "new" in c:\\ i want to get size of this folder how to get this in VC++ dialog based application.
find size of all files of folder and add them. It gives you folder size.
|
|
|
|
|
sushildaga1984 wrote: How to get foder size?
Are you wanting the size of the folder itself, or the size of all files in the folder?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Since it's just an entry in the FAT or MFT, I can only assume it's the size of an allocation unit (e.g., 4KB). Although on an NTFS volume, folder names just might be "resident data" in the MFT itself and not consume any clusters.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi EveryOne,
i am adding one method from classwizard.in that i am having parameter list.i want parameter of types CString But in this WE dont have Cstring type so i used BSTR Type.
BOOL ReadBlk(BSTR FAR* MemId, BSTR FAR* MemName, BSTR FAR* eDate, BSTR FAR* Balance, BSTR FAR* TagId);
and when i am setting values to this i am getting error. please tell me how can get string type variable in that classwizard. please help me.
i am becoming
REPLY ME SOON.
THANKU,
savitri
|
|
|
|
|
savitri wrote: i want parameter of types CString But in this WE dont have Cstring type so i used BSTR Type.
you can just type the name of any data type if your required type is not there, type CString in the parameter type field.
|
|
|
|
|
Well, if you need a CString the type CString in the parameter type box (the wizard not impose you choosing one of the combo items).
You can also edit the generated code.
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 EVERYONE,
thanks for answering my question.but i tryed it.i will not taking.CLASSWIZARD->AUTOMATION->ADD METHOD->external name as reader->internal name as reader->return type long and parameter list strPort as CString i want like this but in this CString is not present so i choosen LPSCSTR. if i want OPTIONAL PARAMETER how can i do it while defining the method. bacause some i wont pass the parameter so i want that parameter as optional.please tell me how can i use it.
REPLY ME SOON.
THNKU,
savitri
|
|
|
|
|
Why don't you edit the generated code and change LPCSTR to CString (both in function declaration and definition)?
To set the last parameter as optional, assign it in the declaration, for instance:
function declaration (header file)
int foo( int i, bool f, CString szMsg = _T("Hi"));
function definition (source file)
int foo( int i, bool f, CString szMsg )
{
}
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
|
|
|
|
|
if i do like this shall i call that function in my program directly as foo(x,y); is it ok or it will give error or what. reply me.
thanku,
savitri
|
|
|
|
|
provided x is int and y is bool , it is OK.
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 all,
If i have a file on my disk say a .exe file and i want to make the shortcut of that file. How can i do it???
Thanks in advance
|
|
|
|
|
|
IshellLink!
"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/codeProject$$>
|
|
|
|
|
i have a button in my application which calls another dialogbox which has a custom message. but my problem is when i click the button the dialog is not popuping up. only when i insert a custom control this is happening. if i add a button or an edit box the window is poping up. how do i solve this out?
|
|
|
|
|
Did you register the Window Class ?
Check this article[^] and verify if you did all the required steps.
|
|
|
|
|
did all that is there in the article..
i created another dialogbox. added a custom control and gave the class name for it. gave a member variable for the control... compiled... there was no error. debugged and checked and figured out that DoModal is returning -1..
|
|
|
|