|
in a C++ point of view, even if it is an "event", you put the code that will be executed when the event raises inside a function, don't you ?
so, even if the event handler (yeah, the function) has a void returning type, you can type where you want to exit the code line below :
return;
you say to the compiler to give the hand to the procedure that called this handler, without returning value... isn't it what you want ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
salaikumar wrote: But when i use the same function in parent form, it closes the application...
Which is exactly what exit() is supposed to do (i.e., it terminates the calling process). The return statement, on the other hand, terminates execution of the function in which it appears and returns control (and the value of expression if given) to the calling function. See the difference?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
sample source below.
// begin
CFile file = NULL;
CString fname=_T("C:\\Documents and Settings\\master\\官帕 拳搁\\1.txt");
int n= file.Open(fname, CFile::modeRead|CFile::typeBinary);
// n = 0 <-- can't open
how can i open file that include unicode files name?
|
|
|
|
|
msj0191@gmail.com wrote: // begin
CFile file = NULL;
CString fname=_T("C:\\Documents and Settings\\master\\官帕 拳搁\\1.txt");
int n= file.Open(fname, CFile::modeRead|CFile::typeBinary);
// n = 0 <-- can't open
Write this line of code above the this SourceCode
#ifndef UNICODE
#define UNICODE 1
#endif
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Use: CFile file; // = NULL
"dire io è lento, dire noi è rock"
rechi+
|
|
|
|
|
also same result. my problem thining is filename that middle of chinese font.
so that must be support to unicode.
|
|
|
|
|
Try calling Open with a third CFileException parameter, and then check its the attributes to find out what went wrong.
"dire io è lento, dire noi è rock"
rechi+
|
|
|
|
|
Dear All
1. I want to read stream of character from the serial port and display the read characters into a text box. What is the data type of the parameter 2 of the ReadFile and what should be the NumberofBytesRead(to read variable number of characters dynamically)
ReadFile(HANDLE hPort,(????) &ReceiveBuffer, NumberofBytesRead, &iBytesRead, NULL);
2. And tell me about asynchronous and Synchronous method of reading the port.
Thanks in advance
|
|
|
|
|
Hello.
There are a lot of issues to deal with when doing serial communication. I suggest you to use one of the Serial I/O-classes from CP.
Just search for "serial" in the articles search box.
|
|
|
|
|
Can anyone offer any advice on how to enable or disable a network connection programmatically? I've been spinning my wheels on this for a couple of days. I've tried creating a shortcut to the Connection Status window and open it with ShellExecute using the default verb but the dialog does not appear. However, if I doubleclick the lnk file the dialog opens as expected.
Any suggestions would be greatly apprieciated.
Walter J. Boncal
|
|
|
|
|
|
Hi everyone,
I had designed a dialog box which is a "Find dialog"(what we generally see when we press "ctrl+f")..
Now in my application when i enter any " name" or "value" in the 'find dialog box',the focus should shift to that particular
place(name/value)..All the "name" & "values" are stored in the 'STL list'..I have to search those values/names and find out
whether the matching was found or not for the entered name/value in the 'find dialog'..
But the program is not responding properly..when i debug,the error shown is "Object Reference not set to an instance of an
object" for the "for loop" implemented..
for(iterator = member.begin(); iterator != member.end();iterator++)
Plz Help Me..
Thanks!!
|
|
|
|
|
But the program is not responding properly..
Please add more deatils to your question. Is it too slow and the dialog hangs during the search?
Could you possibly change the list to a set that would be much better suited for searching? Or is the original order of the list important?
John
|
|
|
|
|
I can't change the list to a set..The original order of STL List is important..I should use it...
Its not slow/ something like that..It doesn't proceed further..It shows a "Abort,Retry,Ignore" message & asks me whether to send it to microsoft / not..
When i debug this..it shows a message which i already stated..
Can u help me further??
Thanks..
|
|
|
|
|
Hello to all of you. Many of you reading this message helped me a lot of times. So you all know I'm pretty much a beginner in C++. However, I try to do my best to help everybody with what I know. Some time a go I promised I'll make an article about linking C++ with VB, inter process communication kind of thing, even though this time it's about a DLL and an Application, it still applies to the category.
So, without further delay, I invite you all to take a look at my article, I hope you'll find one or two interesting things there. Thank you all again for being here helping people like myself.
http://www.thecodeproject.com/threads/InterProcessCommunication.asp[^]
In less than 2 months I'll also release the first public beta for the freeware application I've been working on. Many of you helped me at it and you'll all find yourselves at the "Thanks to" section, as I am not one that forgets those who helped.
A nice day (or a good night) to y'all.
-= E C H Y S T T A S =-
The Greater Mind Balance
-- modified at 1:08 Tuesday 22nd November, 2005
|
|
|
|
|
there's no need to spam the forum with this... if every new/updates articles authors were behaving like that, forums where not a place for programming questions anymore...
moreover, when you create or update an article, it is reported on the homepage of the site, on the Last 10 updates[^] section...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
It was intended more as a thank you message, nothing more, nothing less.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: It was intended more as a thank you message, nothing more, nothing less
Never Mind! Thanks for that great article
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks Alok. By the way, less than 2 months since I release the beta on the freeware application I'm working on. You're on the "thank you" list ::- >. Don't you dare think I've forgotten your help and answers to my questions ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
toxcct wrote: there's no need to spam the forum with this
It's not a spam. He is just saying thanks.
toxcct wrote: if every new/updates articles authors were behaving like that
Hope no one does that;P
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
off topic but...
"Birthday Tuesday 23rd December, 1902"
aren't you lying a bit about your age ? ;P
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Friggin' *LAUGH* ::- D. Who knows, maybe we got the grandpa of ENIAC here ::- D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: Friggin' *LAUGH* ::- D. Who knows, maybe we got the grandpa of ENIAC here ::- D.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Sorry dude missed a 7.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|