|
Anonymous wrote:
...but I have trouble getting data.
Show us the code you are using.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
char c;
while (inpf.get(c)) {
cout.put(c);
}
the second version:
inpf.seekg(ios::beg);
static char read_array[10]; inpf.read(read_array,15);
|
|
|
|
|
char c;
while (inpf.get(c)) {
cout.put(c);
}
|
|
|
|
|
Are you sure this is what you are using? Your original request was to "read the data into variable account and amount then use get() again with no argument in order to through away the new line character at the end of the line." What you have here is not even close. It simply reads and displays one character at a time of the file.
See if this is any closer:
string account, amount, pendamount;
while (...)
{
inpf.getline(account, 15, ' ');
inpf.getline(amount, 15, ' ');
inpf.getline(pendamount, 15, ' ');
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I added header <string> to support string.
My modified code:
string account, gallons;
while(!inpf.eof())
{inpf.get(account, 15, ' ');
inpf.get(gallons, 15, ' '); }
When I compile I get this error:
"'class std::basic_istream<char,struct std::char_traits<char=""> > &__thiscall std::basic_istream<char,struct std::char_traits<char=""> >::get(char *,int,char)' : cannot co
nvert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called"
Any idea why? I am a new to C++
|
|
|
|
|
Anonymous wrote:
...]cannot convert parameter 1 from 'class std::basic_string,class std::allocator >' to 'char *'[...]
This is about as specific as C++ error messages get.
It means that you provided a std::string where a char* was expected. The C++ compiler had no clue how to convert the string into a char* and threw the error.
You need to give the get() -function a char -array of the length 16 (15 chars you are expecting and one for the trailing zero).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
hi! i want to read c source code sample to diable ctrl+alt+del keys combinations in windows 2000. because i have a sample programms listed below but it does not work in windows 2000. hope to hear from u soon.
the sample programms is as :
************************************************start
#include <windows.h>
int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR ,int)
{
BOOL old;
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, &old, 0);
MessageBox(NULL, "Ctrl-Alt-Del, Alt-Tab, and some other system keys are now disabled. "
"Test this for yourself by pressing some of these key combinations. "
"Note that you can still switch to other applications using the Taskbar buttons. "
"For more precise control over the system keys and task switching operation, get "
"KeyBlock from http://members.aol.com/phord (You can also find the source code to "
"this demo there.)", "Poor Man's KeyBlock demo", MB_OK);
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, &old, 0);
return 0;
}
*****************************************************end
|
|
|
|
|
This is not hte first time someone ask this. Search this message board or Goggle for "gina.dll".
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Rickard Andersson18 wrote:
...Goggle for "gina.dll".
Perhaps you meant msgina.dll!
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I've created a como box in pure Win32 API. But when I click to showthe list it doesn't appear, well , it does, but its heigth is ~2 pixels high
How do I change the heigth ofthe drop-down menu in my Combo box control?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
hi,
work on WM_DRAWITEM with struct DRAWITEMSTRUCT
Set CtlType and rcItem to set height of combobox.
The chosen One
|
|
|
|
|
There is only one function for setting the size of the DropWindow. Thats MoveWindow. The rectangle you move the window to includes the drop area. When the drop window is not shown, the control limits its client area to the correct height for a combo box. So just use a larger height on your rectangle when you position the window.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I need to do it from the code, to attach a debugger to a process id, just the same as we can do it from the task manager when u right click a process and click debug.
Any help would be appreciated
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Check out the following API calls:-
<br />
Private Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long<br />
Private Declare Function WaitForDebugEvent Lib "kernel32" (lpDebugEvent As DEBUG_EVENT_BUFFER, ByVal dwMilliseconds As Long) As Long<br />
Private Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long<br />
I only have this in VB - I'm guessing you want a C/C++ example...
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Thanks for your help
but i already checked these APIs, and the prob is that im not developping my own debugger i just want to attach to the VC++ debugger. whereas these APIs are issued by the debugger.
Hope you get what i mean
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Ah. You mean that you want your application to attach the VC++ debugger to it, rather than attach your program AS the debugger.
Will "MSDEV -p procid -e procid" not do this?
Steve S
|
|
|
|
|
Exactly!
Thank you all for your help
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
If you want to use the same debugger as configured on the system for just-in-time debugging (which I think is the same as the one used by Task Manager), you can find the path in the Debugger value of the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug.
|
|
|
|
|
Which, by an amazing coincidence is where I checked the command line...
Steve S
|
|
|
|
|
Hi,
i have seen code samples and i would like to know the following
what is the difference or why is it better or why would someone
register a window class and then create a window and then lay a dialog over it instead of just registering the class and creating a dialog?
is there an advantage?
thanks
ps i hope someone understands my question....
|
|
|
|
|
I build MFC project,
and want now to add html-help to it.
Evedently there is instruments how to convwert resource.h
and project.rc
to html-help project.
Or else way of assighning resources IDs to html-help.
Can you advice better one?
For html files is it better to use extenal editor?
Need be connected to system of html-help creation ?
what is the better practice in this case?
thanks.
|
|
|
|
|
Could you be more precise?
What do you want to do, contextual help or "standard" help?
New, what do you own the world?
How do you own disorder?
|
|
|
|
|
I declared a varible as a SYSTEMTIME type in my code as:
SYSTEMTIME st;
how to make its value one minute later or one hour later?
Thank you in advance!
|
|
|
|
|
st.wMinute += 1; or
st.wHour += 1;
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
yep. but watch for 25th hour an 61st minute . I played with that stuff for an hour until I realized my horrible mistake
|
|
|
|