|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Joan Ramon López Gillué (jrlopez
VISIONADVANCE.COM)Date: Wed Apr 11 2001 - 03:41:23 CDT
Hi Sajit,
Here is a cut&paste of the MSDN page about MIDL structures. Hope it helps.
Joan Ramon
MIDL Structures
Normal C semantics apply to the fields of base types. Fields of more complex
types, such as pointers, arrays, and other constructed types, can be
modified by type or field_attributes. For more information, see struct.
Field attributes are the attributes that can be applied to fields of an
array, structure, union, or character array:
[ignore], [size_is]
[max_is]
[length_is]
[first_is]
[last_is]
[switch_is]
[string]
pointer attributes
For example, field attributes are used in conjunction with array
declarations to specify either the size of the array or the portion of the
array that contains valid data. This is done by associating another
parameter, structure field, or a constant expression with the array.
The [ignore] attribute designates pointer fields to be ignored during the
marshaling process. Such an ignored field is set to NULL on the receiver
side.
MIDL provides conformant, varying, and open arrays. An array is called
conformant if its bounds are determined at run time. The [size_is] attribute
designates the upper bound on the allocation size of the array and the
[max_is] attribute designates the upper bound on the value of a valid array
index. For more information, see [arrays].
An array is called varying if its bounds are determined at compile time, but
the range of transmitted elements is determined at run time. An open array
(also called a conformant varying array) is an array whose upper bound and
range of transmitted elements are determined at run time. To determine the
range of transmitted elements of an array, the array declaration must
include a [length_is], [first_is], or [last_is] attribute.
The [length_is] attribute designates the number of array elements to be
transmitted and the [first_is] attribute designates the index of the first
array element to be transmitted. The [last_is] attribute designates the
index of the last array element to be transmitted.
The [switch_is] field attribute designates a union discriminator. When the
union is a procedure parameter, the union discriminator must be another
parameter of the same procedure. When the union is a field of a structure,
the discriminator must be another field of the structure at the same level
as the union field. The discriminator must be a Boolean, char, int, or enum
type, or a type that resolves to one of these types. For more information,
see Nonencapsulated Unions and [switch_is].
The [string] field attribute designates that a one-dimensional character or
byte array, or a pointer to a zero-terminated character or byte stream, is
to be treated as a string. The string attribute applies only to
one-dimensional arrays and pointers. The element type is limited to char,
byte, wchar_t, or a named type that resolves to one of these types.
For information about the context in which field attributes appear, see MIDL
Arrays, MIDL Structures, and MIDL Unions.
-----Original Message-----
From: Distributed COM-Based Code [mailto:DCOM
DISCUSS.MICROSOFT.COM]On
Behalf Of Sajit Kumar (RBIN/DCA-IAG)
Sent: miércoles, 11 de abril de 2001 6:51
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: User Defined Data Types
Hi All,
I need to know whether I can pass Struct's or Objects as parameters
in my interface methods. If possible then please let me know how to do it?
If not possible then please suggest me some alternative option. Thanks in
advance.
With Regards
Sajit
----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]