"Remy Lebeau \(TeamB\)" <
XXXX@XXXXX.COM >wrote:
Quote
"Cris" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
Please show your actual header file and cpp file.
Gambit
OK, here is my code, I was referring to in first post:
TAPER.CPP
...............................................................
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Taper.h"
#include "MyFunctions.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
int LookForArcsIn(void)
{
if ( Form1 )
{
int i=Form1->Memo1->Lines->Count;
return i;
}
ShowMessage (" LookForArcs()\n\nForm1 == NULL" );
return -1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ShowMessage ( IntToStr ( LookForArcs()));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
ShowMessage ( IntToStr ( LookForArcsIn()));
}
//---------------------------------------------------------------------------
and MYFUNCTIONS.H
................................................................
#include "taper.h"
int LookForArcs(void);
int LookForArcs(void)
{
if ( Form1 )
{
int i=Form1->Memo1->Lines->Count;
return i;
}
ShowMessage (" LookForArcs()\n\nForm1 == NULL" );
return -1;
}
I have also standard Project1.cpp file generated by builder.
Notice that there are two buttons, Button1 has a call to a function LookForArcs() declared in MyFunctions.h in onClick event, It throws an exception.
Button2 has a call to a function LookForArcsIn() declared in Taper.cpp, it dose work.
Bodies of both functions are identical.
Cris