Solved

DLL, Forms and MouseEnter Events

Posted on 2004-09-20
5
315 Views
Last Modified: 2010-04-04
I've got a form inside a DLL that I load up. This bit works perfectly fine not a problem. Now I have a label on this form with events attached to the MouseEnter and MouseLeave events. When I use this form in a .exe it works perfectly fine. However as a .dll it doesn't perform these events nor the OnClick event either. Any possible ideas?

It's an ActiveX Library, with ComServ and Sharemem loaded.
0
Comment
Question by:Narusegawa
  • 3
5 Comments
 

Author Comment

by:Narusegawa
ID: 12103487
More specifically it's the following that doesn't work:

procedure TfrmSplash.lblURLClick(Sender: TObject);
begin
  ShellExecute(Handle,'Open','http://www.mydomain.co.uk',nil,nil,SW_SHOWNORMAL);
end;

and

procedure TfrmSplash.lblURLMouseEnter(Sender: TObject);
begin
  lblURL.Font.Color := $00DD0000;
end;

0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12103516
will have to try out, but is probably the same problem as the TAB key, since version 5 they changed something in the VCL, now all the messages are sent directly to the EXE application bypassing the DLL
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 50 total points
ID: 12103750
Sharemem with an ActiveX control? Why???
0
 

Author Comment

by:Narusegawa
ID: 12109890
Because the guide I read for DLL making said to put Sharemem into DLL and EXE uses clause to make sure that strings can be passed to and from them rather than pchars.

And I asked a mate at work what to choose when building a DLL and he said choose "ActiveX Library", and from previous DLL experience/problems I've always put :

initialization
  CoInitializeEx(nil,COINIT_MULTITHREADED);
finalization
  CoUninitialize;

at the bottom of any forms/units I use in my DLL's. And this won't compile with ActiveX not in the USES clause.

Unless I'm doing something totally wrong here.
0
 

Author Comment

by:Narusegawa
ID: 12235717
Workshop_Alex, removing ActiveX worked fine. I dont use any ADO components yet on my forms in the .dll, but when I do will it cause a problem?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now