
3-6 Data Types
3-6
3.2.2 Implementing an
Interface Through a
Custom Interface
An extension can also be implemented by overloading the
Custom interfaces defined for the extension. For example, an
extension Unit Operation can be created by overloading the
ExtensionObject interface and the ExtnUnitOperation interface.
When an extension is created in this manner, all methods of the
interface must be overloaded (this is a requirement of the C++
language definition). If a method does not contain any
functionality, however, the error condition E_NOTIMPL should be
returned to indicate to HYSYS that the method is not being
used. Using the Extension Unit Operation as an example once
again; each of the methods in its two supported interfaces must
be overloaded, but only the Initialize and Execute methods need
return anything other than E_NOTIMPL.
3.3 Data Types
This documentation for the most part uses Visual Basic syntax in
its sample code and examples. The following table provides a
map of Visual Basic types to C++, .NET, C#, and VB.NET types.
Visual Basic Type C++ Type .NET Type C# Type VB.NET Type
Variant VARIANT System.Object object Object
String BSTR System.String string String
Boolean VARIANT_BOOL System.Boolean bool Boolean
Long long System.Int32 int Integer
Integer short System.Int16 short Short
Double double System.Double double Double
Single float System.Single float Single
arrays SAFEARRAY System.Array Array or specific
(string[], int[],
double[])
Array or specific
(string(), int(),
double())
Komentáře k této Příručce