Dynamically load a TFrame from a DLL.

Hi!

I'm trying to dynamically load a TFrame from a DLL, but I get an error saying "...cannot convert a TFont to a TFont". I then set the ParentFont property to false for the TFrame in the DLL, and afterwards nothing happens. I then tried the same thing with a package and that worked fine. What is wrong?

DLL
//---------------------------------------------------------------
extern "C" TFrame * __declspec(dllexport) InstanceFrame(TComponent *owner)
{        
    Frame2 = new TFrame2(owner);
    return Frame2;

Quote
}

//---------------------------------------------------------------

App
//---------------------------------------------------------------
    typedef TFrame * __declspec(dllimport) Instance(TComponent *);
    HINSTANCE hDLL = NULL;
    Instance *instance = NULL;
    TFrame *frame = NULL;

    if (hDLL == NULL)
    {
        hDLL = LoadLibrary("DLLProject.dll");
    }
    if (hDLL != NULL)
    {
        instance = (Instance *) GetProcAddress(hDLL, "_InstanceFrame");

        if (instance != NULL)
        {
            frame = instance(this);

            if (frame != NULL)
            {
                frame->Parent = Panel1;
            }
            else
            {
                ShowMessage(SysErrorMessage(GetLastError()));
            }
        }
        else
        {
            ShowMessage(SysErrorMessage(GetLastError()));
        }
    }
    else
    {
        ShowMessage(SysErrorMessage(GetLastError()));
    }
//---------------------------------------------------------------

Regards,
Magnus Karlsson
magnus.karls...@transrail.se