[lazarus] FPC - Help Needed -Dynamic Linking

Shane Miller SMiller1 at stvgb.org
Fri Apr 6 14:26:19 EDT 2001


UPDATE:
  Even if ComponentPages existed in the main executable (I registered some components and therefore created a tcomponentpages) when the linked library calls the registercomponents function, it thinks that COmponentPages is not assigned.  I guess that is reasonable but how can I get it to use the ComponentPages instance from the main executable???

Shane
"I'm getting a headache"



>>> SMiller1 at stvgb.org 04/06/01 01:06PM >>>
Greetings,

In order to create Packages for Lazarus I am dynamically linking a unit into Lazarus.  I am using the dl functions DLOpen, DLClose, DLSym to facilitate this.

I open the library, then call dlsym to get the pointer to the procedure I want to call.  That works fine.  Then I call the procedure.  Inside the library unit's exported function I call a function (register) in another unit that's in the uses clause.  In the Register function of that unit I call RegisterComponents.  This calls the function within creginst.inc unit.  Because this is the first registration and the ComponentPages is not assigned it calls InitComponentPages.  Somewhere within the TCollection.Create the funciton throws an exception.

Can someone look into that code and tell me if it's related to the dynamic linking or if it's simply an error in the InitComponentPages code?

I really have been struggling trying to trace this down and would appreciate any help.

Thanks
Shane


_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list