Link to home
Start Free TrialLog in
Avatar of Narusegawa
Narusegawa

asked on

DLL, Forms and MouseEnter Events

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.
Avatar of Narusegawa
Narusegawa

ASKER

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;

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
ASKER CERTIFIED SOLUTION
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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?