|
tom groezer wrote: Will usage of tchar solve the problem?
But you will have to replace those functions with equivalent _tcs functions. If you want to completely move to UNICODE and no looking back, you can choose wchar_t and the corresponding wcs functions.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Application uses multibyte character set but the symbol _UNICODE is not defined. Nit sure if the LOCALE Japanese can make the application to run in Unicode format?
|
|
|
|
|
tom groezer wrote: Application uses multibyte character set but the symbol _UNICODE is not defined
You mean "And"?
When you declare, MBCS, you should not use UNICODE. And Japanese letter would work with UNICODE. Remove MBCS if you had defined in your settings. and add UNICODE,_UNICODE.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Sorry to not make you understand. The project uses MBCS settings. It can't be set to unicode settings.
I was thinking if this app is made to run on a japanese m/c is there a way that locale settings could turn the application to be unicode aware.Is that is the case, since my application code used char array and strcpy function would it make it compulsory to change the application code to use -tcscpy and tchar array. This application code works perfectly on a my system.
|
|
|
|
|
tom groezer wrote: Sorry to not make you understand. The project uses MBCS settings. It can't be set to unicode settings.
Then use the character mapping routines in tchar.h. It'll handle MBCS, Unicode, or ANSI. Just learn the equivalent string functions for it.
tom groezer wrote: This application code works perfectly on a my system.
Probably because your system isn't a Japanese one. Just use the character mapping routines in tchar.h and you'll be ok.
|
|
|
|
|
Hi to All,
First of all thanks to all for replies to my previous post.
I am going to do an simple chat application on a network(LAN).Using MFC.I wanted an advice whether to do it as dialog based, SDI or MDI? The application should be more or less the same as GTalk
Please advice for both client and server.
Thanks in Advance
I am a beginner
|
|
|
|
|
I will start with dialog based application... with some pretty custom drawings...
- ns ami -
|
|
|
|
|
thanks for your reply,
But what about the server? can that be also dialog based, since there will be many clients. So i was wondering if it has to be an console based application.
I am a beginner
|
|
|
|
|
Sorry. I am not much experienced in socket programing.
But if you are going to create a gtalk like application peer to peer model is enough.
- ns ami -
|
|
|
|
|
You could make your server a service.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Answered to me?
- ns ami -
|
|
|
|
|
thanks for your reply ns ami,
And sorry that was for code-o-mate.
anyway,do you mean "cleint-client" by "peer to peer"
I am a beginner
|
|
|
|
|
himangshuS wrote: anyway,do you mean "cleint-client" by "peer to peer"
I am not sure about the terminology. But AFAIK, in peer to peer, server and client will be in the same application. Each application will keep a list of its contacts and at the starting of application it can broadcast or send some messages to each contacts. So that others can know that you are logged in.
This is only my fair concepts...
- ns ami -
|
|
|
|
|
here is one more doubt of me.
How can we broadcast a message actually using MFC socket programing. Is it a for loop and send to each one. Or any syntax is there to broadcast a message to all in a network or may be a set of IP address.
I am a beginner
|
|
|
|
|
That is something with Datagram Sockets...
- ns ami -
|
|
|
|
|
Whoups, sorry, of course i wanted to answer himangshuS, didn't notice i "mis-clicked".
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Code-o-mat wrote: sorry
No problem... It was just to inform you...
- ns ami -
|
|
|
|
|
Oh ya, that sounds pretty interesting and realistic.
But I was thinking that...why do i need a server,can i communicate directly(client to client)?
May the server can give a list of information with IP address and username,thats it. Then the clients can talk to each other directly(not through the server). Is that possible?
regards,
HImangshu S
I am a beginner
|
|
|
|
|
Yes, that is possible.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
fine, so i guess i can go ahead a simple client-client design with a limited server application which will send to the client for the IP-username mapping.
But, here again i need to maintain some table structure. I am new to MFC. can I use ms access here?
I am a beginner
|
|
|
|
|
I think you can but i have never worked with access so i can't help you with it.
Plan your chat-protocol carefully, remember that your clients will probably need to be notified of certain events like someone going offline or coming online...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
oh ya that could be also one more problem. I haven't thought about it only.
But I guess we can broadcast a special message(going offline) to all. Instead of events notifications.
Am I correct?
I am a beginner
|
|
|
|
|
How would you broadcast that?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Let me explain you that one,
1.Do not start with Dialog or Doc/View conversation. First think about implementing your chat/messaging mechanism. I guess you have been coming around MFC sockets. If you ask me, I'm not for it.I did not like to work with it. You can directly use winsock2.
2. Write a simple TCP client server application in console mode. Once you find the application running and you are clear with the idea, make a simple class that takes care of simple functionalities like connecting, sending & accepting messages.
3. First try for single client-server application. When you are comfortable with it you can move to Multi-client application that would involve threading in most cases.
4. Now you are clear with Sending & receiving messages using winsock.
5. For server part, you can ultimately go for windows services implementation, but to start with I do not recommend it. Because as you are a beginner, you will have to trouble shoot a lot of things at first. So just make it a console server. Where you'll be able to view the messages going across.
6. For client, you can have it as Dialog application, but again it's just based on the need. You can even go for SDI if you want to make use of Serialize-Archive functionality of the document. It could be useful when you save down your chat conversation.
7. Did I answer you?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
A sincere thanks for your reply
Got lots idea from you.Specially the steps i should follow. it sounds very professional.
VuNic wrote: You can directly use winsock2.
what is winsock2? is it for MFC? is there any advantage on normal socket functions like listen/bind/createsocket etc (which I have worked on little bit).
I am a beginner
modified on Monday, March 9, 2009 9:34 AM
|
|
|
|