CSI 5V93

Component Level Programming

Enumerated types in the interface

Print the article

This entry was posted on 7/24/2006 9:38 AM and is filed under Tips.

Define your property as a short.

Insert the typedef enum statement at the begining of the library specification as illustrated:

library
SCHEM32Lib
{
   importlib(STDOLE_TLB );
   importlib(STDTYPE_TLB );
   
typedef enum
   
{
      [
helpstring("Diagonal")] Diagonal=0,
      [
helpstring("Manhatten")] Rectangular=1,
      [
helpstring("Horiz Dogleg")] HDogleg=2,
      [
helpstring("Vert Dogleg")] VDogleg=3,
      [
helpstring("X Then Y")] XThenY=4,
      [
helpstring("Y Then X")] YThenX=5
   }
   LineModeCode;

Now, find the definition of your property in the dispinterface, and change the type from "short" to whatever type you used in your "enum."

dispinterface _DSchem32
{
   properties:
   // NOTE - ClassWizard will maintain property information here.
   // Use extreme caution when editing this section.
   //{{AFX_ODL_PROP(CSchem32Ctrl)
   [id(1)] LineModeCode LineMode;
   [id(2)] short PixelsPerGrid;
   [id(3)] boolean SnapToGrid;
   [id(4)] DrawModeCode DrawMode;
   [id(5)] WireEditCode WireEditMode;


 

What did you think of this article?




Trackbacks
Trackback specific URL for this entry
  • Trackbacks are closed for this entry.
Comments

    • 7/24/2006 3:58 PM Josh wrote:
      Microsoft VS.NET is cool. It gives you cool emoticons embedded in your source code!
    • 7/24/2006 4:54 PM Adam wrote:
      Hey!! I want Emoticons!!!
      1. 7/24/2006 5:03 PM Peter M Maurer wrote:
        Some professors just have no sense of humor, I guess.
    Leave a comment

    Comments are closed.