comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
December 2007
motuwethfrsasuw
     12 48
3456789 49
10111213141516 50
17181920212223 51
24252627282930 52
31       1
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  What if subscriber dies?         


Author: Chris Shearer Cooper
Date: Dec 21, 2007 12:04

Sorry for the cross-post, I really don't know where to post this question
...

An object in my EXE uses CoCreateInstance() to create a COM object, which
happens to live in a DLL (in-process, apartment threading). Everything is
written in C++ under VS 2005.

The DLL generates events that the EXE needs to know about, so the EXE
creates an object that implements a particular interface, and then passes a
pointer to that object (interface) to the DLL's object. Now, when the DLL
wants to tell the EXE something, it just calls a function on that interface
and the magic happens. Yes, I do all the proper QueryInterface() and such.

What is strange, is that even though the DLL is supposedly running
in-process, sometimes when the EXE crashes, the DLL seems to live on. The
next time I run the EXE, I get strange errors from the DLL's COM object. I
shut down the EXE, restart it, and all is well. These strange errors only
occur the first time I run the EXE after the EXE has crashed (or been
stopped by the debugger).

So I guess two questions ....

1) Why would my COM object (in the DLL) live on? Why doesn't it die when
the EXE crashes?
Show full article (1.28Kb)
1 Comment
  Global Keyboard Shortcut - Hoping to avoid WM_KEYBOARD_LL         


Author: yehoshua
Date: Dec 21, 2007 10:25

Hello all,

I am curious, I am attempting to write a panic button system in which
a person presses a key combination like F11-F12 and it alerts the
proper people so they come running with guns to protect people.
Anyways, I know I can do this with a WM_KEYBOARD_LL and trap all keys,
then just only use the ones nessisary. What my question is, is there
another function in the API somewhere that allows me to just trap
(globally) a set of keys and get a callback for when they are
pressed? Thanks in advance for your help. Cheers.
1 Comment