Hello Peopel!!!!
I have a problem with a definiton. I have defined a form, in dll, then i had to include the file in the same form, after compiling i'm getting worning Public symbol '_DllCustomers' defined in both module CUSTOMERDLL.OBJ and CUSTOMERFORM.OBJ
here is the code
//---------------------------------------------------------------------------
//CUSTOMERDLL.CPP
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
#include "customerdll.h"
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------
void __stdcall CreateCustomer(TComponent* Owner)
{
DllCustomer = new TCustomerF (Owner);
DllCustomer->ShowModal();
}
//----------------------------------------------------------------------------
void __fastcall Search (AnsiString NameP, AnsiString FieldP, TIBTable* Table)
{
TLocateOptions Opts;
Opts.Clear();
Opts << loPartialKey;
Opts << loCaseInsensitive;
Table->Locate(FieldP,NameP, Opts );
Table->IndexFieldNames=FieldP;
}
//---------------------------------------------------------------------------
//CUSTOMERDLL.H
#ifndef DllH
#define DllH
#include "customerForm.h"
TCustomerF* DllCustomer;
//---------------------------------------------------------------------
void __fastcall Search (AnsiString, AnsiString, TIBTable*);
extern "C" __declspec(dllexport) __stdcall void CreateCustomer(TComponent *Owner);
//---------------------------------------------------------------------
#endif
// CUSTOMERFORM.CPP
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Inifiles.hpp>
#pragma hdrstop
#include "customerdll.h"
#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();
}
//---------------------------------------------------------------------------
//CUSTOMERFORM.H
//$$---- Form HDR ----
//---------------------------------------------------------------------------
#ifndef CustomerFormH
#define CustomerFormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "IBCustomDataSet.hpp"
#include "IBDatabase.hpp"
#include "IBTable.hpp"
#include <DB.hpp>
#include <DBCtrls.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <Mask.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TCustomerF : public TForm
{
__published: // IDE-managed Components
TIBTable *IBTable1;
TIBTransaction *IBTransaction1;
TSmallintField *IBTable1ID;
TSmallintField *IBTable1TYPE_ID;
TIBStringField *IBTable1NAME;
TIBStringField *IBTable1ADDRESS_LINE_1;
TIBStringField *IBTable1ADDRESS_LINE_2;
TIBStringField *IBTable1CITY;
TIBStringField *IBTable1STATE;
TIBStringField *IBTable1ZIP;
TIBStringField *IBTable1COUNTRY;
TIBStringField *IBTable1PHONE_1;
TIBStringField *IBTable1EXTENSION_1;
TIBStringField *IBTable1PHONE_2;
TIBStringField *IBTable1EXTENSION_2;
TIBStringField *IBTable1FAX;
TIBStringField *IBTable1EMAIL_1;
TIBStringField *IBTable1EMAIL_2;
TIBStringField *IBTable1SKYP_1;
TIBStringField *IBTable1SKYP_2;
TIBStringField *IBTable1ICQ_1;
TIBStringField *IBTable1ICQ_2;
TIBStringField *IBTable1WEB;
TIBStringField *IBTable1TAX_ID;
TIBStringField *IBTable1COMMENTS;
TIBStringField *IBTable1ENTERED_BY;
TDateTimeField *IBTable1ENTERED_TIME;
TDataSource *DataSource1;
TGroupBox *GroupBox1;
TDBEdit *DBEdit3;
TLabel *Label3;
TLabel *Label1;
TDBEdit *DBEdit1;
TSpeedButton *SpeedButton1;
TSpeedButton *SpeedButton2;
TLabel *Label10;
TDBEdit *DBEdit10;
TLabel *Label11;
TDBEdit *DBEdit11;
TBevel *Bevel1;
TBevel *Bevel2;
TIBTable *IBTable2;
TIBTransaction *IBTransaction2;
TStringField *IBTable1CUSTOMER_TYPE;
TIBTable *IBTable3;
TIBTransaction *IBTransaction3;
TSmallintField *IBTable3UP_LINK;
TIBStringField *IBTable3NAME;
TSmallintField *IBTable3ADDRESS_TYPE;
TIBStringField *IBTable3ADDRESS_1;
TIBStringField *IBTable3ADDRESS_2;
TIBStringField *IBTable3CITY;
TIBStringField *IBTable3STATE;
TIBStringField *IBTable3ZIP;
TIBStringField *IBTable3COUNTRY;
TIBStringField *IBTable3CONTACT;
TIBStringField *IBTable3PHONE_1;
TIBStringField *IBTable3EXTENSION;
TIBStringField *IBTable3PHONE_2;
TIBStringField *IBTable3FAX;
TIBStringField *IBTable3EMAIL_1;
TIBStringField *IBTable3EMAIL_2;
TIBStringField *IBTable3SKYP_1;
TIBStringField *IBTable3SKYP_2;
TIBStringField *IBTable3ICQ_1;
TIBStringField *IBTable3ICQ_2;
TIBStringField *IBTable3COMMENTS;
TDataSource *DataSource2;
TIBTable *IBTable4;
TStringField *IBTable3DELIVERY_TYPE;
TPageControl *PageControl1;
TTabSheet *TabSheet1;
TBevel *Bevel3;
TLabel *Label4;
TLabel *Label6;
TLabel *Label7;
TLabel *Label8;
TLabel *Label9;
TLabel *Label2;
TLabel *Label5;
TLabel *Label12;
TLabel *Label13;
TLabel *Label14;
TLabel *Label15;
TLabel *Label16;
TLabel *Label17;
TLabel *Label18;
TLabel *Label19;
TSpeedButton *SpeedButton3;
TSpeedButton *SpeedButton4;
TLabel *Label20;
TLabel *Label21;
TLabel *Label22;
TLabel *Label23;
TLabel *Label24;
TDBEdit *DBEdit4;
TDBEdit *DBEdit5;
TDBEdit *DBEdit6;
TDBEdit *DBEdit7;
TDBEdit *DBEdit8;
TDBEdit *DBEdit9;
TDBEdit *DBEdit12;
TDBEdit *DBEdit13;
TDBEdit *DBEdit14;
TDBEdit *DBEdit15;
TDBEdit *DBEdit16;
TDBEdit *DBEdit17;
TDBEdit *DBEdit18;
TDBEdit *DBEdit19;
TDBEdit *DBEdit20;
TDBEdit *DBEdit21;
TDBEdit *DBEdit22;
TDBEdit *DBEdit23;
TDBEdit *DBEdit24;
TDBGrid *DBGrid1;
TDBLookupComboBox *DBLookupComboBox1;
TTabSheet *TabSheet2;
TBevel *Bevel4;
TTabSheet *TabSheet4;
TBevel *Bevel6;
TLabel *Label25;
TLabel *Label26;
TLabel *Label27;
TLabel *Label29;
TLabel *Label30;
TLabel *Label28;
TLabel *Label31;
TLabel *Label32;
TLabel *Label33;
TLabel *Label34;
TLabel *Label35;
TLabel *Label36;
TLabel *Label37;
TLabel *Label38;
TLabel *Label39;
TLabel *Label40;
TLabel *Label41;
TLabel *Label42;
TSpeedButton *SpeedButton5;
TSpeedButton *SpeedButton6;
TDBEdit *DBEdit2;
TDBEdit *DBEdit26;
TDBEdit *DBEdit27;
TDBEdit *DBEdit28;
TDBEdit *DBEdit29;
TDBEdit *DBEdit30;
TDBEdit *DBEdit31;
TDBEdit *DBEdit32;
TDBEdit *DBEdit33;
TDBEdit *DBEdit34;
TDBEdit *DBEdit35;
TDBEdit *DBEdit36;
TDBEdit *DBEdit25;
TDBEdit *DBEdit37;
TDBEdit *DBEdit38;
TDBEdit *DBEdit39;
TDBEdit *DBEdit40;
TDBEdit *DBEdit41;
TDBLookupComboBox *DBLookupComboBox2;
TDBMemo *DBMemo2;
TDBGrid *DBGrid2;
TTabSheet *TabSheet3;
TBevel *Bevel5;
TDBMemo *DBMemo1;
TDBNavigator *DBNavigator1;
TButton *Button1;
TButton *Button3;
TTabSheet *TabSheet5;
TBevel *Bevel7;
TIBStringField *IBTable1PH_ADDRESS_LINE_1;
TIBStringField *IBTable1PH_ADDRESS_LINE_2;
TIBStringField *IBTable1PH_CITY;
TIBStringField *IBTable1PH_STATE;
TIBStringField *IBTable1PH_ZIP;
TSmallintField *IBTable1PH_COUNTRY;
TLabel *Label43;
TDBEdit *DBEdit42;
TDBEdit *DBEdit43;
TLabel *Label45;
TDBEdit *DBEdit44;
TLabel *Label46;
TDBEdit *DBEdit45;
TLabel *Label47;
TDBEdit *DBEdit46;
TLabel *Label48;
TDBEdit *DBEdit47;
TIBTable *IBTable5;
TIBTransaction *IBTransaction4;
TSmallintField *IBTable5UP_LINK;
TIBStringField *IBTable5F_NAME;
TIBStringField *IBTable5L_MANE;
TIBStringField *IBTable5TITLE;
TIBStringField *IBTable5PHONE_1;
TIBStringField *IBTable5EXTENSION;
TIBStringField *IBTable5PHONE_2;
TIBStringField *IBTable5FAX;
TIBStringField *IBTable5EMAIL_1;
TIBStringField *IBTable5EMAIL_2;
TIBStringField *IBTable5SKYP_1;
TIBStringField *IBTable5SKYP_2;
TIBStringField *IBTable5ICQ_1;
TIBStringField *IBTable5ICQ_2;
TLabel *Label44;
TDBEdit *DBEdit48;
TDataSource *DataSource3;
TLabel *Label49;
TDBEdit *DBEdit49;
TLabel *Label50;
TDBEdit *DBEdit50;
TLabel *Label51;
TDBEdit *DBEdit51;
TLabel *Label52;
TDBEdit *DBEdit52;
TLabel *Label53;
TDBEdit *DBEdit53;
TLabel *Label54;
TDBEdit *DBEdit54;
TLabel *Label55;
TDBEdit *DBEdit55;
TLabel *Label56;
TDBEdit *DBEdit56;
TLabel *Label57;
TDBEdit *DBEdit57;
TLabel *Label58;
TDBEdit *DBEdit58;
TButton *Button2;
TButton *Button4;
TButton *Button5;
TButton *Button6;
TLabel *Label59;
TDBEdit *DBEdit59;
TLabel *Label60;
TDBEdit *DBEdit60;
TSpeedButton *SpeedButton7;
TSpeedButton *SpeedButton8;
TDBGrid *DBGrid3;
TButton *Button7;
TButton *Button8;
TButton *Button9;
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall IBTable1AfterEdit(TDataSet *DataSet);
void __fastcall IBTable1AfterInsert(TDataSet *DataSet);
void __fastcall IBTable1AfterTransactionEnd(TObject *Sender);
void __fastcall IBTable1AfterOpen(TDataSet *DataSet);
void __fastcall Button2Click(TObject *Sender);
void __fastcall IBTable1AfterCancel(TDataSet *DataSet);
void __fastcall TabSheet4Enter(TObject *Sender);
void __fastcall TabSheet5Enter(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall Button4Click(TObject *Sender);
void __fastcall Button5Click(TObject *Sender);
void __fastcall Button6Click(TObject *Sender);
void __fastcall Button7Click(TObject *Sender);
void __fastcall Button8Click(TObject *Sender);
void __fastcall Button9Click(TObject *Sender);
void __fastcall IBTable3AfterTransactionEnd(TObject *Sender);
void __fastcall IBTable3AfterOpen(TDataSet *DataSet);
void __fastcall IBTable3AfterInsert(TDataSet *DataSet);
void __fastcall IBTable3AfterEdit(TDataSet *DataSet);
void __fastcall IBTable5AfterTransactionEnd(TObject *Sender);
void __fastcall IBTable5AfterPost(TDataSet *DataSet);
void __fastcall IBTable5AfterOpen(TDataSet *DataSet);
void __fastcall IBTable5AfterInsert(TDataSet *DataSet);
void __fastcall SpeedButton3Click(TObject *Sender);
void __fastcall SpeedButton4Click(TObject *Sender);
void __fastcall SpeedButton5Click(TObject *Sender);
void __fastcall SpeedButton6Click(TObject *Sender);
void __fastcall SpeedButton7Click(TObject *Sender);
void __fastcall SpeedButton8Click(TObject *Sender);
void __fastcall DBEdit3KeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall DBEdit1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall SpeedButton1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TCustomerF(TComponent* Owner);
AnsiString __fastcall TCustomerF::GetPath();
void __fastcall TCustomerF::Save(TIBTable*, TIBTransaction*);
};
//---------------------------------------------------------------------------
extern PACKAGE TCustomerF *CustomerF;
//---------------------------------------------------------------------------
#endif
Can anyone tall me what i'm doing wrong?
it does work with a Worning, but i'm trying to write it correctly, please help