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

Julberto Danray

@Julberto Danray
About
Posts
11
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Can anyone recommend a good C#/.NET tutorial for an MFC old hand?
    J Julberto Danray

    Thanks to everyone who provided a recommendation. --Julberto

    The Lounge csharp c++ tutorial question

  • Can anyone recommend a good C#/.NET tutorial for an MFC old hand?
    J Julberto Danray

    Hi all, Can anyone recommend a good C#/.NET tutorial (online or print) for an old MFC guy? I have been programming C++/MFC for a long while and the time has come for me to bite the bullet and switch to C#/.NET. Maybe it would be a good idea for The Code Project to have a contest for such a tutorial. Maybe it already exists but I don't know where it is. Thanks in advance, Julberto

    The Lounge csharp c++ tutorial question

  • Call of OnCreate in a CTreeCtrl derived class
    J Julberto Danray

    I'm assuming the the control is being subclassed via SubclassDlgItem() or DDX_Control(). In either case PreSubClassWindow() will be called. This is a very convenient way to initialize your subclassed controls because it does not require any special treatment from the dialog that contains the control. Julberto

    C / C++ / MFC help question learning

  • Call of OnCreate in a CTreeCtrl derived class
    J Julberto Danray

    madmax0001, There is yet a third option for you. You can override the virtual function PreSubclassWindow() in your CTreeCtrl-derived class. You can do you initialization there. Julberto

    C / C++ / MFC help question learning

  • Looking for a good PDF writer
    J Julberto Danray

    Richard, Thanks for the information. The information you provided is good and practical. I'll give it a try. Thanks again buddy, Julberto

    IT & Infrastructure adobe question career

  • Looking for a good PDF writer
    J Julberto Danray

    Richard, Have you used it? Do you like it? I need something trouble-free. Julberto

    IT & Infrastructure adobe question career

  • Looking for a good PDF writer
    J Julberto Danray

    I wonder if anyone can recommend a good pdf writer. I need to produce pdf files of some word processing documents, spreadsheets, etc. and Adobe Acrobat is just too expensive ($300). Google searches on "pdf writer" show a bunch of apps that seem to do the job. Has anyone used any of these apps? Can anyone recommend a good (an inexpensive) one? Julberto

    IT & Infrastructure adobe question career

  • function time
    J Julberto Danray

    Check ::GetSystemTimeAsFileTime() in the MSDN library.

    C / C++ / MFC linux help question

  • Semaphore count
    J Julberto Danray

    Thanks for the links to the article and books. I'll look into them. By the way, it is important to me to know when all threads are done so the code can proceed to release resources. The background threads are somewhat short-lived since they just generate a synthetic HTML page and send it to the requesting client. The foreground thread waits until all background threads (if any) are done and then deletes the server object. Julberto

    C / C++ / MFC tutorial sysadmin help question

  • Semaphore count
    J Julberto Danray

    That's a good idea but I want to emphasize that the motivation to determine the number of active threads via the semaphore handle is to simplify the code. The mechanism I'm currently using gets the job done. However, complexity is the enemy of good code. A solution based on a GetSemaphoreCount-like function would be not only simple and elegant but very understandable to anyone maintainig the code. For the time being it is likely that I will continue to use the method descrived in my original post. Julberto

    C / C++ / MFC tutorial sysadmin help question

  • Semaphore count
    J Julberto Danray

    Does anyone know how to determine the current count associated with a semaphore? Let me explain. I have a server app that creates a background thread every time a client app makes a request. Before each background thread is created my app goes through ::WaitForSingleObject(m_hSemaphore, INFINITE) to ensure that I do not exceed a safe number of concurrent threads. When the background thread finishes its work, it calls ::ReleaseSemaphore(m_hSemaphore, 1, NULL) to balance the semaphore count. There are times that I need to wait for all background threads to end (for example when the program ends). If I could check for the current semaphore count, I would know how many background threads are still running. Currently I'm keeping a counter (protected with a critical section) that is incremented when the background thread starts and decremented when it ends. This works but it seems somewhat silly since this information is implicit in the semaphore object. There is yet another possibility, The 3rd argument of ::ReleaseSemaphore() is a pointer to a LONG that receives the previous count. However, it seems to me that there is a problem here since you have several threads writing to this LONG at about the same time without any thread synchronization mechanism. Semanticaly, I need something like ::GetSemaphoreCount(m_hSemaphore). So far as I know such function does not exist. Thanks, Julberto Danray

    C / C++ / MFC tutorial sysadmin help 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