|
-sometime EnableWindow is (FALSE)
-sometime EnableWindow is (TRUE)
how to control this??
OnInitDialog is only one time or not.
onther class is control dialog EnableWindow or not.
//my code
//LeftTreeCtrl.h
void CLeftTreeCtrl::EditCategory()
{
CAddCategoryDlg dlg;
dlg.m_strcom1=cry->m_strCom;
dlg.GetDlgItem(IDC_COM1)->EnableWindow(FALSE);
if (IDOK == dlg.DoModal())
{
//code
}
}
void CLeftTreeCtrl::AddCategory()
{
CAddCategoryDlg dlg;
dlg.m_strcom1=cry->m_strCom;
dlg.GetDlgItem(IDC_COM1)->EnableWindow(TRUE);
if (IDOK == dlg.DoModal())
{
//code
}
}
i wrote this two function.
this is not access.
Other class can not control other dialog class.
please answer me.
|
|
|
|
|
Yes, OnInitDialog is just called once when you call DoModal. But, when you create your dialog again, it is of course called again. If you want to enable or disable your control but without knowing it before, I suggest you to add a member variable to your class dialog (say bEnable for example) and add a member function:
void CYourDialog SetEnabled(BOOL bEn) { bEnabled = bEn; } . So you call this member function before calling DoModal (and after creating your dialog) and then, in OnInitDialog, add this:
...->EnableWindow(bEnabled);
|
|
|
|
|
thank you so much...
working my application..
|
|
|
|
|
Hi..
How to find any control on dialog has changed without tracking setfocus() lostFocus() of each control. As there are too many screens & too many controls on those screens. I just find out, if need for Save on OK Button or not needed.
I'm saving data when user press OK.. I want to check that if user changed something then only I run sql to update otherwise nothing should be done...
Can anybody help me?
Regards
Sumit Kapoor
Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Maybe another solution would be to have a member variable in your Dialog class that will be at TRUE hen something changed. So at initialization, this variable is set at FALSE and whenever you change something, set this variable to TRUE.
|
|
|
|
|
Sir Ji,
That's what I'm asking, When to set this variable TRUE, as your suggestion showing that I need to track all controls for changes..that I don't want to do. I just want to find out, User changed any control's value or Not? if changed then I have to save otherwise Ignore on OK Button.
Just Think & let mw know if any idea?
Thanks
Sumit Kapoor
Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
I've built a client server application built in visual c++ sp5 inheriting from the CAsyncSocket class. Also i am spinning of a thread when my application starts which is used only for logging purposes. My problem is that the application sometimes just disappears without giving any error message. i've put try catch blocks everywhere and have been as defensive as possible but this is happening at random positions so am not sure what to do at this point. Any ideas why this might be happening? The operating system is windows 2000 server and using a intel P4 HTT machine.
|
|
|
|
|
Try rebuilding all once again . This happened to me .
Dharani babu S
redindian
|
|
|
|
|
I'm attempting to port a DirectSound application I wrote in VC# (.NET 2003) to VC++ (.NET 2003).
I've almost ported the entire code, but I'm stuck on one line, and would really appreciate it if somebody could help me out on this.
The line in C# is:
MemBuffer = (short[])(AppCaptureBuffer.Read(StreamCapBuffReadPos, typeof(short), LockFlag.None, 50000));
MemBuffer was previously declared as:
private short[] MemBuffer;
How would I do this in C++? My problem is with the "typeof" keyword in C#. It signifies the returned data type.
C++ doesn't appear to have the "typeof" keyword. How do I write this in C++?
Thanks!
|
|
|
|
|
can you guys help me to change the font of all the applications' window running in Windows.I tried to change the system font but i can't.
thanks
|
|
|
|
|
hi,use the api
SystemParametersinfo with nm_nonclientmetrics as type and fill in the desired font in nm strcture
|
|
|
|
|
thanks a lot.I knew this API function,but when i tried to change the font of one active application,it can't be done,it 's denied.Do you know the solution?Thanks again!!!
|
|
|
|
|
give sp_updateINIchange and sp_updatreginichange options
it will change aLL apps, i tested it was working
|
|
|
|
|
thanks,buddy,i 'll try again.
Hey if you have a YahooID we can talk directly,wot do yo think?
|
|
|
|
|
my yahoo id is
babu_ooty18
just make it as friend ,i am available now
|
|
|
|
|
I have a Exp file and lib file and dll,can anyone tell me how to get function declaration from it so that i dynamic load function from it.
I know the name of function but i have to retrieve parameter from it
Thanks for any help provided
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
You could try using depends to see the function exports. However I am guessing that all you are seeing are the mangled C++ names.
If this is so, without the header file I would find it hard to prototype the function names and parameter list.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
If you are using Microsoft VC++ and you can get the decorated name, you can then use the undname utility from MS to show the parameters and return type. For example:
If the decorated name is ??0CLogFile@@QAE@VCString@@_N1@Z, use the command as shown
D:\>undname -f ??0CLogFile@@QAE@VCString@@_N1@Z
Microsoft« Windows« Operating System
UNDNAME Version 5.1.2600.0Copyright (c) Microsoft Corporation. All rights reserv
ed.
>> ??0CLogFile@@QAE@VCString@@_N1@Z == public: __thiscall CLogFile::CLogFile(cla
ss CString,bool,bool)
D:\>
|
|
|
|
|
Thankyou, I will bear this in mind in future.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
really i am very very thank ful to you for this great help thanks very much
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
now problem arise how to get mangled name of function
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
If the name is not mangled when you see it in Depends I don't think there is any way to get it
--
Andrew.
|
|
|
|
|
I used AfxBeginThread() to create a new thread, which would access some objects, in a member function of the class CMyClass. ( The CMyClass object is a member variable of the class CMyDialog. These "some objects" are also members of the class CMyClass )
Now, I'd like to destruct the CMyClass object while a button in my dialog (an object with type CMyDialog) is pressed. But the thread controlling function is still accessing some of its member objects in a loop. How could I savely delete these objects and end the thread savely when the button is preesed? Is there any standard step to solve this problem?
I've also tried to use the function GetMessage() in the thread controlling function, but when I used the debug mode in Visual C++ and breaked at where GetMessage() was, I found the thread would be destroyed immediately after
executing this line. What's wrong with it?
|
|
|
|
|
Sounds like you need to tell the thread to finish up
as you cant just kill it inthe middle of things
Interthread communications issues ...perhaps you might like to Post it a message
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
First important thing is that , you thread is an independent entity. You are creating a thread through class , that does not meant that it is associated with the class life time.
On Button click post WM_QUIT message to yout thread .
use PostThreadMessage API
and ...
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
// Do your cleanup here
return 1;
DispatchMessage(&msg);
}
|
|
|
|