• Advertisement

Aileen

Member
  • Content count

    17
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Aileen

  • Rank
    Member
  1. cannot get this work

    Quote:Original post by Kylotan "If the WSAAsyncSelect function succeeds, the return value is zero. Otherwise, the value SOCKET_ERROR is returned". Your if-statement is therefore backwards. My bad! I got the output "set asynchronous mode fail, error code: 0". This means the WSAAsyncSelect function succeeds. :) Thanks~!
  2. cannot get this work

    I am writing the following code to set the socket to asynchronous mode: "if (!WSAAsyncSelect (ConnectSocket,DXUTGetHWND(),WM_ONSOCKET,(FD_READ | FD_CONNECT | FD_CLOSE))) { Printf( "set asynchronous mode fail, error code: %d", WSAGetLastError() ); } " I think I called the function correctly. But I just couldn't get it work. So I call WSAGetLastError() to see what went wrong. on the description of the function: http://msdn2.microsoft.com/en-us/library/ms741540.aspx It says that I can retrieved the error code by calling WSAGetLastError(). I did it, but the return value is '0', which cannot be found in the error code list. Btw, I have initialized the socket ConnectSocket by "ConnectSocket = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);" Could someone help me pls? Thanks a lot.
  3. msg receive

    I am implementing the network on a 3D platform. Whenever I call the function "recv(ConnectSocket, recvBuffer, recvBufferLen, 0)", the program is just waiting for the msg to be sent over. So the screen cannot be rendered, and the graphics just stop there. Is there a way such that I know there will be a coming msg, then only I call the recv function? And I want to send the msg with font and size, what can I do? Thanks :)
  4. msg receive

    I am implementing the network on a 3D platform. Whenever I call the function "recv(ConnectSocket, recvBuffer, recvBufferLen, 0)", the program is just waiting for the msg to be sent over. So the screen cannot be rendered, and the graphics just stop there. Is there a way such that I know there will be a coming msg, then only I call the recv function? Thanks :)
  5. what went wrong?

    Quote:Original post by erissian Quote:Original post by Aileen But the error "include 'stdafx.h' before including this file for PCH" is still there, because of the followind code. "#ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif". can I just comment all these stuff? You could, but it would be better to change stdafx.h in this manner: *** Source Snippet Removed *** I copied the content in "stdafx.h" into "dxstdafx.h", so that I can only include "dxstdafx.h" instead of including both. Then most of the errors are gone. But because I am adding network into original project, I need to add one more resource file. After I added the "chatter.rc" to the resource file in solution explorer, I compiled and got the following error: " fatal error CVT1100: duplicate resource. type:ICON, name:1, language:0x0409 fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt" I searched from the web, it says that the VC++ cannot compile two resource files. What can I do? Does it help if I combine the two resource files?
  6. what went wrong?

    Quote:Original post by Emmanuel Deloget Can you post us the content of both files (enclosed in [source lang="cpp"][/source] tags)? For me it seems that either one is necessary, not both. However, maybe the purpose of dxstdafx.h is to be included in stdafx.h. I haven't played with the DX samples lately, so I can't be sure. Regards, What do you mean by "(enclosed in ...)"? sorry, I coudn't understand. But in "stdafx.h", there are only a few lines: " #define VC_EXTRALEAN #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #include <afxsock.h> // MFC socket extensions " However, in "dxstdafx.h", there are lots of stuff, but dun have the above lines. Both "stdafx.cpp" and "dxstdafx.cpp" are just including "stdafx.h" and "dxstdafx.cpp" respectively. [Edited by - Aileen on January 19, 2007 7:34:07 AM]
  7. what went wrong?

    Quote:Original post by erissian It's been ages since I did work in Windows, but I remember that stdafx.h is a standard name for PCH. The contents vary from project to project. Sometimes projects expect you to include certain headers, but are finicky about the order you list them in. There shouldn't be anything special about dxstdafx.h. I'm sure it just shows you what's needed in stdafx.h to make DirectX more convenient. Try including stdafx.h before dxstdafx.h. How was the project configured before you made changes? I tried including "stdafx.h" in front of the "dxstdafx.h", the previous errors and warnings are gone. :) But the error "include 'stdafx.h' before including this file for PCH" is still there, because of the followind code. "#ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif". can I just comment all these stuff?
  8. what went wrong?

    I am implementing a network for a sample program. Once if I included "stdafx.h" to the sample program, there would be a lot of errors/warnings coming out. The followings are a few examples of the errors. warning C4005: '_ftcscat' : macro redefinition warning C4995: 'lstrcpyW' : name was marked as #pragma deprecated error CS2011 : 'sockaddr' : 'struct' type redefinition I think it may be because of the "dxstdafx.h" included in the sample program already. There may be some repetitions. So I tried not including "stdafx.h", however, in the sample program, there is: "#ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif". The program cannot find the defination of __AFXWIN_H__, and another error of "include 'stdafx.h' before including this file for PCH" appears. I was trying to find the definition of __AFXWIN_H__ in the "stdafx.h" and include it in "dxstdafx.h", however, I couldn't find a single related code. Could someone help me, please? Thanks a lot!
  9. what to do next?

    I think I will go for the easier way, due to the fact that I almost know nothing about the network, protocol, etc. so now what I need to do first is to create my own protocol, rite?
  10. what to do next?

    thanks a lot for all of your valuable suggestions. I really appreciate them. I am using C++. Your guess is correct, lonewolff. ^_^
  11. what to do next?

    I have written a simple program which is to create a MSN window interface. One can input using different fonts, colors and sizes. All input can be displayed on the screen. I wanna create a network for it, so that it really works as MSN. could anyone enlighten me what direction I should go and what to do next? Thanks a lot!
  12. Caret placing

    How is caret placed in a input EditBox? I am studying one sample program CustomUI in DirectX9.0. I dun no how caret is placed at character position nCP in function CDXUTEditBox::PlaceCaret( int nCP ). The function got ultimently call function _ScriptStringCPtoX( m_Analysis, nCP, bTrail, pX ). But the pX, which stores the x coordinate of nCP is just a local variable. How can Caret be moved in the end? Can anyone help me? I am really lost. Thanks a lot!
  13. error

    Thanks for all replies, I have found the error, which is exactly like what Zeraan said. :)
  14. error

    "Unhandled exception at 0x004cdfc2 in CustomUI.exe: 0xC0000005: Access violation reading location 0x00000277." When I run my program, i had the above error appeared. what does this mean? why cannot read the location? Thanks very much!:)
  15. memory collapse?

    Thanks a lot! It works!
  • Advertisement