Re: Active X Library problem



On Sat, 25 Jun 2005 08:31:11 +0200, Meunier Michel
<michel.meunier10@xxxxxxxxxx> wrote:

<snip>

>> BTW ShowMessage is in Dialogs so I think that you might really mean
>> Window.MessageBox
>That's true ShowMessage is in Dialogs, but the problem is that also I
>need to load a standard dll inside the active x library, for that I need
>LoadLibrary (within Windows unit) and my library also crash!!
>I don't know if what I say is clear, but to be simple:
>uses windows inside my active library ---> crash at initialization
>uses dialogs inside my active library ---> crash at initialization

Create another Unit - call it MSupport.pas

Let that unit Use Windows.pas and anything else it feels like

Then you replace Windows in the AX Library's uses list with MSupport

In the AX Library code you can use:

MSupport.LoadLibrary which just calls Windows.LoadLibrary

There are other methods, but I reckon that this one is the easiest for
you to implement and most important, support in the long run.

I'm /not/ going to suggest that you group your 'sensitive' routines at
the bottom of the AX Library's code, following another Uses clause

Nor am I going to suggest that you copy the required DLL declarations
from Windows.pas and duplicate them (Delphi does do a bit of that, but
IMO it is dirty and unnecessary)



.