Link to home
Start Free TrialLog in
Avatar of ekinee
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",module)
{
   valtied=new TListBox(...);
   sanalist=new TListBox(..);
   SetTransferBuffer(trFed);
}

and it is called:
TTransferFED trFed;

   if(TEDialog(this,&trFed).Execute()==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.    
Avatar of AlexVirochovsky
AlexVirochovsky

Hm, it is very strange, i don't see
error in you text, but compare
with working example(of Borland), that
you can find in BC5\EXAMPES\OWL\TASKS\TRANSFER or
in my reply https://www.experts-exchange.com/jsp/qShow.jsp?ta=owl&qid=10230040 (5 pts).
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
Avatar of ekinee

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

 
ASKER CERTIFIED SOLUTION
Avatar of AlexVirochovsky
AlexVirochovsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alex , it 's funny to seeing you 've just sent the example
provided in the ../examples/owl/tasks/transfer of the BC5  directory.  :))

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
Avatar of ekinee

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",module)
{
        ... 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.