Can you see whats wrong?
Those if statements because Im little new to directx and my direct input engine kinda sucks specaily since i wrote it a year ago when i first started with Directx I think im gonna re write it then re write the hole chat program and start fresh.
from your code, it's seems like only one letter is going to be in m_chat_msg at any given time. since the if statements are not in a loop of any sort i don't see how you expect a string to form.
maybe more of the code and how you have your arrays initialized would be helpful.
maybe more of the code and how you have your arrays initialized would be helpful.
Change:
Msg.ChatMsg[128] = m_Chat_Msg[128];
To:
strcpy (Msg.ChatMsg, m_Chat_Msg);
Also where is m_Chat_Msg declared?
If it's LOCAL to the function running this code segemnt, then m_Chat_Msg goes OUT OF SCOPE when you exit out of the function.
Try making m_Chat_Msg GLOBAL or declare it local to you MAIN function.
That should do it. Try it and let us know.
Msg.ChatMsg[128] = m_Chat_Msg[128];
To:
strcpy (Msg.ChatMsg, m_Chat_Msg);
Also where is m_Chat_Msg declared?
If it's LOCAL to the function running this code segemnt, then m_Chat_Msg goes OUT OF SCOPE when you exit out of the function.
Try making m_Chat_Msg GLOBAL or declare it local to you MAIN function.
That should do it. Try it and let us know.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement