IDL->TLB->PAS
От: BigUrri Казахстан  
Дата: 10.03.04 09:04
Оценка:
Здравствуйте,

Как в IDL написать следующее :


type
 TRec = record
 s: WideString;
 case integer of
   1: (_int: integer);
   2: (_Double: Double);
   end;
 end;


чтобы при компиляции IDL->TLB->PAS получилось исходное объявление?

Пробовал так:
typedef struct _example {
   SHORT vt;
   [switch_is(vt)] union {
   [case(1)]       LONG      lVal;
   [case(2)]       BYTE      bVal;
       };   
} example;

на выходе получается :

 __MIDL___MIDL_itf_DataTypeInfo_0259_0003 = record
   case Integer of
     0: (lVal: Integer);
     1: (bVal: Byte);
 end;

 _example = packed record
   vt: Smallint;
   __MIDL_0011: __MIDL___MIDL_itf_DataTypeInfo_0259_0003;
 end;

а требуется
 _example = packed record
   vt: Smallint;
   case Integer of
     0: (lVal: Integer);
     1: (bVal: Byte);
     end; 
   end;

IDL компилируется MIDL из Visual Studio .NET 2003

Спасибо
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.