Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
H

hanq_38910130

@hanq_38910130
About
Posts
31
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C++ DLL question
    H hanq_38910130

    What do you mean by "called exactly once"? You wanna prevent from "calling the dll function for a second time", or just make no effect when "calling the dll function for a second time"?

    C / C++ / MFC question csharp c++ help

  • Problem with CreateFileMapping() window7/Vista.
    H hanq_38910130

    What type of program are your code in? normal application or service? A service has the highest permission. If you put your code in a service, there won't be error, i think.

    C / C++ / MFC help tutorial question

  • how to send data to multiple clients from single server mfc or winsock
    H hanq_38910130

    In main thread you listen for client connections. Once you got a client connection, you can create a corresponding socket and thread.Then all the communication can be handled in that thread using that socket. Of course, if there are too many client to deal with, this is not a good way. You can use iocp instead.

    C / C++ / MFC c++ sysadmin tutorial

  • CEGUI related issues
    H hanq_38910130

    Have no idea where you got these codes, just try changing wxchar.h to be like this: #include #include #ifndef wxStrdupA #define wxStrdupA strdup #endif

    C / C++ / MFC help question c++

  • Setup and Deplyment Project : Running external exe
    H hanq_38910130

    I'm not familiar with "setup&deployment" project, but know something about it in "InstallShield". In "InstallShield", there is a place you can setup "support files". These files will be copy to temporary folder when your install program is running. Then you can use script language to execute the command line. If there is a same place in "setup&deployment" project, you can add "devcon.exe" to the "support files", then use script language to run it. Is the above useful for you?

    C / C++ / MFC help csharp c++ visual-studio sysadmin

  • How does this template work
    H hanq_38910130

    There is difference between "global function" and "class member function" only when the latter refers to the object's "this pointer". If not, these two functions are the same. In your situation, the "(*s).func1();" doesn't refer to "this pointer". So it behaves just like a "global function". It doesn't use "this pointer" which is NULL here, hence no error there.

    C / C++ / MFC

  • any idea why my select does not work(visual c++ ?)
    H hanq_38910130

    1. You didn't call "WSAStartup" and "WSACleanup " 2. You didn't set any socket Besides, you should always check the return value for errorcode ;)

    C / C++ / MFC c++ question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    Yes, I agree with your point. I found something on the internet which says it may be: * concerning issues about "video card", like "dualhead cards that use a single chipset" * or some "security risk" after win2k OS But for me, neither seems to be correct :(

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    Anyway, I really appreciate your help. ;P

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    I do believe that it's relevant to multiple monitors, but I just can't ask our users to set up another monitor or another video card, or something like that. I can only make some improvement in our program which I still don't know how to do it. ;P

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    :) Yes, I've tried that, and it's like "\\.\DISPLAY3" which is OK. I still believe that this problem is caused by the implementation of function "CreateDC" under "win2k" OS. ;P I just want to know if there's a workaround out there about this issue. :((

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    ;) The follow is my code fragment: HDC CreateDCFromDriver() { HDC hDC; char lpszDriver[0x20]; if ( FALSE == GetDriverDeviceName(lpszDriver) ) return NULL; hDC = ::CreateDCA(lpszDriver, 0, 0, 0); if ( hDC == NULL ) { MM_TRACE(_T("CreateDCFromDriver: ErrorCode - %08X"), GetLastError()); } return hDC; } I think my code is just OK, cause everything works fine in "xp, vista, win7" OS. It only occur in "win2k", when in "win2k" OS the code will go into "MM_TRACE(_T("CreateDCFromDriver: ErrorCode - %08X"), GetLastError()); ". Meanwhile in other OS, it go into "return hDC;" correctly.

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    Thanks for your reply :) But I think you misunderstood it. It has nothing to do with "Print" or "Printer". It's about "video display driver" :-D

    C / C++ / MFC help question

  • ::CreateDC() returns NULL with errorcode ERROR_INVALID_PRINTER_NAME(1801)
    H hanq_38910130

    Hi guys, I have a "display driver" program which I install it successfully on all kinds of OS. Then I call "::CreateDC()" to create a corresponding device context in another program, it works fine in most OS except in win2K. I mean, "::CreateDC()" succeeds in "XP, Vista, Win7", but fails in "Win2K"(returns NULL and GetLastError() is ERROR_INVALID_PRINTER_NAME(1801)). I googled it and did find some threads, but all are vague. However, I figure it's kinda "win2k OS" issue. I think function implementation of "CreateDC" in "win2k" has imperfection. Does anyone happen to encounter this same problem? Any workaround with it? Any replys are appreciated :-D

    C / C++ / MFC help question

  • buffer problems with CFile
    H hanq_38910130

    I think there is not enough information about your problem in your post, so can you just provide some more information? Like definition of the struct type of "rcd"? Besides, maybe you can try to debug the application to find the reason of your problem:)

    C / C++ / MFC help question

  • constructor and destructor [modified]
    H hanq_38910130

    Actually, I think the design of your class "ThreeD" is terrible. If you are sure to implement it, the follow is for you. class ThreeD { public: ThreeD(int _l=5, int _w=5, int _d=5) : l(_l), w(_w), d(_d) { data = new int**[l]; for (int i=0; i<l; ++i) { data[i] = new int*[w]; for (int j=0; j<w; ++j) { data[i][j] = new int[d]; memset(data[i][j], 0, d*sizeof(int)); } } } ~ThreeD() { for (int i=0; i<l; ++i) { for (int j=0; j<w; ++j) { delete [] (data[i][j]); } delete [] (data[i]); } delete [] data; } private: int*** data; int l, w, d; };

    C / C++ / MFC question

  • How can I implement a schedule reboot prompts using WUAPI? Or some other way?
    H hanq_38910130

    Thanks very much for your help!! I'll check your url:)

    C / C++ / MFC question tutorial announcement

  • How can I implement a schedule reboot prompts using WUAPI? Or some other way?
    H hanq_38910130

    Hi, all there: I was doing some stuff on windows update download&install using wuapi, and this done already. Now I wanna implement a schedule reboot prompts, just like windows os do after auto windows update, which you can select "reboot after XX minites" or "reboot now". Does anyone know how to implement this? Can WUAPI do this? Or some other way? Any replay is appreciated!! above.

    C / C++ / MFC question tutorial announcement

  • (NULL == p) vs (p == NULL)
    H hanq_38910130

    I don't know which compliers you refer to, but when I test it with VS2005(which I am using now), it doesn't give any warning.Of course, here I'm using the default warning level: level 3. When I change it to Level 4, it indeed give a warning:)

    C / C++ / MFC visual-studio help

  • (NULL == p) vs (p == NULL)
    H hanq_38910130

    If you accidentally write "=", but not "==" which you originally want it to be, then in the first case, compiler will tell you this mistake.But in the second case, compiler will not do this. This only prevent you to make mistakes, but I don't think this is necessary:)

    C / C++ / MFC visual-studio help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups