I'm developming a programm thet will use a dll forms, the problem i'm getting i have several forms in each dll, some of them have to use functions from other forms. For example, i have a DLL "Customers" which includes Customers form, Customer Selection List, which is a a different form in the same DLL, the problem is thet i'm getting an error message when i try to call function located on a CustomerForm, from CustomerSearch form.
here is the cod i'm trying to build
//$$---- Form CPP ----
CustSearch.Cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "CustSearch.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TSearchCustomerF *SearchCustomerF;
//---------------------------------------------------------------------------
__fastcall TSearchCustomerF::TSearchCustomerF(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TSearchCustomerF::Button1Click(TObject *Sender)
{
CustomerF->Search(Edit1->Text, "NAME", CustomerF->IBTable1);
}
//---------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////
CustomerForm.Cpp
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Inifiles.hpp>
#pragma hdrstop
#include "CustomerForm.h"
#include "DataModul.h"
#include "CustSearch.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "IBCustomDataSet"
#pragma link "IBDatabase"
#pragma link "IBTable"
#pragma resource "*.dfm"
TSearchCustomerF* DllCustomerSearch;
TCustomerF *CustomerF;
Pointer GenPointer;
//---------------------------------------------------------------------------
__fastcall TCustomerF::TCustomerF(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __stdcall CreateCustomerSearch(TComponent* Owner)
{
DllCustomerSearch = new TSearchCustomerF (Owner);
DllCustomerSearch->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TCustomerF::Search (AnsiString NameP, AnsiString FieldP, TIBTable* Table)
{
TLocateOptions Opts;
Opts.Clear();
Opts << loPartialKey;
Opts << loCaseInsensitive;
Table->Locate(FieldP,NameP, Opts );
Table->IndexFieldNames=FieldP;
}
//---------------------------------------------------------------------------
void __fastcall TCustomerF::Search1 (AnsiString NameP, AnsiString FieldP, int i)
{
if (i==1) {
Search(NameP, FieldP, IBTable1);
}
}
//---------------------------------------------------------------------------
void __fastcall TCustomerF::Save(TIBTable* Table, TIBTransaction* Transaction)
{
int i=0;
AnsiString a;
if (Table==IBTable1) {
if (Table->State==dsInsert) {
i=1; …