|
If the file you are using is a text file, then using a StreamReader may be much easier
than reading the file as an array of bytes.
If the file is binary and you're looking for embedded text, then you may have to search for the
character sequences yourself.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
I am going to read the cfile.
For that what i have to do.
Can you give any model code.
Thanks
|
|
|
|
|
rose196 wrote: I am going to read the cfile.
Huh?
You're going to use the MFC CFile class instead of the .NET file classes?
If so, the solution is exacly the same.
The CFile class "provides unbuffered, binary disk input/output services".
So my answer would be the same - CStdioFile is probably a better choice if you're working with text
files. If the files are binary with embedded text, you'll probably need to search for the text yourself.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am connecting a device through GPRS, using SLIP. But that doesn't work. (if you can help here, ok) so I need to change the protocol from SLIP to PPP.
So does anybody know the bare minimum PPP protocol implementatation, bare minimum just to send and receive. In C?
Thank you very much.
|
|
|
|
|
unix_master01 wrote: In C?
You voted a one for the last reply you got in this forum so I am reluctant to offer you assistance. This forum is not for C/C++ questions. This forum is for C++ development on the .NET platform using the Microsoft CLI extensions to C++. C and C++ questions belong in the Visual C++ / MFC forum.
unix_master01 wrote: I am connecting a device through GPRS, using SLIP. But that doesn't work.
What does "doesn't work" mean?
unix_master01 wrote: So does anybody know the bare minimum PPP protocol implementatation
Are you asking about developing your own PPP stack? I wouldn't think that has been done any longer after like Windows 95 and 2000 since the OS's provide those stacks.
led mike
|
|
|
|
|
I gave you a 5, and set out to earn my own 1 from this guy....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah I see what you mean. I did give him a second opportunity to show he isn't a giant jackass but he wasn't able to accomplish that task I see. This seems to prove, not that I needed proof, Windows isn't the only platform suffering from the attack of the monkey developers.
led mike
|
|
|
|
|
Wow - you've got more friends than I do, looks like you get a 1, whatever you post.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hehe I haven't seen enough of it yet to guess but I'm suspicious of any number of the Soapbox wack jobs we have in there. But the more obvious conclusion is that it's my charming teddy bear personality.
led mike
|
|
|
|
|
How about a little more fishing and a little less yakkin over there
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
LMAO thanks for that early morning humor! Here's some more [^]if you want a laugh
led mike
|
|
|
|
|
|
WTF Dude? Look at this thread, I have no one votes any more, how can that happen?
led mike
|
|
|
|
|
unix_master01 wrote: So does anybody know the bare minimum PPP protocol implementatation, bare minimum just to send and receive. In C?
I suspect it involves more literacy than you seem to be bringing to the equation.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
how to get message from other window such as OnMessage in Mfc
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
In a form? If so, maybe override WndProc().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
in Mfc
<br />
#define WM_MESSAGE WM_USER+1000<br />
ON_MESSAGE(WM_MESSAGE,Function)<br />
but i don't know how to create in vc.net
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
As Mark said, override WndProc() to react on specific messages. Here is a C# example:
protected override void WndProc(ref Message m) {
if (m.Msg==LPWIN_Constants.WM_HOTKEY) {
int lParam=(int)m.LParam;
if (lParam==0x00580003) Activate();
if (lParam==0x00410008) ArchiveWindow();
}
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
|
Using Events is also another option for notifying another window.
|
|
|
|
|
Hello, everyone. I am designing an application that is intended for use with a touch-screen monitor, so all of the GUI elements need to be big, friendly, and easy to poke.
I would like to provide context-sensitive help for various controls on the main form, and thought that I might just watch for the WM_HELP message that is sent whenever a control is clicked on when in "What's This?" mode, entered by clicking the "?" help button on the title bar. That bit works fine, but I am running into an unexpected problem.
Since the "?" button is much too small for my touch-screen requirements, I thought that I would include a larger help button elsewhere on the form that would accomplish the same thing. I have been totally unable to find any way to programmatically trigger "What's This?" mode, though. The "?" button doesn't even seem to send a message to WndProc() when it is clicked. Does anyone know what occurs when this button is clicked, and how to accomplish the same thing programmatically?
If not, does anyone have any suggestions for providing context-sensitive help that doesn't require something silly, like putting a check in the form of if(helpMode) { ShowHelpMessage(this); return; } at the start of the click event for every single control?
Thanks very much!
|
|
|
|
|
Oddball wrote: and thought that I might just watch for the WM_HELP message
I don't know but I would not think that at all. If I needed to know I would start here[^].
led mike
|
|
|
|
|
Mike,
Thank you for the suggestion, but you really did not address my question. As I stated, I am recognizing when a user clicks on a control when in "What's This?" mode with no problems. Everything works great if the user can click the help ("?") button in the title bar and then on another control. Since my requirements are that a touchscreen be used for the interface, however, I need to create a larger button that operates like the titlebar help button.
I am unable to enter "What's This?" mode programmatically. That is what I was asking about. I've searched all over, including in reference books, with no results, and thought that I'd seek expert experience as a last resort. Respectfully, directing me to Google with a search phrase that general is insulting.
|
|
|
|
|
Oddball wrote: directing me to Google with a search phrase that general is insulting.
Yes it is, to me since I obviously did not read your post thoroughly. I apologize for that but I was not trying to insult you.
led mike
|
|
|
|
|
Ok, I read your OP again and this several times. Since you are on a touch screen you wan the user to click once on your button and then a second time on the control to kick off Context Sensitive Help yes? If that's correct then I don't know if this will help you but the '?' button sends a WM_SYSCOMMAND message.[^]
led mike
|
|
|
|