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
J

JoeZhang

@JoeZhang
About
Posts
22
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem about screen-saver program...
    J JoeZhang

    Hello, buddies, My program is a Win32 screen-saver program(ie, .SCR file), during its running process, it will launch another Win32 program to do certain things, and after this screen-saver program exits, that Win32 program may pop up a window for showing some information to the user. Here's my problem: on the WinNT-based platform (WinNT/2K/XP), when the screen-saver is set to be password protected (ie, the user needs to input the password to login the system after the screen-saver exits), the Win32 program which launched by the screen-saver is immediately terminated also when the screen-saver exits, so that Win32 program doesn't have the opportunity to show the information dialog. It's seem that That Win32 program is terminated by the system when the screen-saver ends, and this's maybe relate to something like "desktop switch", because the password-protected screen-saver is running on the so-called "screen-saver" desktop, and the other program launched by the screen-saver is also running on this desktop, the screen-saver ends, the "screen-saver" desktop disappears, so the other program dies as well... The above is my opinion for this problem, so I tried to do somethings like switch the desktop in the screen-saver and the other program, but failed, that problem still exists. So, does anyone can tell me: How to let the another program still run after the password-protected screen-saver ends? Thanks!

    C / C++ / MFC help tutorial question

  • HELP! Winsock problem about the select function...
    J JoeZhang

    hi, guys, In my current Winsock-based TCP program, on the client side, after I send my request data packet to the Server side using the send socket function, I attempt to get the socket status to see if it has something to read using the select function, and the select function always return 0 meaning the time limit expired on some users' computers, but it's just fine on another users' computers. Why? Does anybody can tell me why and how to fix it? Thanks! here's the code... //... SOCKET sckClient = socket(AF_INET, SOCK_STREAM, 0); int nOne = 1; setsockopt(sckClient, IPPROTO_TCP, TCP_NODELAY, (char *)&nOne, sizeof(int)); // just_say_no struct sockaddr_in addr_to = { 0 }; //... connect(sckClient, (struct sockaddr *)&addr_to, sizeof(addr_to)); char *buf; //... send(sckClient, (const char *)((char*)buf), nDataToSend, 0); int nRetCode = ::select((int)sckClient + 1, &fdsRead, NULL, NULL, &tvTimeOut); if (nRetCode==0 ) { //ERROR: the time limit expired //Here's the problem! some computers meet the error, but some don't! WHY??? } recv(sckClient,(char *)buf,nDataToRead, 0); //...

    C / C++ / MFC help sysadmin tutorial question

  • Capture input of the CommandWindow
    J JoeZhang

    Make the output text of that console app into a disk file instead of printing to the command window, and then read the contents of the file into a memory buffer and parse that buffer for your needs... But how to do this in your program? here's a solution: Dynamically generate a .BAT batch file in your program, the contents of this batch file is like this: consoleApp.exe >> c:\output.txt Here, consoleApp.exe is the filename of that console app you want to capture its output, and then launch this batch file via CreateProcess win32 API. After the end of console app, what its outputs are placed into the output.txt file... Hope this helps.:laugh:

    C / C++ / MFC tutorial question

  • How to deal with multi-IP on TCP/IP programming mode?
    J JoeZhang

    cmk wrote: ...This allows you to listen on all local address... Well, if you just "listen" and not "send" data,or the local host has ONLY one IP address, it would be fine. But by this way, if the local host has more than one IP address and you want to send data to the other host, it may not work sometimes, why? because "the underlying service provider" sometimes would automatically bind an "exist-but-not-connect" IP (though a host have several IP addresses, maybe only one or some connectable and others don't), and, of course, you cannot send data outside successfully via it... and this is approved in my current application :) What I mean "proper one" is: you cannot alway hope that the ADDR_ANY would do the right thing for you, you must find out the working and connectable IP address, and then bind your socket to it. :sigh: Thank you!

    C / C++ / MFC sysadmin json help tutorial question

  • How to Comine two numbers, not addition.
    J JoeZhang

    and, you can also... attach a int variable with your edit box 3, and then make it equal to c, and then call UpdateData(FALSE) to make it show in edit box 3...

    C / C++ / MFC tutorial c++ help learning

  • How to Comine two numbers, not addition.
    J JoeZhang

    oh, god...:) just attach a CString class variable with your edit box 3, and then make it equal to "szC", and then call UpdateData(FALSE) to make it show in edit box 3... ;P

    C / C++ / MFC tutorial c++ help learning

  • How to Comine two numbers, not addition.
    J JoeZhang

    How "it doesn't work for you"? what error occurred? szA,szB,szC just are temporary char string variables.

    C / C++ / MFC tutorial c++ help learning

  • How to Comine two numbers, not addition.
    J JoeZhang

    hey, guy, try this... :) ... char szA[100], szB[100], szC[200]; int c; printf(szA,"%d",a); //here, a is a int number entered on edit box 1. printf(szB,"%d",b); //here, b is a int number entered on edit box 2. strcpy(szC,szA); strcat(szC,szB); c = atoi(szC); //here, c is the int number you want, just place it into edit box 3 ... hope this helps! ;)

    C / C++ / MFC tutorial c++ help learning

  • How to deal with multi-IP on TCP/IP programming mode?
    J JoeZhang

    Hi… there, I wonder how you guys deal with the case of more than one available IP address (multi-IP) on the local host on the TCP/IP programming mode. I'm talking about the "multi-IP" here, it's usually the system which installed with more than one network adapter (physical or virtual), i.e., more than one available IP address… In the case, when you call the socket API "bind" to bind your socket with the local host, you must choose the proper IP address from the multiple IP addresses, otherwise, your socket possibly cannot work. So, my problem is: how do you know which IP address is available on that LAN? The current solution I'm using is: Present a dialog with a list control, and all the available local IP addresses listed on the list control, then ask the user select the proper one that my program would use... :) Does anyone here can tell another better solution to this problem? i.e., how does my program automatically detect all the IP addresses, then automatically pick up the proper one, instead of asking the user for this? Thanks!

    C / C++ / MFC sysadmin json help tutorial question

  • The synchronization issue on sending and receiving data via UDP Multicast...
    J JoeZhang

    Well, big thanks to Roger and Johnny... :) Now, I'm searching something useful on SourceForge.net...

    C / C++ / MFC help sysadmin debugging json performance

  • The synchronization issue on sending and receiving data via UDP Multicast...
    J JoeZhang

    Hi, there... I’m now getting a problem: In my current Winsock2-based application, I need to deliver lots of data from the Server side to more Client sides via the UDP multicast mode. However, one or more Client sides cannot receive some data blocks sometimes After a hard debug process, I found the program is: the Server multicasts the data too fast, and the Client cannot receive all the sent blocks of data in time, i.e., the process speed of Client is more slower than the Server, some block of data is overcastted by the next block before the Client gets it At this time, to avoid this, I delay some time using the Sleep API after each block of data sent on the Server side. Though that’s not a best way, it works. But another program brings out – It’s hard to know how long I exactly delay: if the delay is too long, the more unnecessary time used to deliver; if it’s too short, some Clients may still lost some blocks of – It’s just hard to control the delay time after each block of data sent  Does anyone can tell me another better way to synchronize the speed of sending and receiving data on both Server side and Client sides? Thanks!

    C / C++ / MFC help sysadmin debugging json performance

  • active screensaver Programmatically
    J JoeZhang

    Does anyone can tell me how to active the screensaver programmatically on MS Windows platform?

    C / C++ / MFC tutorial question

  • Show my dialog outside the Win2k "locked" screen...
    J JoeZhang

    thanks! So, how can I do that?

    C / C++ / MFC career help tutorial question

  • Show my dialog outside the Win2k "locked" screen...
    J JoeZhang

    Hey,all... My current Win32 application would do some background job while Windows enters the "screensaver" status, and it would shows a top-most dialog outside the screensaver's screen for displaying the working status and progress. But now I encounter a problem: while the option "On resume, password protect" is set on the screensaver setting dialog in Win2K/XP, the dialog box on my application cannot be showed outside the screensaver screen, but if this option is not set, it do. Does anyone can tell me how to solve this problem? Thanks!

    C / C++ / MFC career help tutorial question

  • Visual Studio Installer
    J JoeZhang

    Ask the user manually install this packet before launch your installer:-O

    C / C++ / MFC csharp visual-studio tutorial question

  • My own Version
    J JoeZhang
    1. Using the GetFileVersionInfo Win32 API, refer to MSDN for usage; -OR- 2) Add a export function,say GetVersionNember,into your DLL for query its version number by its customer(client),the following is a simple example, //... const WORD LOW_VER_NUM = 0; const WORD HIGH_VER_NUM = 1; //... DWORD GetVersionNumber() { return MAKELONG(LOW_VER_NUM,HIGH_VER_NUM); } Hope this helps!;P
    C / C++ / MFC html database com business question

  • Visual Studio Installer
    J JoeZhang

    The executable file cannot execute itself until the user,the system or the other program launchs it! By the way,what's your installer for? why you dont want to add the line of code?

    C / C++ / MFC csharp visual-studio tutorial question

  • Checking a Language !
    J JoeZhang

    The GetSystemDefaultLangID Win32 API meets your need, please go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4ppg.asp for more details.

    C / C++ / MFC game-dev question html database com

  • Video in a Window using Visual c++
    J JoeZhang

    Just using Windows Media SDK, go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/wmsdk.asp for more information. Hope this helps!

    C / C++ / MFC c++ graphics question

  • Visual Studio Installer
    J JoeZhang

    Normally, each a software packet has a file,named setup.exe or install.exe,that executes the task of install this software to user's harddisk. Just launch this executable file during your install program via the CreateProcess Win32 API, for more information and usage about CreateProcess,please click http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp

    C / C++ / MFC csharp visual-studio tutorial question
  • Login

  • Don't have an account? Register

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