OWL NExt - Knowledge Base

[ Home | Contents | Search | Next | Previous | Up ]

g++ and OWL6 transfer buffers

Date: 23 Jul 2000
Time: 23:22:30
Remote Name: ???

Comments

The OWL transfer mechanism requires transfer structs to have no padding. When using this facility with g++, be sure to do something like this:

Example:

// This can go in a separate reusable header

#ifdef __GNUG__
#       define ATTRIBUTE_PACKED __attribute__ ((packed))
#else
#       define ATTRIBUTE_PACKED
#endif

// This is in your appexpert class header

struct MyClassXfer {
//{{MyClassXFER_DATA}}
        char    edit_control[ 255 ];
        TComboBoxData  combobox_control;
//{{MyClassXFER_DATA_END}}
} ATTRIBUTE_PACKED;
  ^^^^^^^^^^^^^^^^ need to add this
  

The bug that results if you do not do this is rather difficult to track down. 

Greg Chicares

Last changed: July 14, 2001