|
What is in simple terms beteen between OnOk() and EndDialog and what is the command to close a program down as the commands above only close the dialog they belong to
Donald
|
|
|
|
|
OnOK is the method called when the OK button is pressed, it sets the dialog result to be ID_OK ( or something like that ). EndDialog just closes the dialog.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
OnOK calls UpdateData(true)
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Calling CDialog::OnOK performs any data validation, then calls EndDialog with the result IDOK, so it essentially simulates a user clicking the OK button.
Depending on the situation, you may want to use OnCancel instead. It skips the data validation, and simply calls EndDialog with the result IDCANCEL.
(The IDOK/IDCANCEL values are what's returned from the DoModal function)
To close an app:
AfxGetMainWnd()->PostMessage(WM_CLOSE);
Pssst. You see that little light on your monitor? That's actually a spy camera, and I'm tracking your every move...
|
|
|
|
|
Hello,
I'm creating an app. that will run on various computers with various resolutions and styles. A window on my machine looks like the right size, but is too small on another's machine. I looked for an article on making my windows indpendent of the users' fonts, resolutions, etc, but to no avail.
Can anyone suggest a place to find this information?
thanks,
JennyP
|
|
|
|
|
Hi,
i think that you have to include the resizing code
Have a look @ msdn related to CWnd::OnSize it does have an example
Hope that this might help you
Sujan
|
|
|
|
|
Hi,
how can I make an installation package for my application in vc++?
I've not found anything in the articles and messages, and i don't know how do it.
Thanks.
|
|
|
|
|
At the risk of starting a battle...
Check out InnoSetup at www.jrsoftware.org[^]
It's a great little program that is easy to use.
Make sure you also download the ISTool editor.
Brad
|
|
|
|
|
Thanks!!! It's very easy and i've got my package!
|
|
|
|
|
An hour from need to successful installer!
Glad I could help.
|
|
|
|
|
But if You ar eusing INNO Setup ,u should learn some pascal language as it is based on Pascal Scrpting
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I am trying to develop some extensions to the CSplitterWnd class and need to get the handle to the divider bar so I can add some features to this component of the class. Does anyone know how this can be done?
Specifically, I have some code that extends a divider to add a 'quick close' button and would like to incorperate this into our application's use of the SplitterWnd class. But I can't find the divider handle in the splitterWnd object to do this.
I'd appreciate any help.
Thanks.
-b
|
|
|
|
|
i m developer of network security and i have write program that make pc's in network more secure .
but i need some help for shutdown computer remotely useing
only one program instaled on server
please some source code or does'nt replay this message!
thank's
|
|
|
|
|
Take a look at InitiateSystemShutdown .
|
|
|
|
|
Look up ExitWindowsEx
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I want to have a screensaver that logs the current user off when the have been idle for X amount of time. I am currently using ExitWindows() function, but the user is not logging off. The return value is ok. I thought my screensaver might have to handle the message as well but OnQueryEndSession never gets called. The message catch, shown below, is in the same class as the ExitWindows call. This function was created through MFC wizard.
BOOL CDrawWnd::OnQueryEndSession()
{
return TRUE;
}
Any help or guidance will be very helpful.
|
|
|
|
|
jet9153 wrote:
I am currently using ExitWindows() function, but the user is not logging off.
Which means that some application is returning 0 in response to the WM_QUERYENDSESSION message. Do you agree?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Does it have to be within your screensaver? Windows has this functionality built in using Group Policies.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi
First: I am very new in programming dlls. I tried to make one to use it with A5 3DGameStudio (link[^]). I just made a new project (dynamic-link library Win32) - I use Visual C++ - a very simple dll including one function returning an int . Compiling done, tested with an Visual Basic DLL-Tester - it works. Now the 3DGS doesn't accept it . Error: "Dll not compatible with 3DGS" ...
Has anybody ever written a dll for a 3DGameStudio Game that works could you give me an exemple how this looks like, just the structur and which data types (int or long / double or float) I can return ?? I got no answers from the support , no informations on the side nor on fan sides .
thanks to all who read this
Greatings
Lukas
|
|
|
|
|
The function GetScrollBarInfo() doesn't return anything....does not matter what i do. if i use Getscrollinfo() it always returns a value but Getscrollbarinfo on the other hand doesn't...by the way anyone else noticed how complex microsoft implemented the scrollbar? I find it quite a pain to draw a skin on a scrollbar because of this issue
Oooh Joy...
|
|
|
|
|
|
Ok, so I have this formatting function because I need 2 digits after the exponent and VS7.1 puts out 3 by default. So anyway, the code is pretty verbose and slow. Anyone care to take the blinders off my eyes and optimize this?
std::string CDataFile::mf_FormatNumber(const int& iVariable, const int& iSample, const bool& bIsDAT_Format)
{
try
{
char buffer[200] = {0};
std::string numstring = "";
std::string buffstring = "";
std::string result = "";
if(bIsDAT_Format)
{
result = (m_v2dData.at(iVariable).at(iSample) >= 0.0) ? std::string(" ") : std::string("");
sprintf( buffer,"%.5E", m_v2dData.at(iVariable).at(iSample));
}
else
{
result = (m_v2dData.at(iVariable).at(iSample) >= 0.0) ? " " : " ";
sprintf( buffer,"%.17E", m_v2dData.at(iVariable).at(iSample));
}
numstring = buffer;
if(numstring.length()-numstring.find_last_of("E") == 5)
{
buffstring = numstring;
if(bIsDAT_Format)
numstring.resize((m_v2dData.at(iVariable).at(iSample) >= 0.0) ? 9 : 10);
else
numstring.resize((m_v2dData.at(iVariable).at(iSample) >= 0.0) ? 21 : 22);
numstring += buffstring[buffstring.find_last_of("E")+3];
numstring += buffstring[buffstring.find_last_of("E")+4];
}
result += numstring;
return result;
}
catch(...)
{
std::string szerr = "";
char errbuff[1024] = {0};
sprintf(errbuff,"ERROR formatting Var: %d Sample %d! \nDetails: %s", iVariable, iSample,m_szError.c_str());
szerr = errbuff;
return szerr;
}
}
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hi Nitron,
I don't fully understand your code, but the following should write a number in the format you wish:
std::string format(double& x,bool bIsDAT_Format)
{
char buffer[200]={0};
if(bIsDAT_Format){
sprintf(buffer,"%.5E",x);
}
else{
sprintf(buffer,"%.17E",x);
}
std::string res=buffer;
std::string size_type pos=res.find("E+0");
if(pos==std::string::npos) pos=res.find("E-0");
if(pos!=std::string::npos) res.erase(pos+2,1);
return res;
} I haven't compiled this, but the general algoritm should work, hope you get the idea: we look for "E+0" or "E-0" and, if the pattern is found, remove the offending "0".
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Joaquín M López Muñoz wrote:
we look for "E+0" or "E-0" and, if the pattern is found, remove the offending "0".
ahhh.. good thinkin' Thanx Joaquín!
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hey every one...
How to Declare a program, Menu or a dialog
I mean if we have Word for example... How we can Declare the main window... and after that i want to Declare a menu or a dialog inside the Word....
so how to do that?
thanks
|
|
|
|