?
Solved

system wide hook

Posted on 2001-06-03
4
Medium Priority
?
227 Views
Last Modified: 2010-04-06
I am using a system wide hook (CBT, Keyboard, and mouse), and therefore I had to write a DLL. When I first wrote this DLL I was having all kind of problems in Windows 95 (that was 3 years ago) until someone told me to compile the DLL with Delphi 2 (instead of Delphi 3 at the time).

I tried this again in Delphi 5 and still the same problem - some MPREXE violation occurs.

I wiuld continue to compile the DLL with D2, but now I have a different error that occurs with the DLL compiled with D2, but not with D5.

When compiling the DLL with D5, is there anything special I need to set for a DLL used as a hook?
0
Comment
Question by:sharons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 6150851
Delphi compiled DLLs do some things during the initialization, which may not be good for hooking. I have written a little utility which can modify the entry point of a DLL, so that it points to your first own exported function (index 1) instead of to Delphi's initialization. This might cure your problems. However, this kills the initialization of all the units. So it makes sense only for ultra-short hooking dlls, which don't need any unit initialization. The utility is available here:

www.madshi.net/hackDll.zip

Perhaps it's worth a try (if your dll is not too complicated)...

Regards, Madshi.
0
 

Expert Comment

by:moonrise
ID: 6150937
Thank you - I have found the solution with

  Set8087cw($133f);

0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8891054
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/refund of points

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Robert Marquardt
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 8978800
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question