|
An easy way would be subclass the edit box and handle the WM_CHAR message. And do the exception handling there.
This way you can get individual characters as you type them and you will also be able to decide whether to process them or not.
You will get lot's of samples from Code project
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi,
I have a list of objects which are all releated in some kind of way with each other.
But now i need to prevent cyclic references in my links.
Just like Excel prevent this when a formula got a cyclic reference.
Is there a sort of algoritm that can be used for this check or what would be the best
way to implement this.
If you need more specific information just let me know.
Merry XMas too all,
BadKarma
codito ergo sum
|
|
|
|
|
Keep checking for cycles. I had a similar problem. I solved it by setting flags on each list node.
I have another method, lol can't say how useful it could be for you.
I tried with a slow and fast traverser.
Fast traverses the list like ->next()->next()
Slow traverses the list like ->next()
If fast comes around and catches up with slow then there is a cycle.
This helped me a lot.
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi,
I am getting the text data "12345" and i want to convert it into long data type 12345. Is there any API which do this?
Thanks
|
|
|
|
|
|
It would not give same 12345 number. I am not looking for long value of text "12345". I am looking for same number which text contain!!
|
|
|
|
|
I have checked atol
it works fine i think it satisfies ur demand
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
kidding?
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
|
|
|
Hello!
I am making MFC application which is divided into many DLL.
I am using STL and having problems with "access violation".
Should I use <afxtempl.h> instead, or is there anyway to fix that STL error? Your comments would be appriciated.
Sovann
|
|
|
|
|
Hello,
I think that the problem is not with STL or that the collections that the MFC provides will solve the problem.
What exactly is your problem?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Well, when all in one EXE, everything works just fine. Until we break into many DLL and pass/save pointer back/forth, we come to this "access violation". Most of the crash, we have invalid pointer such as 0xfeeefeee or 0xcccdcccd.
Sovann
|
|
|
|
|
Hello,
I don't know the exact meaning of those addresses, but they have something to do with uninitialized or already deleted pointers.
The rule of thumb is that you do not spread your memory management across different modules, that is, you should not allocate a block in your DLL A and free it in another module. Your problem might be here. Maybe you should make a copy of a memory block when it's saved across module boundraries.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thank you for your comments. I would reconsider the memory management.
Sovann.
|
|
|
|
|
|
Thank you very much for your comments.
I have read them all. My problem was direct access to STL object in other module. Now I am working on it.
Thanks again. Have a nice day!
|
|
|
|
|
Hi all. I m using sockets to send file or strings in a TCP/IP simple client/server configuration. The question is, how do i let the sender differentiate b/w sending files and strings? I've read that people send ACK as a ascii character to acknowledge packets. Can i use this as a method to let the receiver know its receiving a file instead?
Pls help me!
|
|
|
|
|
You can use any kind of mutually agreed technique. So that both the client and server understand what happening.
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
i Dont remember any specific method IN TCP/IP for file or string
u can use a series of NULL char . Using the ACK might create
ambiguity in some case.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
ok thanks. I'll try out these methods. Btw, does anyone know of any good Winsock programs on this area? Cos i could only find tutorials on simple string sending but not on both.
|
|
|
|
|
Assuming that the files you are sending back and forth could contain arbitrary data, you can't use a simple marker character to signal a switch between sending strings and files.
A better approach is to define a message format that tells the receiver what type of data is coming. Here's an example:
struct Message {
enum {
String,
File
} Type;
unsigned int Length;
unsigned char Data[1];
}; The first value, Type , tells the receiver what kind of data is coming. The Length value specifies the amount of data to expect. The third value, Data , is actually just a placeholder for the actual data, which will be Length bytes long.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
This sounds pretty hard to understand for me as i m new to sockets programming and also c++. Have only previously handled some simple programming in c. Could u pls provide me with more details or example?
Thanks for providing me with something anyway.
|
|
|
|
|
The way this works is that everything that is sent on the socket is a message. The sender will send a type, a length value, and the number of data bytes specified by the length. The receiver does the corresponding. It reads the type value, then the length, and then reads the number of data bytes specified by the length. Using this approach, you always know what type of data is being sent by the other end of the connection, and how big it is.
I would suggest making two simple test programs, a client program and a server program. You can run both of them at the same time on the same machine using IP address 127.0.0.1. You can then debug both of them simultaneously.
You might try looking at the articles in the Internet & Network Programming[^] section of Code Project. There are a number of good examples of this kind of approach.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|