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
G

GameProfessor

@GameProfessor
About
Posts
41
Topics
18
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to emit alarm sound on computer without soundcard
    G GameProfessor

    Thanks, it works very well Also, for anyone who could be interested: we could use a simple function to check if sound card exists and then switch between using Beep() or PlaySound() BOOL m_bIsSoundCardExist = (waveOutGetNumDevs() > 0);

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

  • How to emit alarm sound on computer without soundcard
    G GameProfessor

    hi all, I want to create a module that play a alarm sound such as "bip" on a server whenever connection down. Many computers, esp servers, don't have sound card. However, they have a mono-speaker inside that make it able to emit simple sound (like the "bip" you hear when you start the computer). I'm looking for a command to play similar sound in visual C++ without the need of a sound card. Can anyone help ?

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

  • How to egalise two strings
    G GameProfessor

    use strcpy(st1, st2);

    C / C++ / MFC help tutorial

  • MFC GUI on Windows Server 2003 runs slow like hell
    G GameProfessor

    thanks, I have checked by installing windows server 2003 on my old Celeron computer and found that the problem was not because of the OS (windows 2003 or XP) but because of changing hardware platform. I shall checked my implementation as your suggestion, thanks for that. But I wonder if there is a way to optimize code compiling for an Intel Xeon server (32 bit). There is an option "Target machine" in project properties but that seems to be not working since changing it cause my project not compilable.

    C / C++ / MFC performance help c++ sysadmin windows-admin

  • MFC GUI on Windows Server 2003 runs slow like hell
    G GameProfessor

    Excuse me if I post in the wrong place but I'm having a very wierd problem. I have an application written with MFC. Basically, it has around 10 worker threads doing smth continuously and post message to CMainFrame when done. The MainFrame will process these messages and update some list control on GUI. Simple, isnt' it? Originally, I test and deploy my application on a Windows XP SP2 machine with CPU Celeron 2,4GHz. It runs well although it consumes 40-50% CPU all the time. Now, I have a server with CPU Xeon 3GHz, 1GB RAM, SCSI hard disk with RAID 1 (seems to be an overkill hah). On this server, my application only consumes 5% CPU but it runs LIKE HELL. It takes ages for me to access menu items and do other things on the GUI. In other word, the GUI seems to be frozen regularly. I don't know what's going on !!! I guess that because windows server 2003 has some mechanism to schedule and distribute CPU between applications. I have tried to config Processor scheduling & memory usage to best performance for program, it helps improves a bit, but still far from what's shown on the old Celeron computer !!! Setting process priority into "real time" in task manager also doesn't help. I'm clueless now, any one please help me :((

    C / C++ / MFC performance help c++ sysadmin windows-admin

  • Virtual List View
    G GameProfessor

    Thanks Mark, it works so charming now :-D I give u a 5-star vote :-D

    C / C++ / MFC tutorial question

  • Virtual List View
    G GameProfessor

    Mark Salsbery wrote:

    You can pass it with the dwStyle parameter to Create()/CreateEx() or set it in the resource editor properties if it's a control on a dialog resource.

    yeah, if it was a list control in a normal dialog then it would be easy. But for a list view and its associated list control, I dont' know where and when the list control is created to set its style. GP

    C / C++ / MFC tutorial question

  • Virtual List View
    G GameProfessor

    Each list view is associated with a list control which we can access by calling GetListCtrl(). How to set this list control to use LVS_OWNERDATA style ? I've tried to put these in OnCreate or OnInitialUpdate but it didn't work. The list is still not of OWNERDATA style. CListCtrl &ctlTmp = this->GetListCtrl(); ctlTmp.ModifyStyle(NULL, LVS_REPORT | LVS_OWNERDATA); how could I do this ?

    C / C++ / MFC tutorial question

  • CFile vs FILE* vs FSTREAM
    G GameProfessor

    thanks, anyway, it's also a common sense to assume that things that were written earlier are buggy and later people not only improve functionality but also fix bugs to make them better :doh:

    C / C++ / MFC visual-studio performance help question

  • CFile vs FILE* vs FSTREAM
    G GameProfessor

    There are several ways to access files when coding in visual C. We could use CFile, or FILE* or fstream. Which one is the best in term of performance and stability ? What's your opinion ? I used to think that CFile would be the best choice when we work with Windows (because it was written by Microsoft anyway). But actually it's not. I have an application that do intensive disk read/write (it reads files from hard disk about 20 times per seconds) and I have checked it thoroughly to make sure there is no read/write conflict. If I use CFile, there is chance of about 5% it returns an error that it can't open file (mode: binary read) while the file is obviously available. If I replace that part with FILE* pointer (i.e. use fopen & fread) then It runs perfectly all the time.

    C / C++ / MFC visual-studio performance help question

  • Dont send error after application closes
    G GameProfessor

    you should replace it with this->PostMessage(WM_CLOSE, 0, 0); it would prevent error in case you were in the middle of something

    C / C++ / MFC help

  • How to create static libraries that link to each other
    G GameProfessor

    In my program I have several classes that I want to separate from the rest by making them into static library (i.e. file .lib and .h) I have class A, class B and class C. Class A includes B to call some functions from B, and both A and B include C to call some functions from C. I can easily create a .lib file for class C by creating a new win32 static library project but I don't know how to deal with class A and B. One more thing, if in class A (for e.g) I want to post an user message to main frame, how to inherit the message identifier from my application when I create A.lib ?

    C / C++ / MFC json tutorial question

  • Some questions about Message Queue
    G GameProfessor

    thanks a lot, i was wondering about this just for the sake of curiousity. it's really dangerous using a queue without knowing how much it can handle. it's wierd I couldn't found any information about this (which I thing is very important). now i'm so relieved :laugh: , nobody says a word about it because it's almost limitless :laugh:

    C / C++ / MFC question data-structures

  • Some questions about Message Queue
    G GameProfessor

    What is the size of windows message queue ? i.e how many messages can queue up before the next one being discarded? And how long can a message stay in the message queue waiting to be processed? I've been looking all over but haven't found an answer for this ?

    C / C++ / MFC question data-structures

  • isletter' : not all control paths return a value
    G GameProfessor

    it's so obvious that you forget to return after the loop. You may think that it will definitely return inside the loop (it loops 26 times) but at compile time, the computer can't tell whether the loop will be perform or not. To the compiler, a for() loop is one kind of structure that can be ignored, that's why you have to put a return explicitly after the loop.

    C / C++ / MFC question

  • Is it possible to give window message different priority ?
    G GameProfessor

    hi all, I wonder if it is possible to give window message different priority, or in other word, one message can interrupt the message queue and is processed before other messages although it arrives in the message queue later. if that's not possible, what's your solution to handle the situations when a window have to process a long message queue, could be > 10 or even 20 messages waiting to be processed.

    C / C++ / MFC data-structures question

  • How to temporarily pause all threads except one
    G GameProfessor

    thanks, although your comment make me creepy ::(( I think I'll try Josh Gray's advice: trying to build a interface to lock my section. It could be difficult but it seems worthy to try.

    C / C++ / MFC help tutorial question

  • How to temporarily pause all threads except one
    G GameProfessor

    hi, I have a multithreaded program. In one thread, I have a very important section. I want to put all other thread to sleep when this thread comes to this section. Is there anyway to do this? The data in this section is accessed from many many places so it's almost impossible to use CCriticalSection to lock it. thanks for any help.

    C / C++ / MFC help tutorial question

  • 11 digit numbers
    G GameProfessor

    It's simple for number > 4 Gb, you need a 64 bit integer, it consists of two 32 bit integer: low bit and high bit DWORD GetFileSize( HANDLE hFile, // handle of file to get size of LPDWORD lpFileSizeHigh // pointer to high-order word for file size ); use this function to get file size, it returns the low word of file size. lpFileSizeHight will store the high bytes of file size.

    C / C++ / MFC help question

  • reading 'null' from binary files into char arrays/strings
    G GameProfessor

    you have to write a short function that change all 00 bytes in a so called "string" into the real string "0x00". To do this, read or copy your char array into a unsigned char array that is much longer. then manipulate this unsigned char array (change all 00 bytes into 4 bytes "0x00", then copy the unsigned char array back to your designated string.

    C / C++ / MFC help question csharp visual-studio data-structures
  • Login

  • Don't have an account? Register

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