ekinee
asked on
Differences between Borland C++ 5.02 & 4.52
I have upgraded my Borland C++ compiler from v. 4.52 to 5.02.
But there seems to be some problems. I'm programming an MDI application,
been programming for some time, I am able to work with it only at weekends. So in this program I'm using a modal dialog box with some listboxes I want to include in transfer buffer. In older version this buffer works fine. But when compiled with newer version, it results an access violation error.
Doing it like:
struct TTransferFED {
TTransferFED();
uint Tag;
TListBoxData valt;
TListBoxData sanal;
};
TTransferFED::TTransferFED ()
{
Tag=BF_CHECKED;
}
class TEDialog : public TDialog
{
public:
TEDialog(TWindow* parent,TTransferFED* trFed,TModule* module=0);
private:
TListBox* valtied;
TListBox* sanalist;
};
TEDialog::TEDialog(TWindow * parent,TTransferFED* trFed,
TModule* module)
: TDialog(parent,"Search",mo dule)
{
valtied=new TListBox(...);
sanalist=new TListBox(..);
SetTransferBuffer(trFed);
}
and it is called:
TTransferFED trFed;
if(TEDialog(this,&trFed).E xecute()== IDOK) {
...
}
The checkbox works correctly.
I don't now if there has been made some changes in class libraries or other
between these versions. I just don't have a clue about the problem.
But there seems to be some problems. I'm programming an MDI application,
been programming for some time, I am able to work with it only at weekends. So in this program I'm using a modal dialog box with some listboxes I want to include in transfer buffer. In older version this buffer works fine. But when compiled with newer version, it results an access violation error.
Doing it like:
struct TTransferFED {
TTransferFED();
uint Tag;
TListBoxData valt;
TListBoxData sanal;
};
TTransferFED::TTransferFED
{
Tag=BF_CHECKED;
}
class TEDialog : public TDialog
{
public:
TEDialog(TWindow* parent,TTransferFED* trFed,TModule* module=0);
private:
TListBox* valtied;
TListBox* sanalist;
};
TEDialog::TEDialog(TWindow
TModule* module)
: TDialog(parent,"Search",mo
{
valtied=new TListBox(...);
sanalist=new TListBox(..);
SetTransferBuffer(trFed);
}
and it is called:
TTransferFED trFed;
if(TEDialog(this,&trFed).E
...
}
The checkbox works correctly.
I don't now if there has been made some changes in class libraries or other
between these versions. I just don't have a clue about the problem.
When you use a TransferBuffer you must create the objects in the same order you declare them in the data struct.
what about uint Tag ?
Jean-Paul
what about uint Tag ?
Jean-Paul
ASKER
I have created checkbox comparing to Tag in correct order it is only missing from my question.
Try out changing :
- constructor :
TEDialog::TEDialog( ...... TTransferFED& trFed ......
- call :
if(TEDialog( this , trFed)....
Jean-Paul
- constructor :
TEDialog::TEDialog( ...... TTransferFED& trFed ......
- call :
if(TEDialog( this , trFed)....
Jean-Paul
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Alex , it 's funny to seeing you 've just sent the example
provided in the ../examples/owl/tasks/tran sfer of the BC5 directory. :))
may be the Borland team members should get the points ;-))
Jean-Paul
provided in the ../examples/owl/tasks/tran
may be the Borland team members should get the points ;-))
Jean-Paul
JPM:
1. See my 1-st comment (from 12.12.99)
2. I 've changed this example for
ekinee data
1. See my 1-st comment (from 12.12.99)
2. I 've changed this example for
ekinee data
ASKER
I've found that when I put both listboxes and checkbox in the buffer, it doesn't work. But when I use them separately it does work. For my wiev I create them correctly.
struct TTransferFED {
TTransferFED();
uint Tag;
TListBoxData valt;
TListBoxData sanal;
};
class TEDialog : public TDialog
{
public:
TEDialog(TWindow* parent,TTransferFED* trFed,TModule* module=0);
private:
TListBox* valtied;
TListBox* sanalist;
};
TEDialog::TEDialog(TWindow * parent,TTransferFED* trFed,
TModule* module)
: TDialog(parent,"Search",mo dule)
{
... I also create other stuff in this part which I disable with DisableTransfer() ...
new CheckBox(...);
valtied=new TListBox(...);
sanalist=new TListBox(..);
SetTransferBuffer(trFed);
}
Changing constructor doesn't help.
struct TTransferFED {
TTransferFED();
uint Tag;
TListBoxData valt;
TListBoxData sanal;
};
class TEDialog : public TDialog
{
public:
TEDialog(TWindow* parent,TTransferFED* trFed,TModule* module=0);
private:
TListBox* valtied;
TListBox* sanalist;
};
TEDialog::TEDialog(TWindow
TModule* module)
: TDialog(parent,"Search",mo
{
... I also create other stuff in this part which I disable with DisableTransfer() ...
new CheckBox(...);
valtied=new TListBox(...);
sanalist=new TListBox(..);
SetTransferBuffer(trFed);
}
Changing constructor doesn't help.
Hi, i make ~same thing, and all works
May be:
>>new CheckBox(...); ->not !
change to
tCheckBox = new CheckBox(...);
where tCheckBox must be in class, of course.
May be:
>>new CheckBox(...); ->not !
change to
tCheckBox = new CheckBox(...);
where tCheckBox must be in class, of course.
error in you text, but compare
with working example(of Borland), that
you can find in BC5\EXAMPES\OWL\TASKS\TRAN
in my reply https://www.experts-exchange.com/jsp/qShow.jsp?ta=owl&qid=10230040 (5 pts).