🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #17

Problem: Passing data between EXE and DLL thru an exported function

#17
From: Leslie
Date: Tue, 29 Jun 2004 00:49
27 lines
1930 bytes
Dear Everyone, this is misterious for me, so please help if you can.

I'm programming a global keyboard hook in Delphi 7. Hook/unhook
procedures and KeyboardProc are in a DLL, it traps every keystroke
nicely.

My main EXE must provide information to the DLL on what key
combinations the DLL needs to catch. So, from the EXE, I pass a
dynamic array to the DLL thru an exported procedure. (In KeyboardProc,
the DLL loops thru this array to decide which keys to trap and what to
do with them.)

This works PERFECTLY, as long as my application is active. As soon as
I activate another window, or minimize my EXE, the DLL still catches
every keystrokes, BUT the passed array is EMPTY, its length is 0! This
renders my hook useless. When my EXE is re-activated, everything works
perfectly again.

What is happening "backstage" with my passed datas, when other windows
have the focus?

I did not use file mapping. When (for testing) I fill a "local" array
with data within the DLL, instead of passing one from the EXE, it
works even after my app loses focus.

Any help would be very much appreciated!
Vic
Technical Details
Message-ID: <5d1c237e.0406281649.78368b3d@posting.google.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 109d30,9d106cb9dc6c7a11,start
X-Google-Attributes: gid109d30,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail
From: vocalise27@yahoo.com (Leslie)
Newsgroups: borland.public.delphi.language.objectpascal
Subject: Problem: Passing data between EXE and DLL thru an exported function
Date: 28 Jun 2004 17:49:08 -0700
Organization: http://groups.google.com
Lines: 27
Message-ID: <5d1c237e.0406281649.78368b3d@posting.google.com>
NNTP-Posting-Host: 210.225.229.27
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1088470150 8126 127.0.0.1 (29 Jun 2004 00:49:10 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 29 Jun 2004 00:49:10 +0000 (UTC)