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
F

Focht

@Focht
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to debug multity threads
    F Focht

    Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.

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

  • Enumerating open handle
    F Focht

    Hi, the mechanism that sysinternals and other commercial/freeware apps use is covered in an article at http://www.codeguru.com/files/FileObjectInfo.shtml . Of course it is not limited to process file handles only. You could enumerate all types of system handles that way. It works for NT-based systems only as far as i know. For Win XX there are some special deviceIo requests to get that information. Cheers, A.Focht.

    C / C++ / MFC com tutorial question

  • Weird thread parameter problem
    F Focht

    Hiya, at first - Visual Basic only supports Apartment-model even if "free threaded" is preferred in registry. When you create additional threads in your COM app, care must be taken when calling any methods/events from that threads. Without looking into sample code, i would guess the apartment instance pointer, your 'this' must be wrapped/marshalled in some way when it was invoked from the STA vb app (in a free threaded app, it would be marshalled for the random RPC thread). This means the interface pointer is a temporary one (limted lifetime and scope) than the CreateInstance()/OnFinalConstruct() one. When you CreateThread(), the (worker)thread function itself is not guaranteed to execute with the supplied 'this' while the method scope isnt left. When the method scope is left with "return S_OK", the internal COM/RPC invocations are returning too, possibly destroying any temporary (interface) pointers, freeing memory etc. The case that OnFinalConstruct() works may be an exception, possibly COM-apartment issues. You may compare both 'this' pointers (from OnFinalConstruct() and method invocation). If you *really* need additional threads in your COM server, then follow the threading rules (marshal interface ptrs or synchronize via postmessage to main STA thread or use static instance 'this'). There exist some MSDN articles regarding asynchronous COM and threading. Hope this helps, A. Focht

    C / C++ / MFC c++ windows-admin testing tools help
  • Login

  • Don't have an account? Register

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