|
I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable.
if(m_iCount == m_sCountTo) Help
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
You can't compare an int to a string (unless the appropriate overloaded operators have been implemented).
|
|
|
|
|
if(m_iCount == atoi(m_sCountTo)) ...
|
|
|
|
|
THANK YOU!!!! IT WORKS!!!!
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
I suggest you keep the counter and the target value in integer format. This way you can compare them easily and perform a lot of other operations like increment easily.
You’ll need to convert from string to int, when the user enters the value. For display purposes you can either format the integer into a nice looking string, or display it directly.
Lorenz Prem
Microsoft Corporation
|
|
|
|
|
homework ?
There's lot of things wrong with this piece of code.
for a start, use a compiler and find the obvious ones ... and continue from there.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
lano1 wrote:
d = 20.4;
'd' is undeclared, unless it's a global.
lano1 wrote:
if(*a = 0)
*a += 1;
This is nonsense. What are you trying to do?
lano1 wrote:
but the pointers are confusing
'b' is the only pointer that is being used. To reference the value being pointed to by 'b', use *b .
If an 'if' statement is supposed to execute more than one statement upon TRUE evaluation of the condition, curly braces MUST be used. Otherwise, the second statement and beyond are executed unconditionally. For example:
if (condition)
do one thing
do another thing
do some more
What was actually meant was:
if (condition)
{
do one thing
do another thing
do some more
}
lano1 wrote:
And also should void be removed becuase the function is supposed to return a value.
Void functions cannot return values.
|
|
|
|
|
Hi,
I have an MDI application, and the window title is shown as title - [filename] when a child is maximised. I want to be able to change this display to look like:
filename - title
MFC does this, but I can't seem to find how to do it in plain WinAPI or WTL. I've tried overriding WM_GETTEXT but I never get that message?!
Any ideas?
thanks,
Simon.
--
Simon Steele
Programmers Notepad - http://www.pnotepad.org/
|
|
|
|
|
Hi
in your view use code like this
<br />
GetDocument()->SetTitle(strTitel);<br />
where strTitel is a CString variable containing the text to display. Of course, you also can set the title directly.
G. Steudtel
|
|
|
|
|
In my MFCApp::InitInstance I've cobbled to together a property sheet so it opens with that instead of the default dialog. I'm having problems in getting rid of the OK, Cancel and Help buttons
CPropertySheet sheet("Test");<br />
CFilePage files;<br />
CAnalysisPropPage analysis;<br />
CRecPropertyPage recording;<br />
<br />
sheet.AddPage(&recording); <br />
sheet.AddPage(&analysis);<br />
sheet.AddPage(&files);<br />
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP;<br />
<br />
m_pMainWnd = &sheet;<br />
<br />
int nRetCode = sheet.DoModal();<br />
<br />
return FALSE;
I've tried using GetDlgItem(IDOK) but it tells me it doesnt take 1 item whereas according to MSDN it should take an int. Any ideas?
|
|
|
|
|
DodgyG wrote:
I've tried using GetDlgItem(IDOK) but it tells me it doesnt take 1 item whereas according to MSDN it should take an int.
It depends on which version you are trying to use. If you are in the context of a CWnd-derived class (e.g., CMyPropertySheet), the one-parameter version will work. Otherwise, if you are in the context of a CWinApp-derived class, the two-parameter version is called.
|
|
|
|
|
Many thanks for the reply, I've tried the param version but I'm getting a NULL pointer when using CWnd* pWnd = GetDlgItem(IDOK); Any ideas?
|
|
|
|
|
Where is this code being used? If it is on one of the property pages or the app itself, there won't be a control with an id of IDOK.
BOOL CMyPropertySheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CWnd *pButton = GetDlgItem(ID_APPLY_NOW);
ASSERT(NULL != pButton);
pButton->ShowWindow(SW_HIDE);
pButton = GetDlgItem(0x00000009);
ASSERT(NULL != pButton);
pButton->ShowWindow(SW_HIDE);
return bResult;
}
|
|
|
|
|
Hi
please guide me How can I make Installer for my Offfice2K COM Addin, in VC++/ATL ? This COM Addin creates .dll file.
I'll be grateful
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
HI, i have a problem:
I should write an application executing a batch file which starts an MS-Dos window (console)
a programm is runnning there.
In this console i must send commands "visk[enter]" .... wait some time .... "visreg[enter]" .... and so on...
is this possible??
I searched very much, but can't find the right thing up to now.
Is it possible with this funtions:
CreateProcess (uses PROCESS_INFORMATION, from which i can get the HANDLE
to the window (but what do i need to use? hProcess, or hThread ??
With this can i use "WriteConsole" ????
I think this only writes strings, but i need to execute the command... HOW can I do that???
also it would be good, to get the response from the console output as an errormessage in my app.
Please Help!
I'm german, so if u're too, would be good to talk in german language.
Greetingz from da HackMan
|
|
|
|
|
Da_HackMan wrote:
also it would be good, to get the response from the console output as an errormessage in my app.
See if MSDN article Q190351 helps. There's also another one titled "Creating a Child Process with Redirected Input and Output".
|
|
|
|
|
Hi, I did some research now in google groups and MSDN, but still cant find any solution for my problem.
The goal of the whole story is to execute batch files on a remote machine.
Wouldn't it be better to write som RPC appication? But I donm't know how to do this!!!!
Can anybody explain me how to get THIS working?
I want to execute one or more batch files on a remote machine. which are lying all in the same directory.
at the moment it is working this way:
Call a batch file which internally calls remote.exe (i noticed this is from MS!)
In the nw command prompt (which is remote.exe) enter for example "visk" which is an batch file
from the remote machine lying in the same directory like the remote.exe (which is startet as server on the remote machine)
Now i want to make a Dialog based application. simply clicking a button to execute a command, or a command sequence like "visk [ENTER] visreg[ENTER] updstat[enter] ..."
HOW the hell can i manage this??? any clue??
with RPC i can start these batch files on the remote system, but i don't get the output they provide, am i right???
PLEASE HElp, I'm getting crazy of that *g*
Greetingz from da HackMan
|
|
|
|
|
Hi all,
can any body tell that, how to convert folder name with spaces into short names to be usable by the GetCurrentDirectory(...).
Thanks
The Phantom.
|
|
|
|
|
GetShortPathName() converts long names to short, but what has this got to do with GetCurrentDirectory() ? GetCurrentDirectory() has no input parameters.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
hi
i have to increase the efficeny of printer using postscript
that is "They are currently getting speeds of about 3 seconds per card but need something closer to 0.5 seconds per card. "
regards
ab
|
|
|
|
|
what do you mean ?
you want to optimize the generated ps file ? or tweak the printer itself ?
who's generating the postscript file ? if it's you, reviewing the code itself might be usefull.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
hi
i m generating the both optimized & non optimized ps files, the prob is that once the ps file is given to printer , the processor utilize too much time for processing it
there is some software like "JLYT" ( u can view its info from <http: www.hp.com="" go="" solutions=""> ) in this case the efficency of the printer is increased
i think now it is clear to u
regards
ab
|
|
|
|
|
How are you creating the Postscipt that is being sent to the printer? I need to know the same thing. How to print to a postscript printer.
Thanks
Larry
|
|
|
|
|
Hi!
To detect Ctlr+A in WM_KEYUP we use GetKeyState(VK_CONTROL)<0.
How can we know that user is pressing Alt+A for example ?
Thanks,
Sovann
Everything should be made as simple as possible, but not simpler [Albert Einstein]
|
|
|
|
|
That will be done as WM_SYSKEYDOWN or WM_SYSKEYUP, not WM_KEYDOWN/WM_KEYUP.
Steve S
|
|
|
|