Dear All, I am looking for a way to monitor network traffic, such as total number of bytes have been upload / download. Could anybody give me some clues of doing this? Either using SDK (C++) or .NET Class (C#) would be nice. Many Appreciates! Best regards, Chris G.
Chris Gao
Posts
-
Monitor Network Traffic -
Monitor Network TrafficDear All, I am looking for a way to monitor network traffic, such as total number of bytes have been upload / download. Could anybody give me some clues of doing this? Either using SDK (C++) or .NET Class (C#) would be nice. Many Appreciates! Best regards, Chris G.
-
how to get a image in a .bmp file onto a Dialog in the program?Hi ewighell, There are some steps of doing this: [1] Load the bmp in mem. Your can use CBitmap::Load to do this. the CBitmap class can give you a handle (HBITMAP) to this bitmap. [2] Create a dc by using CDC::CreateCompatibleDC; select the bmp handle into this dc (CDC::SelectObject). [3] Override the dialog's OnPaint function. use CDC::Bitblt or CDC::StretchBlt to render the bmp on to dialog surface. Regards, Chris
-
Keeping a System "alive"Oooooooops~~ "this is in a hospital Emergency Room" ??! have you thought about that your application may fail for whatever reason? Then, who will response for that if it happens? If I were you, I would like to write a formal report to your boss to talk about this issue instead of taking some technical way to hide it. What do you think about it? Regards, Chris
-
Outputs in bold form...Em... I tried this approach. It works! I learn a new skill from you. Thank you, Steve. Thanks to the person who post this question too. Regards, Chris
-
new to dlls!Hi Mike, Well, I have no idea about the dll thing. Since you talked about something related to soundcard, have you tried "The Synthesis ToolKit in C++ (STK)" library before? You can download it from: http://ccrma.stanford.edu/software/stk/[^] I don't know whether it fit your application, but for mine, it just perfect. Regards, Chris
-
Dialog box errorHi RalfPeter, I guess your dialog class is derived from CDialog. Is that right? If you create a mfc dialog application, use default settings and just go 'finish' to create the code, you may find the following piece of codes in your ...Dlg.cpp file:
CtestmfcDlg::CtestmfcDlg(CWnd* pParent /*=NULL*/) : CDialog(CtestmfcDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); }
Here you can see that the CDialog class actually need two or one parameter to initialize. You need to do this in your code as well. The IDD is a id to a dialog resource. you can create a new dialog resource by using 'add' option in the drop down menu of the resource explorer window. Regards, Chris -
File I/OHi Kuroro, How about fscanf ? Regards, Chris
-
Global Variable QuestionHi Jeremy, I am new to programming too. I think it is really cool to code something in MS Office. I mean that. Well, I think neither of my suggestions work in your case. Em... is your variable accessed very frequently? I mean, how about use registry table to story this variable? The following example really do very well in registry access stuff. http://www.codeproject.com/system/CRegistry.asp[^] Regards, Chris
-
Global Variable QuestionHi Jeremy, I didn't catch your question very well. If u r talking about two dlls that are called by one executable module, which means that they are running in the same process, I would like you try to declare a variable in the exe file, pass a pointer to it to both dlls and reference this variable to share info. If they are running in different processes, I would suggest you use some ipc apporach, for example Create/OpenFileMapping thing. Regards, Chris
-
How do I know if an OK event came from mouse or Enter?Oops, I didn't see other replys just now. Obviously, my suggestion is the worst one. hehe, ignor it. Regards, Chris
-
How do I know if an OK event came from mouse or Enter?Hi Ilan, Well, my suggestion is that you declare two time stamps and use them to keep the latest time of left mouse click and Enter key click. In OnOk functions, you may compare the current time with both time stamps and this may give you some idea about which is the source of the action. regards, chris
-
CreateProcess MethodHi Steve, I even didn't think about this at all! Thanks!! Chris
-
Turn Off monitor??????Well, look at this person's article. http://www.codeproject.com/system/display_states.asp#xx1310381xx[Turn off monitor] I tried before, it works. However, if you move your mouse, the monitor will be turned on by os. I didn't try to solve this problem. If you know the solution, please let me know. Thanks. Best regards, Chris.
-
Any Suggestions on Memory Leak Detection Tools?Hi Naveen, I downloaded this software (Rational Purify). It just what I am looking for. Thanks! Best regards, Chris
-
CreateProcess MethodHi Subramaniam, I don't know what's wrong with your code but I did it like this:
STARTUPINFO si; PROCESS_INFORMATION pi; // Start the child process. CreateProcess( NULL, // No module name (use command line). TEXT("C:\\Windows\\system32\\notepad.exe"), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ); // Pointer to PROCESS_INFORMATION structure.
It works on my computer. Best regards, Chris -
how to create a virtual serial port, and to monitor itHi Szilard, Well, i don't know how to do it by myself, however, maybe these websites can help a bit: http://www.lvr.com/serport.htm[^] http://www.eltima.com/products/virtual_drivers/[^] Best regards, Chris
-
Any Suggestions on Memory Leak Detection Tools?Hi Steve, Thanks! I downloaded debug-tools-for-windows (dbg_x86_6.6.03.5.exe) from ms$. Emm... umdh.exe looks like a very powerful tool. I don't really make too much sense of it yet. ..... still need sometime to learn. Thank you! Best regards, Chris
-
Any Suggestions on Memory Leak Detection Tools?Hi Joe, Thank you! I have downloaded a trial and using it at the moment. It seems like put a lot stuff in the compiled code. Em... haven't make too much sense yet. trying... trying... trying... Best regards, Chris
-
Any Suggestions on Memory Leak Detection Tools?Hi Nemanja, Yes, I aggree with you! I used this (Visual Leak Detector) before, and it works just well. However, my boss prefer a memproof like application. Em.... Anyway, appreciate you help ! Best regards, Chris.