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
C

chifor

@chifor
About
Posts
6
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Updating View from WinThread
    C chifor

    I suggest you to take a luck at example from “msdn” documentation “MTMDI” that demonstrates an MFC User Interface Thread. For avoiding potential problems when programming multithreaded applications you need to respect some rolls or programming tips that is also described in “mfc” documentation. Ex: - You can't have two threads manipulating the same object.., if you need this you need to protect such access with appropriate Win32 synchronization mechanisms... - A thread can access only MFC objects that it created, a worker thread cannot perform a calculation and then call a document’s “UpdateAllViews” member function to have the windows that contain views on the new data modified, because the map from CWnd objects to HWNDs is local to the primary thread. There are several ways around this problem: you can pass individual handles (such as an HWND) rather than C++ objects to the worker thread, or you can create new user-defined messages corresponding to the different tasks your worker threads will be performing and post these messages to the application’s main window using PostMessage. If this little help is not enough for your problem send me a sample of your code and I will help you. CC.

    C / C++ / MFC help c++ announcement workspace

  • about CListCtrl
    C chifor

    For a good solution take a look at Chris Maunder article "Using text callbacks in ListView Controls" bye, CC.

    C / C++ / MFC tutorial question

  • Recently Used File
    C chifor

    Call this function from within the InitInstance member: LoadStdProfileSettings(10); where 10 is the nr. of most recently used (MRU) files. bye, CC.

    C / C++ / MFC question

  • Help Experts...CString to LPCSTR conversion
    C chifor

    your problem is that - in 'sFileOp.pFrom' the list of names must be double null-terminated!!! with: str.Format("%sEZBuf%c",HardDiskLetters[iCounter],'\0'); your function will work fine. CC.

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

  • What's wrong with this codes? But it generates Stack Overflow exception.
    C chifor

    Your implementation is not corectly!! The return value of 'GetMessage' function can be: zero - If the function retrieves the WM_QUIT message; nonzero - If the function retrieves a message other than WM_QUIT; -1 - If there is an error (ex. if hWnd is an invalid window handle or lpMsg is an invalid pointer). In your function the 'GetMessage' returns nonzero always and when arrive a timer message this will be blocked in while loop, but after 1 sec. will arrive other timer message and will be blocked. This is the problem, you never exit from OnTimer function, but OnTimer function is called at each 1 sec. From this reason you have a Stack Overflow exception.

    C / C++ / MFC data-structures question

  • Question about playing .wav files using mmio functions
    C chifor

    Your first function, waveOutOpen((HWAVEOUT*)&hWaveOut,WAVE_MAPPER,(tWAVEFORMATEX*)&PCMWaveFmtRecord,NULL,NULL,NULL); seems to be correctly, but more correctly is to use function like that: HWAVEOUT hWaveOut; waveOutOpen(&hWaveOut,WAVE_MAPPER,(LPWAVEFORMATEX)&PCMWaveFmtRecord,NULL,NULL,NULL); (where PCMWaveFmtRecord identifies the format of the waveform-audio data to be sent to the device). The second and third function: waveOutPrepareHeader((HWAVEOUT)&hWaveOut,&WaveHeader,sizeof(WaveHeader)); waveOutWrite((HWAVEOUT)&hWaveOut,&WaveHeader,sizeof(WaveHeader)); is not correctly because the first parrametter pased is need to be a HWAVEOUT handle and not a reference. Correctly is: waveOutPrepareHeader(hWaveOut,&WaveHeader,sizeof(WAVEHDR)); waveOutWrite(hWaveOut,&WaveHeader,sizeof(WAVEHDR));

    C / C++ / MFC question c++ help tutorial
  • Login

  • Don't have an account? Register

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