Attributes - Distributed Objects - Examination - Statement name | CSE 775, Exams of Engineering

Material Type: Exam; Professor: Fawcett; Class: Distributed Objects; Subject: Computer Engineering; University: Syracuse University; Term: Unknown 1989;

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-8uz-1
koofers-user-8uz-1 🇺🇸

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
IDL Syntax
[attribute, …] statement name [:BaseInterfaceName]
{
[attribute, …] statementBlock;
};
attribute
1. Endpoint
specifies a “well-known” port on which servers of the interface listen
2. Helpstring
human readable comment string, e.g., helpstring(“this is a help string”)
3. Local
generate header files only – stubs are not generated
4. Object
identifies a custom COM interface – must be followed by a uuid
5. pointer_default
pointer attribute to be applied to an unattributed pointer specification
ptr full pointer functionality
ref a reference, never null, always points to valid storage, can
not be reset
unique can be null and can be reset, but can not be used as aliases,
e.g., data referenced by the pointer is unique to the pointer
6. uuid
text representation of a universally unique identifier
7. version
specifies version of the interface, e.g., version(1.1)
statement name:
1. coclass
specify a list of intefaces supported by a COM component
2. dispinterface
generate an interface derived from idispatch, used for automation
3. interface
used to generate a COM interface
4. library
generate a type library from the statement block
5. module
defines a set of functions when generating a DLL
6. enum, typedef, struct, union
C-like language declarations, used to describe interface parameters
pf3

Partial preview of the text

Download Attributes - Distributed Objects - Examination - Statement name | CSE 775 and more Exams Engineering in PDF only on Docsity!

IDL Syntax

[attribute, …] statement name [:BaseInterfaceName] { [attribute, …] statementBlock; };

attribute

  1. Endpoint specifies a “well-known” port on which servers of the interface listen
  2. Helpstring human readable comment string, e.g., helpstring(“this is a help string”)
  3. Local generate header files only – stubs are not generated
  4. Object identifies a custom COM interface – must be followed by a uuid
  5. pointer_default pointer attribute to be applied to an unattributed pointer specification  ptr full pointer functionality  ref a reference, never null, always points to valid storage, can not be reset  unique can be null and can be reset, but can not be used as aliases, e.g., data referenced by the pointer is unique to the pointer
  6. uuid text representation of a universally unique identifier
  7. version specifies version of the interface, e.g., version(1.1)

statement name:

  1. coclass specify a list of intefaces supported by a COM component
  2. dispinterface generate an interface derived from idispatch, used for automation
  3. interface used to generate a COM interface
  4. library generate a type library from the statement block
  5. module defines a set of functions when generating a DLL
  6. enum, typedef, struct, union C-like language declarations, used to describe interface parameters

IDL Types

Base Types

IDL recognizes the types: boolean, byte, char, double, float, hyper, int, long, short, small, void, wchar_t These may be qualified as signed or unsigned, and you may declare pointers to any of these types.

Import Statement

IDL allows you to import definitions from other IDL files using statements like: import “wtypes.idl” wtypes.idl is a system file that defines many types used in windows and win programming, e.g.: VOID, PVOID, LPVOID, WORD, DWORD, DWORDLONG, LPWORD, BYTE, INT, UINT, SHORT, USHORT, LONG, ULONG TRUE, FALSE, BOOL, BOOLEAN, CHAR, UCHAR, WCHAR, TCHAR, LPSTR, LPWSTR, LPTSTR, LPCWSTR, LPCTSTR, OLECHAR, LPOLESTR, LPCOLESTR, BSTR, LPBSTR, VARIANT DOUBLE, FLOAT, DATE, FILETIME, SYSTEMTIME, SECURITY_ATTRIBUTES, ... GUID, IID, CLSID, REFIID, ...

Decorations

An IDL declaration looks like a C declaration except that it is embellished with decorations. These are qualifiers of the form: [in], [out], [in,out], [string], [size_is(...)], ... These will be discussed in more detail when we cover strings and arrays.

Preprocessor

MIDL runs the C preprocessor prior to compiling IDL statements. That means #include, #define, and #if macros are available in IDL and have the same meaning as in C.