|
Doing it the way you have you have to press the enter key twice after getline to get a response (the bug you were referring to). See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q240015 for the fix ( the fix does work if you make the changes in the right file. The file referred to is in two different locations. You might as well change the code in both: MicrosoftVisualStudio\VC98\Include\String and MicrosoftVisualStudio\VC98\CRT\SRC\String I did and the enter key only has to be pressed once now and the code below which is like your way of doing it works fine.
#include "stdafx.h"
#include "string"
#include "iostream"
using namespace std ;
int main(int argc, char* argv[])
{
string s1;
cout << "Enter a sentence:";
getline(cin,s1);
if(s1 == "???" || s1 == "")
cout << "First case";
else
cout << "Second case";
return 0;
}
|
|
|
|
|
I just bought a PocketPC today. I wonder if I can use
VC++ to write programs for it? How do I develop applications
on the PocketPC? Where can I download the SDK for PocketPC?
I'm using VS.Net 2003, I wonder if there is a built-in tool
that I can develop applications on the PocketPC?
Thanks.
|
|
|
|
|
What kind of operating system is installed in you pocket pc?
The World is getting smaller and so are the people.
|
|
|
|
|
The OS is Windows Mobile 2003.
|
|
|
|
|
humm, well only think i can suggest is to get the sdk of that os.
I dont know wheather that is available in .net coz i have not yet moved to .net
The World is getting smaller and so are the people.
|
|
|
|
|
You ought to be able to use VC++ .NET 2003 with the Mobile Web Forms library. Presumably you should also be able to write native code for it. But I don't know whther there's a non-.NET library for this purpose? Some may use libraries such as WTL, as this is relatively lightweight and fast, I gather.
Kevin
|
|
|
|
|
How to Bind FRAME'S SCROLL MESSAGE to CMyControl's SCROLL MESSAGE?
that is :
1)How can I send FRAME's message-'WM_HSCROLL'(including position information) to CMyControl(eg: ID:0x100)
to invoke its action
2)When I Move CMyControl's client,How to change the FRAME's ScrollBar's Position?
thanks!
Sorry for my pool English
|
|
|
|
|
Is there any way to control elements in an instance of IE,such as form.I want to click on a certain button in an IE window every time I open it.Hopefully someone can show it in details.
|
|
|
|
|
This task is quite complex:
1.
First you have to connect from your appp to running instances of IE in order to monitor it.
http://www.codeguru.com/ieprogram/enumIE.html[^]
2.
You have to parse every document in every running instance of IE and search for your form in the documents. For this you can use MSHTML functions, first getting MSHTML::IHTMLDocument2, then call IHTMLDocument2::forms, which gives an IHTMLElementCollection of all forms in the document. Iterate through all forms IHTMLElement's (if there are many of them) by searching form some ID or name. If your form is found, create from the IDispatch pointer of the form's IHTMLElement an IHTMLFormElement, and finally call its submit function.
The above link also shows you how to get IHTMLDocument2 pointer of a running instance of IE, and all further steps are here.
Peter Molnar
|
|
|
|
|
I've edited this question...
How can I just return the HICON from system image list for HTML documents only?
Thanks
|
|
|
|
|
Is there any way to verify that the memory allocated by a program has been freed after the program closes?
I ran my program and used the Task Manager to view the memory usage. I also viewed the Allocated Memory and Available Memory. After I closed the program I expected the Available Memory to increase by the amount of memory usage that was associated with my program, but it didn't.
|
|
|
|
|
The operating system will reclaim all memory allocated by a process when it exits. Don't use taskmanager as a reliable way to check for memory leaks (Which are not an issue outside of a proceses' lifetime).
If you want a more accurate view of your systems resources have a look at the utilities on http://www.sysinternals.com[^].
HTH
Ryan
|
|
|
|
|
Dear,
you can use CMemoryState class to take "snap shots" of memory allocations.
Just by using the CheckPoint() function and Difference() function you could be able to tell if there is any difference in the allocated and deallocated memories. Another function DumpStatistics would also help much - it prints all the unfreed object information to the debug output. Please find more information on MSDN.
Hope this helps.
Thanking you,
Yours,
P.GopalaKrishna.
|
|
|
|
|
I have a CListBox. I can make it colorful but I have to have
ownerdrawclass as yes.
I can make it have a horizontal scroll, but I have to have
ownerdraw as no.
Is there any way to combine the two?
Please let me know. Nothing would delight me more than to have
someone say "no it's not possible" so that I quit spending so
much time on this issue.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
The \a control gives out a beep, is there any other way that you can make the actual computer beep. Any other notes?
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
check out win32 api
mciSendString
you can use this apis to play a wave music,
this is not the only api, you will need other supporting apis along with it.
just need to be explored, plus there is a sample in platform sdk on mci commands.
regards,
Prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
I have an dialog application that contains a class I derived from CPropertySheet Class, and also has some ProperyPages as well. I need to call a function in the dialog from one of the PropertPages.
Getting a hold of the PropertySheet from a PropertyPage is easy, but how you I get a hold of the dialog that the ProperySheet is in?
Thanks
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
How about m_propSheet.GetParent() ?
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I just want to display a small letter Pi, but could not do it in Windows easily.
Win32 and MFC uses Standard ASCII Table which does not have small pi the old IBM DOS version of ASCII provides (It should be as easy as \xE3).
If I don't want to pile up too much code for this small issue, what would be my options?
Help me.
Don
Don
|
|
|
|
|
If your showing the character in a control, you just need to switch the control to the correct font.
I would do it like this:
LOGFONT lf;
GetDlgItem(IDC_CONTROL)->GetFont()->GetLogFont(&lf);
_tcscpy(lf.lfFaceName, L"NameOfFont");
m_Font.CreateFontIndirect(&lf); // m_Font is a member var
GetDlgIten(IDC_CONTROL)->SetFont(&m_Font);
This should work correctly regardless of screen font size settings unless the font you want to use does not support the size you request, as you may get a different font supplied by windows instead.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi all,
I am in a problem if someone can solve it. I dont know the way to watch static variables in watch window ( or by any other means) in Visual C++ 6.0 debugger.
Please help.
|
|
|
|
|
Put classname::variablename in the watch list
|
|
|
|
|
The problem is not to watch the static member variables but to watch the static variable which belongs to a procedure e.g. a Window Procedure normally has many static variables.
|
|
|
|
|
I am utilizing edit boxes to design a report from a simple database. I have three edit boxes that I am using. They are called NameFirst, NameMiddle and NameLast. I want all of the edit boxes to automatically set their own width. For example if I have an edit box that contains "Gloria" I would like that edit box to be only wide enough to display the text "Gloria" and not a pixel wider.
Also the editbox called NameMiddle is located directly to the right of NameFirst. I would like the NameMiddle editbox to automatically calculate the size of NameFirst and place itself 2 pixels to the right of NameFirst.
How can these things be accomplished?
Thank you,
Eric Sepich
|
|
|
|
|
Is there anyway to print an entire Visual Studio project in one shot?
thanks
|
|
|
|