|
For some reason, this seems to work although I do not know why it should. "cin" does not account for spaces. I added strings with spaces and no troubles much to my surprise
char buffer[501] = {0};
cout << "Please enter the length of the protein sequence;
cin >> buffer;
cin.getline(buffer, 500, '\n');
-- modified at 17:56 Monday 24th July, 2006
UPDATE: I see from the output 2 getlines are needed.
|
|
|
|
|
Why are you surpised that would work? That is pretty much what one of the examples I posted does. The reason it works is that the >> operator for cin will read until it hits whitespace, but not read the whitespace. getline reads until it gets to the number of characters you specificed, or the character you requested and does read it in.
You really should look into the use case for "skipping" inputs in a console application. I can't think of any time where I would want the user to be able to hit enter and skip entering data. Now, entering a specific value to state they want to skip it, that is a different story ...
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Harold_Wishes wrote: 1) I want the user to be able to bypass keyboard entrys when they hit ENTER if they choose to skip a question. Now when I hit ENTER, the program will not let me go to the next cout prompt. It is waiting for something other than "\n" character. I believe this is why I used my getline implementation.
So what about something like:
do
{
cin.clear();
cin.ignore(100, '\n');
cout << "Please enter number of subunits: ";
cin >> data;
} while (! cin && (data < 1 || data > 12));
Harold_Wishes wrote: 2)Also, if I type in something like "new terminal", such entrys delimited by a space seem to cause the next cin input to read in the second string. But I need to test the output some more with this second issue since I'm getting other strange results.
Then you would indeed need to use:
string buffer;
cout << "Please enter the length of the protein sequence for Subunit " << increment << "> ";
getline(cin, buffer);
|
|
|
|
|
in my Apllication i have to form first form i can display like
CDialog form1(IDD_FORM1)
form1.DoModal();
when i Try to do same thing with DoModal
it is nit working . how can i do my application
janan
|
|
|
|
|
ningthemcha wrote: when i Try to do same thing with DoModal
it is nit working .
This makes no sense. You are using DoModal() . What's the problem?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Visual C++ 6.0 standard edition had an executable in the IDE directory that was basically the Microsoft Developement Environment IDE (mse.exe) and allowed for editing of HTML files with a very useful "script outline" window.
I'm in search of the equivalent "script outline" window in VC++ 2003 Standard Edition but I'm fearing it has been stripped in this version. Does anybody know of a way to get that paricular functionality directly or indirectly in VC++ 2003 Standard Edition?
|
|
|
|
|
Scratch that question. I found the button right after I posted...
|
|
|
|
|
Hi !
Does anybody know where I can download the Windows NT 4.0 Driver Development Kit ?
Many thanks in advance !
|
|
|
|
|
and how many forums do you plan to ask like that ?
have you searched the Microsoft website[^] ?
|
|
|
|
|
Hello All
I am trying to load a DLL dynamically using LoadLibrary (). It works fine with Windows
2000 Professional. But when i am trying to load it in XP or 2003 Server I get error "The specified module could not be found" Error.
DLL is present in the path where EXE is present. (C:\Program Files\Test Application\MyDll.dll").
When loading the DLL i am specifing full path as parameter.
I placed the DLL path to C:\ and in System32 directory and changed the path still I get the error.
DLL is basic C DLL. Unfortunately I did not get lib file along with DLL so i have load that DLL
dynamically only.
For MSDN i found that
Windows Server 2003, Windows XP SP1: The default value of HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1 (current directory is searched after the system and Windows directories).
But after searching Windows Directory it has to come to current directory to find DLL. But it fails
Please tell me any idea why this strange behaviour with Windows XP and 2003 Server!!!!.
Thanks for your Time
Ravi
|
|
|
|
|
There are probably other DLLs which this DLL depends on, which you also need to redistribute. Use the depends[^] tool to discover what they are.
|
|
|
|
|
Greetings,
I'm working on a project that needs to easily port between Windows and Linux platforms. As such, we've decided on using multiple development platforms to work with the code (much of which is already written). (For those interested, we're using Eclipse with GNU tools for Linux testing, and Visual Studio for Windows testing).
The question is the following: How do I force Visual Studio to read the Makefiles when building the project? I know that Visual Studio has the ability to work with Makefiles, however, I'm not able to make it work with already written code. Anyone have to do this before?
Thanks.
Patrick
|
|
|
|
|
pgav wrote: I know that Visual Studio has the ability to work with Makefiles, however, I'm not able to make it work...
Are you using nmake.exe?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I know of nmake.exe... but where do I find it/use it?
Patrick
-- modified at 11:19 Monday 24th July, 2006
|
|
|
|
|
It's in the \vc98\bin folder.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Note that nmake and GNU make syntax are often not compatible, so you might have to either download and use GNU make on Windows, or bite the bullet and maintain both a GNU-compatible makefile and a Visual Studio project file.
|
|
|
|
|
Hello.
I have an application that needs to launch multiple dialog boxes. To do this, I create the first dialog box in modal, and the others as non-modal.
Yet, I have one issue: when I launch the other dialogs, they don't have a title in the task bar and when I minimize them they get minimized just over the task bar. So, it's as if I did specify it to be a child (but I had put "parent" to NULL)...
How can I have multiple dialogs, that would have their own button in the taskbar, in one application?
Thank you
S. Ali Tokmen
http://ali.tokmen.com/
|
|
|
|
|
|
Hi all,
I would like to create a toolbar with standard bitmaps like a play, record and a pause button but I do not know where I can find these bitmaps or how I can use these.
Could somebody give me a hint?
Thanks.
|
|
|
|
|
what I've done in the past is open up the tool bar and draw what you'd like for each button.
you can adjust the size of the toolbar (length and width) by going in to your ".rc" and looking for:
<br />
<br />
IDR_MAINFRAME TOOLBAR 45, 45<br />
the "45, 45" are the length and width of the toolbar
Kitty5
|
|
|
|
|
Thank you Kitty5,
but there should be a way to use all these standard bitmaps. I think they are somewhere in the system32 folder in windows xp.
I don't like to redraw these icons if they already exist. Yes, it is easy for such simple bitmaps like a green triangle as play button or a red circle as record button. But it becomes harder if you try to redraw e.g. this folder bitmap of the open icon.
|
|
|
|
|
this might help:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vcresed/html/971c181b-40f5-44be-843d-677a7c235667.htm
Kitty5
-- modified at 9:29 Monday 24th July, 2006
also, those file folders, etc. are located in:
C:\WINDOWS\system32\SHELL32.dll
... not sure how u'll get the bitmaps out of the dll file...
|
|
|
|
|
Use the brute force & pig ignorance solution - it's simple, easy to explain, and it works. And you don't have to think too much.
Open an application which uses the icons you want on its toolbar (Windows accessories /Audio recorder, for example.)
Press Alt-PrtScr to copy the application window image to clipboard.
Paste the image into Windows Paint (or whatever graphics editor you choose)
Copy the images of the toolbar buttons one by one, and paste into Resource editor for your toolbar.
|
|
|
|
|
Hi all,
I am unable to get a clear idea why i am getting wrong.
//=======================================================================
int x;
unsigned long y;
x = -1;
y = 100;
if(x > y){
MessageBox("X is greater than Y");
}
else
MessageBox("Y is greater than X");
//=========================================================================
in the above statement first statement is being executed why.
please let me know.
Uday
|
|
|
|
|
x is being cast to an unsigned int. (UINT)-1 = really_big_positive_number
|
|
|
|