Last time I received an answer for
"How do I connect a form in a dll with a dataset from the main application itself??"
Now the problem is I need to load the form dynamically at run time.
If I declare the function at design time and then build/run the app everything works perfectly. However if I load the dll at runtime and then call the function I get an Invalid Pointer Exception even though the function in the dll works and the form is connected to the datasource/dataset.
I am using code like this.
In the dll itself
frmCust := TfrmCust.Create(Nil);
frmCust.DBGrid1.DataSource := CustomerDataSource;
Result := true;
In the main App.
THandle = Integer;
TCustForm = function(CustDataSource:TDataSource) :Boolean;
myHandle : THandle;
CustForm : TCustForm;
CustHandle := LoadLibrary('CustDll.dll');
if handle <> 0 then
@CustForm := GetProcAddress
if @CustForm <> nil then
Datasource1 is valid.(I checked.)
Can anyone please help.
Thanks in advance.