BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DLL/Global Key Hook problem still

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Stan R.
Guest





PostPosted: Sat Nov 26, 2005 1:19 am    Post subject: DLL/Global Key Hook problem still Reply with quote



Thanks Gambit for your help so far. I used your code but I don't see the
event being being triggered in the form. When I close the main window I
get an AV (the standard "read of address ..." and it drops me in the
dll's cpp file but doesn't show where/what caused it. If I put a break
point in the callback function it stops there and as soon as I step is
AV's.

My code is just as you gave it, with some minor fixes.

I have both the mainform and the dll projects open together as a project
group. Not sure if this is the best way to work on both at the same time
but it seems to work.

------------------------------------------------------------------------
Update:

Ok got some more info. It seems like CreateWindowHandle and
DestroyWindowHandle are not getting called for some reason. Look in the
docs they seem to have the right signature. CreateWindowHandle isn't
being called, and thus, the window handle in the dll isn't being set so
the message never gets sent (doesn't make it past the IF statement in
the call back.)
------------------------------------------------------------------------
Update:

I put a ShowMessage("CreateWindowHandle"); in that function and when I
start the program it shows up, but my break point doesnt BREAK on the
function (I tried putting a break on the fuctions heading and anywhere
below in its body, but it wont break. I see the blue dots and all, and
the break remains red (it doesn't turn green-yellow, so it's a valid
break point it seems.)

But why is the ShowMessage working but not the lpSetHookWnd(Handle);
right after it (I see the pHookInfo->hWnd as being NULL when I have a
break on the call back function, so it doesn't seem like SetHookWnd (in
the dll) gets called...
------------------------------------------------------------------------

What am I missing here?

Also, I'm using BCB5, on XP SP2, if that help at all.

Thanks for any help with this.


--
Stan


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.