Chris,

It is not a bug.  Think of it this way:

Application:
TMainMenu's vtable resides at location xyz.  Object as TMainMenu tests to
see if the object is derived from the class at xyz.

Now, in the DLL:
TMainMenu's vtable resides at location abc.  Object as TMainMenu tests to
see if the object is derived from the class at abc - and it is not!  So,
passing an object reference to a DLL, and testing with AS will not work!
Does this make sense?

For this to work, you will need to use packages.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Chris Crowe
> Sent: Tuesday, 8 February 2000 17:33
> To: Multiple recipients of list Delphi
> Subject: [DUG]: Problem with IS keyword in a DLL.
>
>
> I am having a few major problems with DLL's and using the IS
> keyword. I have
> two situations in a DLL which I have written which fail using the IS
> Keyword.
>
> One I pass a reference to the form which is calling the DLL,
> and I then
> iterate thought the form's components to find the MainMenu.
> But when I have
> this code
>
> if (Form.Components[POs] is TMainMenu)
>
> the code returns false even when the current component is in fact a
> TMainMenu.
>
> I have another routine which has an Assign() method, and that
> also fails,
> because the IS fails.
>
>  if Source is TAdrockFillObject then
>
> This line always returns false, and the message I get is "You
> can not assign
> a TAdrockFillObject to a TAdrockFillObject"
>
> The problems do not show up in a standard app.
>
> Any ideas?, I got around the MainMenu by just knowing the name of the
> component, but the assign for the fill object has multiple
> assign's and each
> one of those will also fail.
>
> This appears to be a bug in Delphi 5...
>
> What else can I do to determine the class?, the DLL's are
> loaded using the
> LoadLibrary function.
>
> Chris
>
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to