home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 June / CHIPCD_6_2000.iso / software / cad / t425l1e / t425l1e.exe / _002830_ / TSAMPLE_.C
C/C++ Source or Header  |  1997-06-14  |  42KB  |  1,108 lines

  1. //------------------------------------------------------------------------------------------------------
  2. // Name       : tsample_.c
  3. // Date       : 05.03.1997     Author : SM           System : Win32
  4. //------------------------------------------------------------------------------------------------------
  5. // This file contains the language-independent implementation of the module TSAMPLE_.DLL. All texts and
  6. // resources that are language-dependent are located in an additional TSAMPLE.DLL, whose sources can be
  7. // found in the subdirectories \E (for English) and \D (for German).
  8. //------------------------------------------------------------------------------------------------------
  9.  
  10. #define TOSO_MODULE_VERSION     420             // Required version of Toso Interface
  11.  
  12. //------------------------------------------------------------------------------------------------------
  13.  
  14. #define USER_DATA_ID            "1.10-1996-09-10"
  15.  
  16. //------------------------------------------------------------------------------------------------------
  17.  
  18. #include        "windows.h"
  19. #include        "windowsx.h"
  20. #include        "stdlib.h"
  21. #include        "stdio.h"
  22. #include        "math.h"
  23.  
  24. #include        "e:\release4\tosoapi4.h"        // Toso Interface Definitions
  25. #include        "dialog.h"
  26.  
  27. //-----------------------------------------------------------------------------------------------------
  28.  
  29. #define STAR_INDENT_MIN         3       // Minimum number of indents
  30. #define STAR_INDENT_MAX         100     // Maximum number of indents
  31.  
  32. #define STAR_USE_NULL           0x0000  // Property usage flags
  33. #define STAR_USE_INDENTNUM      0x0001
  34. #define STAR_USE_ALL            0xffff
  35.  
  36. //-----------------------------------------------------------------------------------------------------
  37.  
  38. typedef struct {
  39.   int           IndentNum;              // UseFlag & STAR_USE_INDENTNUM
  40.   int           UseFlag;
  41. } PROPERTY_DATA;
  42.  
  43. typedef struct {
  44.   STR32         TimeStamp;
  45.   PROPERTY_DATA Data;
  46. } INF_HEADER;
  47.  
  48. //------ Language-dependent texts in TSAMPLE.DLL -------------------------------------------------------
  49.  
  50. DLL_IMPORT LPSTR
  51.         eStartUpText    [],
  52.         eDialogText     [],
  53.         eMessageText    [],
  54.         eCommandName    [],
  55.         eCommandEntry   [],
  56.         eNewPoint       [];
  57.  
  58. //------------------------------------------------------------------------------------------------------
  59.  
  60. static  HINSTANCE       hInstDLL,               // Instance handle of the main DLL
  61.                         hLanguage,              // Instance handle of the language DLL
  62.                         hGlobalInst;            // Instance handle of the serving application
  63. static  HWND            hGlobalWnd;             // Main window handle of the serving application
  64.  
  65. //------Dialog Window Handling -------------------------------------------------------------------------
  66.  
  67. static  DUMMYSTR        gCaption;               // Current dialog window caption
  68. static  int             gExitDialog;            // Button with which the dialog was canceled
  69. static  PROPERTY_DATA   gCopyProperty;          // Temporary copy of Property
  70.  
  71. //------ Command Processing ----------------------------------------------------------------------------
  72.  
  73. static  INF_HEADER      INFHeader;              // Settings
  74.  
  75. static  DPOINT          gPoint[3];              // Points entered by the user
  76. static  int             gCommandID;             // Current Command's ID
  77. static  HBITMAP         hBitmap;                // Handle of command icon bitmap
  78.  
  79. static  MODULE_COMMAND_DATA     CommandData[TVG_MODULE_SUBMENU_MAX];
  80.  
  81. //------ Command Description ---------------------------------------------------------------------------
  82. // The structure COMMAND_DATA contains a command description. It lists the points to be entered by the
  83. // user and their types. Each point description consists of three values: The point type (POINT_???),
  84. // the index of "related point", i.e. the point to which this point is relative, and a textual
  85. // description of that point.
  86. // The following command required exactly 3 points to be entered (COMMAND_FIXED = number of points to be
  87. // entered is known in advance, "3" says that this known number is three).
  88. // Following a description of those three points to be entered:
  89. // 1) POINT_CENTER = center of a circle, ellipse, etc.
  90. //    "-1"         = no "related point"
  91. //    NULL         = default description
  92. // 2) POINT_RADIUS = radius of a circle
  93. //    "0"          = relative to the point with the index zero (the center point)
  94. //    NULL         = default description
  95. // 3) POINT_RADIUS = radius of a circle
  96. //    "0"          = relative to the point with the index zero (the center point)
  97. //    NULL         = default description
  98. // Please note that the description strings of the points 2) and 3) will be overwritten before passed
  99. // to the serving application in order to change the description to "Enter Radius 1" and "Enter Radius 2"
  100. // (see end of procedure TosoModuleInit()).
  101.  
  102. static  COMMAND_DATA    gInfo[] = {             // Command description structure
  103.         { COMMAND_FIXED,
  104.           4,
  105.           { POINT_CENTER, POINT_RADIUS, POINT_RADIUS, POINT_ANGLE },
  106.           { -1, 0, 0, 0 },
  107.           { NULL, NULL, NULL, NULL }
  108.         }
  109. };
  110.  
  111. //------------------------------------------------------------------------------------------------------
  112. // Calculates the orientation angle of a vector.
  113.  
  114. double calc_atan( double dx, double dy )
  115. {
  116.   double        Angle;
  117.  
  118.   if( dx == 0.0 && dy == 0.0 )
  119.     return( 0.0 );
  120.  
  121.   Angle = atan2( dy, dx );
  122.   if( Angle < 0.0 )
  123.     return( Angle + REAL_2PI );
  124.   else
  125.     return( Angle );
  126. }
  127.  
  128. //------------------------------------------------------------------------------------------------------
  129. // Loads the module's settings from the registry database.
  130.  
  131. BOOL ModuleLoadSettings( void )
  132. {
  133.   BOOL          Result = FALSE;
  134.  
  135.   if( TosoProfileReadKeyOpen( "TSAMPLE", FALSE ) ) {
  136.     if( TosoProfileReadData( "Init", (LPBYTE) &INFHeader, sizeof( INFHeader ) ) )
  137.       Result = TRUE;
  138.     TosoProfileReadKeyClose();
  139.  
  140.     INFHeader.TimeStamp[31] = 0x00;
  141.     if( lstrcmp( INFHeader.TimeStamp, USER_DATA_ID ) )
  142.       Result = FALSE;
  143.   }
  144.  
  145.   if( !Result ) {
  146.     INFHeader.Data.IndentNum = 6;
  147.     INFHeader.Data.UseFlag   = STAR_USE_NULL;
  148.   }
  149.   return( Result );
  150. }
  151.  
  152. //------------------------------------------------------------------------------------------------------
  153. // Saves the module's settings to the registry database.
  154.  
  155. BOOL ModuleSaveSettings( void )
  156. {
  157.   BOOL          Result = FALSE;
  158.  
  159.   if( TosoProfileWriteKeyOpen( "TSAMPLE", FALSE ) ) {
  160.     lstrcpy( INFHeader.TimeStamp, USER_DATA_ID );
  161.     if( TosoProfileWriteData( "Init", (LPBYTE) &INFHeader, sizeof( INFHeader ) ) )
  162.       Result = TRUE;
  163.     TosoProfileWriteKeyClose();
  164.   }
  165.   return( Result );
  166. }
  167.  
  168. //------------------------------------------------------------------------------------------------------
  169. // Callback procedure for dialog box handling of DialogEditParameters(). This procedure handles all
  170. // messages sent to the dialog window.
  171.  
  172. BOOL CALLBACK DialogEditParametersManage( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
  173. {
  174.   static HWND   hOldFocus;
  175.   DUMMYSTR      DummyStr;
  176.   int           DummyInt;
  177.  
  178.   switch( message ) {
  179.     case WM_INITDIALOG:                         // Initialize dialog box
  180.       TosoDialogCenter( hDlg );
  181.       SetWindowText( hDlg, gCaption );
  182.  
  183. // Convert the current indent number to a string that can be set to an edit field.
  184.  
  185.       wsprintf( DummyStr, "%d", gCopyProperty.IndentNum );
  186.       SetDlgItemText( hDlg, IDD_EDIT0, DummyStr );
  187.  
  188. // Set the focus to the first edit field and highlight the complete content of that edit field.
  189.  
  190.       Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  191.       hOldFocus = SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  192.       return( FALSE );
  193.  
  194.  
  195.     case WM_COMMAND:
  196.       switch( GET_WM_COMMAND_ID( wParam, lParam ) ) {
  197.         case IDD_OK:                            // OK
  198.  
  199. // Read the indent number from the edit field and convert it to an integer value.
  200.  
  201.           GetDlgItemText( hDlg, IDD_EDIT0, DummyStr, NAME_LENGTH_EDIT );
  202.           if( sscanf( DummyStr, "%d", &DummyInt ) != 1 ) {
  203.             MessageBox( hDlg, eMessageText[3], eDialogText[0], MB_OK );
  204.  
  205.             Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  206.             SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  207.             return( TRUE );
  208.           }
  209.  
  210. // Check wether the stated indent number is within range. If not, display a message and set the
  211. // focus to the according edit field.
  212.  
  213.           if( DummyInt < STAR_INDENT_MIN || DummyInt > STAR_INDENT_MAX ) {
  214.             MessageBox( hDlg, eMessageText[3], eDialogText[0], MB_OK );
  215.  
  216.             Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  217.             SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  218.             return( TRUE );
  219.           }
  220.           gCopyProperty.IndentNum = DummyInt;
  221.  
  222.           gCopyProperty.UseFlag = STAR_USE_ALL;
  223.  
  224.           gExitDialog = IDD_OK;
  225.           SetFocus( hOldFocus );
  226.           EndDialog( hDlg, TRUE );
  227.           return( TRUE );
  228.  
  229.         case IDD_CANCEL:
  230.           gExitDialog = IDD_CANCEL;
  231.           SetFocus( hOldFocus );
  232.           EndDialog( hDlg, TRUE );
  233.           return( TRUE );
  234.       }
  235.       break;
  236.  
  237. // Help message detection and processing
  238.  
  239.     case WM_ENTERIDLE:
  240.       return( TosoDialogEnterIdle( hDlg, wParam, lParam ) );
  241.  
  242.     default:
  243.       if( message == TosoDialogHelpMessage() ) {
  244.         FILENAME    FileName;
  245.         TosoFileApplicationPath( "TSAMPLE.HLP", FileName );
  246.         WinHelp( hDlg, FileName, HELP_CONTEXT, gCommandID );
  247.         return( TRUE );
  248.       }
  249.       break;
  250.   }
  251.   return( FALSE );
  252. }
  253.  
  254. //------------------------------------------------------------------------------------------------------
  255. // This procedure displays and manages the parameter dialog for the command "Star" that this module
  256. // offers to the user.
  257.  
  258. BOOL DialogEditParameters( HWND hMainWnd, LPSTR Caption, PROPERTY_DATA* Data )
  259. {
  260.   lstrcpy( gCaption, Caption );
  261.  
  262. // Copy the current settings to the temporary copy in order to be able to restore the values if
  263. // the user cancels the dialog.
  264.  
  265.   gCopyProperty = *Data;
  266.   gCopyProperty.UseFlag = STAR_USE_NULL;
  267.  
  268. // Call and process the dialog window.
  269.  
  270.   if( DialogBox( hLanguage, "EDITPARAM", hMainWnd, DialogEditParametersManage ) == -1 ) {
  271.     MessageBox( hMainWnd, eMessageText[1], eDialogText[0], MB_OK );
  272.     return( FALSE );
  273.   }
  274.  
  275. // Check whether the user canceled the dialog or not. If he pressed OK, copy the new values to
  276. // the current settings.
  277.  
  278.   if( gExitDialog == IDD_CANCEL ) {
  279.     return( FALSE );
  280.   }
  281.   else {
  282.     *Data = gCopyProperty;
  283.     return( TRUE );
  284.   }
  285. }
  286.  
  287. //------------------------------------------------------------------------------------------------------
  288. // Callback procedure for dialog box handling of DialogEditParameters__(). This procedure handles all
  289. // messages sent to the dialog window.
  290.  
  291. BOOL CALLBACK DialogEditParametersManage__( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
  292. {
  293.   static HWND   hOldFocus;
  294.   static BOOL   ChangeFlag;
  295.   DUMMYSTR      DummyStr;
  296.   int           DummyInt;
  297.  
  298.   switch( message ) {
  299.     case WM_INITDIALOG:                         // Initialize dialog box
  300.       TosoDialogCenter( hDlg );
  301.       SetWindowText( hDlg, gCaption );
  302.  
  303. // Convert the current indent number to a string that can be set to an edit field.
  304.  
  305.       ChangeFlag = FALSE;
  306.       wsprintf( DummyStr, "%d", gCopyProperty.IndentNum );
  307.       SetDlgItemText( hDlg, IDD_EDIT0, DummyStr );
  308.       ChangeFlag = TRUE;
  309.  
  310. // Set the focus to the first edit field and highlight the complete content of that edit field.
  311.  
  312.       Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  313.       hOldFocus = SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  314.       return( FALSE );
  315.  
  316.  
  317.     case WM_COMMAND:
  318.       switch( GET_WM_COMMAND_ID( wParam, lParam ) ) {
  319.         case IDD_CHECK0:                                                        // USE_INDENTNUM
  320.           gCopyProperty.UseFlag ^= STAR_USE_INDENTNUM;                          // Set corresponding bit
  321.           CheckDlgButton( hDlg, IDD_CHECK0, gCopyProperty.UseFlag & STAR_USE_INDENTNUM );
  322.           return( TRUE );
  323.  
  324.         case IDD_EDIT0:
  325.           if( GET_WM_COMMAND_CMD( wParam, lParam ) == EN_CHANGE && ChangeFlag ) {
  326.             gCopyProperty.UseFlag |= STAR_USE_INDENTNUM;                        // Set corresponding bit
  327.             CheckDlgButton( hDlg, IDD_CHECK0, gCopyProperty.UseFlag & STAR_USE_INDENTNUM );
  328.           }
  329.           return( TRUE );
  330.  
  331.         case IDD_OK:                            // OK
  332.  
  333. // Read the indent number from the edit field and convert it to an integer value.
  334.  
  335.           GetDlgItemText( hDlg, IDD_EDIT0, DummyStr, NAME_LENGTH_EDIT );
  336.           if( sscanf( DummyStr, "%d", &DummyInt ) != 1 ) {
  337.             MessageBox( hDlg, eMessageText[3], eDialogText[0], MB_OK );
  338.  
  339.             Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  340.             SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  341.             return( TRUE );
  342.           }
  343.  
  344. // Check wether the stated indent number is within range. If not, display a message and set the
  345. // focus to the according edit field.
  346.  
  347.           if( DummyInt < STAR_INDENT_MIN || DummyInt > STAR_INDENT_MAX ) {
  348.             MessageBox( hDlg, eMessageText[3], eDialogText[0], MB_OK );
  349.  
  350.             Edit_SetSel( GetDlgItem( hDlg, IDD_EDIT0 ), 0, -1 );
  351.             SetFocus( GetDlgItem( hDlg, IDD_EDIT0 ) );    
  352.             return( TRUE );
  353.           }
  354.           gCopyProperty.IndentNum = DummyInt;
  355.  
  356.           gExitDialog = IDD_OK;
  357.           SetFocus( hOldFocus );
  358.           EndDialog( hDlg, TRUE );
  359.           return( TRUE );
  360.  
  361.         case IDD_CANCEL:
  362.           gExitDialog = IDD_CANCEL;
  363.           SetFocus( hOldFocus );
  364.           EndDialog( hDlg, TRUE );
  365.           return( TRUE );
  366.       }
  367.       break;
  368.  
  369. // Help message detection and processing
  370.  
  371.     case WM_ENTERIDLE:
  372.       return( TosoDialogEnterIdle( hDlg, wParam, lParam ) );
  373.  
  374.     default:
  375.       if( message == TosoDialogHelpMessage() ) {
  376.         FILENAME    FileName;
  377.         TosoFileApplicationPath( "TSAMPLE.HLP", FileName );
  378.         WinHelp( hDlg, FileName, HELP_CONTEXT, gCommandID );
  379.         return( TRUE );
  380.       }
  381.       break;
  382.   }
  383.   return( FALSE );
  384. }
  385.  
  386. //------------------------------------------------------------------------------------------------------
  387. // This procedure displays and manages the parameter dialog for the command "Star" that this module
  388. // offers to the user.
  389.  
  390. BOOL DialogEditParameters__( HWND hMainWnd, LPSTR Caption, PROPERTY_DATA* Data )
  391. {
  392.   lstrcpy( gCaption, Caption );
  393.  
  394. // Copy the current settings to the temporary copy in order to be able to restore the values if
  395. // the user cancels the dialog.
  396.  
  397.   gCopyProperty = *Data;
  398.  
  399. // Call and process the dialog window.
  400.  
  401.   if( DialogBox( hLanguage, "EDITPARAM__", hMainWnd, DialogEditParametersManage__ ) == -1 ) {
  402.     MessageBox( hMainWnd, eMessageText[1], eDialogText[0], MB_OK );
  403.     return( FALSE );
  404.   }
  405.  
  406. // Check whether the user canceled the dialog or not. If he pressed OK, copy the new values to
  407. // the current settings.
  408.  
  409.   if( gExitDialog == IDD_CANCEL ) {
  410.     return( FALSE );
  411.   }
  412.   else {
  413.     *Data = gCopyProperty;
  414.     return( TRUE );
  415.   }
  416. }
  417.  
  418. //------------------------------------------------------------------------------------------------------
  419. // This procedure is used to calculate the polygon corner points of a star.
  420.  
  421. int CommandCalculateStar( const DPOINT* p1, const DPOINT* p2, const DPOINT* p3, const DPOINT* p4,
  422.                           int IndentNum, DPOINT* Result )
  423. {
  424.   double        dx, dy, r1, r2, Rotation, Angle1, Angle2, Step;
  425.   int           Count, Index;
  426.  
  427. // Calculation of rotation angle (distance p1 - p4)
  428.  
  429.   dx = p4->x - p1->x;
  430.   dy = p4->y - p1->y;
  431.   Rotation = calc_atan( dx, dy );
  432.  
  433. // Calculation of the first radius (distance p1 - p2)
  434.  
  435.   dx = p2->x - p1->x;
  436.   dy = p2->y - p1->y;
  437.   r1 = sqrt( dx * dx + dy * dy );
  438.  
  439. // Calculation of the second radius (distance p1 - p3)
  440.  
  441.   dx = p3->x - p1->x;
  442.   dy = p3->y - p1->y;
  443.   r2 = sqrt( dx * dx + dy * dy );
  444.  
  445. // Step angle
  446.  
  447.   Step = REAL_2PI / IndentNum;
  448.  
  449. // Calculation of point pairs with an offset of 1/2 step
  450.  
  451.   Angle1 = Rotation;
  452.   Angle2 = Rotation + 0.5 * Step;
  453.  
  454.   Index = 0;
  455.   for( Count = 0; Count < IndentNum; Count++ ) {
  456.     Result[Index  ].x = p1->x + cos( Angle1 ) * r2;
  457.     Result[Index++].y = p1->y + sin( Angle1 ) * r2;
  458.     Result[Index  ].x = p1->x + cos( Angle2 ) * r1;
  459.     Result[Index++].y = p1->y + sin( Angle2 ) * r1;
  460.     Angle1 += Step;
  461.     Angle2 += Step;
  462.   }
  463.  
  464. // Number of calculated points
  465.  
  466.   return( Index );
  467. }
  468.  
  469. //------------------------------------------------------------------------------------------------------
  470. // This procedure creates an object of types "Surface" and fills it with required definition points to
  471. // build a star.
  472.  
  473. BOOL CommandFinishStar( const DPOINT* Point1, const DPOINT* Point2, const DPOINT* Point3, const DPOINT* Point4,
  474.                         int IndentNum, const XPROPERTY* XProperty )
  475. {
  476.   UNIT_OBJECT_PTR       ObjObj;
  477.   int                   Total, Count;
  478.   BOOL                  Result = TRUE;
  479.  
  480. // Room to store the polygon point of the calculated star.
  481.  
  482.   DPOINT        Poly[STAR_INDENT_MAX*2];
  483.  
  484. // Fill the array Poly[] with a list of point coordinates
  485.  
  486.   Total = CommandCalculateStar( Point1, Point2, Point3, Point4, IndentNum, Poly );
  487.  
  488. // Open an object of "Surface"
  489.  
  490.   ObjObj = TosoObjectOpen( OBJ_SURFACE );
  491.   if( XProperty )
  492.     ObjObj->XProperty = *XProperty;
  493.  
  494. // Add the start-point of the polygon
  495.  
  496.   TosoObjectAddPoint( DB_POINT_START, Poly[0].x, Poly[0].y );
  497.  
  498. // Add all further points as end-point
  499.  
  500.   for( Count = 1; Count < Total; Count++ )
  501.     TosoObjectAddPoint( DB_POINT_END, Poly[Count].x, Poly[Count].y );
  502.  
  503. // Close the object, initialize its properties and insert it into the current drawing
  504.  
  505.   if( !TosoObjectFastInsert() )
  506.     Result = FALSE;
  507.  
  508.   return( Result );
  509. }
  510.  
  511. //------------------------------------------------------------------------------------------------------
  512. // This procedure creates an object of types "Surface" and fills it with required definition points to
  513. // build a star.
  514.  
  515. BOOL CommandFinishUserStar( const DPOINT* Point1, const DPOINT* Point2, const DPOINT* Point3, const DPOINT* Point4,
  516.                             int IndentNum, const XPROPERTY* XProperty )
  517. {
  518.   BOOL                  Result = TRUE;
  519.   DUMMYSTR              GroupName;
  520.   UNIT_BLOCK_PTR        BlockObj;
  521.   UNIT_USER_PTR         UserObj;
  522.  
  523. // Create a group and fill it with a polyline
  524.  
  525.   if( BlockObj = TosoGroupOpen() ) {
  526.     lstrcpy( GroupName, BlockObj->BlockName );
  527.     if( !CommandFinishStar( Point1, Point2, Point3, Point4, IndentNum, XProperty ) )
  528.       Result = FALSE;
  529.     if( !TosoGroupFastInsert( FALSE, NULL ) )
  530.       Result = FALSE;
  531.   }
  532.   else
  533.     Result = FALSE;
  534.  
  535. // Create a user-defined object referencing the previously created group
  536.  
  537.   if( UserObj = TosoUserOpen( DB_OWNER_TOSO, OBJ_TS_STAR ) ) {
  538.     lstrcpy( UserObj->LibraryName, TVG_BLOCK_ID );
  539.     lstrcpy( UserObj->BlockName,   GroupName );
  540.  
  541.     if( XProperty )
  542.       UserObj->XProperty = *XProperty;
  543.  
  544. // Add all data that is required to completely regenerate the star
  545.  
  546.     TosoUserAddDataBlock( DB_POINT_CENTER, DB_TYPE_POINT,  1, (const LPVOID) Point1,     sizeof( DPOINT ) );
  547.     TosoUserAddDataBlock( DB_POINT_RADIUS, DB_TYPE_POINT,  1, (const LPVOID) Point2,     sizeof( DPOINT ) );
  548.     TosoUserAddDataBlock( DB_POINT_RADIUS, DB_TYPE_POINT,  1, (const LPVOID) Point3,     sizeof( DPOINT ) );
  549.     TosoUserAddDataBlock( DB_POINT_ANGLE,  DB_TYPE_POINT,  1, (const LPVOID) Point4,     sizeof( DPOINT ) );
  550.     TosoUserAddDataBlock( 1000,            DB_TYPE_LONG,   1, (const LPVOID) &IndentNum, sizeof( long ) );
  551.   }
  552.   else
  553.     Result = FALSE;
  554.  
  555.   return( Result );
  556. }
  557.  
  558. //------------------------------------------------------------------------------------------------------
  559. // This procedure is called by the serving application during the execution of the module-supplied
  560. // command "Star". It is called each time the entry of a new point is about to start.
  561.  
  562. int TosoInputPointInitProc( int CommandID, int PointIndex, double XPos, double YPos )
  563. {
  564.  
  565. // There is no need to initialize anything, so return immediately.
  566.  
  567.   return( INPUT_OK );
  568. }
  569.  
  570. //------------------------------------------------------------------------------------------------------
  571. // This procedure is called by the serving application during the execution of the module-supplied
  572. // command "Star". It is called at least once each time the user move the cursor.
  573.  
  574. BOOL TosoInputPointMoveProc( int CommandID, int PointIndex, double XPos, double YPos )
  575. {
  576.  
  577. // The only action required is to store the current point's coordinates. These coordinate will be used
  578. // to draw the "rubber lines" within the procedure TosoInputDisplayProc() and later on to create the
  579. // object within the procedure TosoInputFinishProc().
  580. // It will suffice if the coordinate are only stored at this one location since TosoInputPointMoveProc()
  581. // will at least be called once with the final coordinate of each point.
  582.  
  583.   gPoint[PointIndex].x = XPos;
  584.   gPoint[PointIndex].y = YPos;
  585.  
  586.   return( TRUE );
  587. }
  588.  
  589. //------------------------------------------------------------------------------------------------------
  590. // This procedure is called by the serving application during the execution of the module-supplied
  591. // command "Star". It is called each time the entry of a point is to be finished.
  592.  
  593. int TosoInputPointExitProc( int CommandID, int PointIndex, double XPos, double YPos )
  594. {
  595.  
  596. // There is no need to do anything, so return immediately. The final point coordinate that are passed
  597. // in XPos and YPos should have already been saved in the TosoInputPoitMoveProc(), so there is no need
  598. // to do it here again.
  599.  
  600.   return( INPUT_OK );
  601. }
  602.  
  603. //------------------------------------------------------------------------------------------------------
  604. // This procedure is called by the serving application during the execution of the module-supplied
  605. // command "Star". It is called each time the module has to update the "rubber lines" displaying the
  606. // current input status on the screen.
  607. // Since the given hDrawDC is using an reversing pen, both "display" and "hide" require the same
  608. // drawing operations.
  609.  
  610. void TosoInputDisplayProc( int CommandID, int PointIndex, HDC hDrawDC, BOOL DrawFixed, BOOL DrawVariable )
  611. {
  612.   int           Total, Count;
  613.  
  614. // Room to store the polygon point of the calculated star.
  615.  
  616.   DPOINT        Poly[STAR_INDENT_MAX*2];
  617.  
  618.   switch( CommandID ) {
  619.     case 1:                             // Star
  620.     case 2:                             // Star
  621.  
  622. // First step: draw all rubber lines that do not change due to mouse movement.
  623.  
  624.       if( DrawFixed ) {
  625.  
  626. // Point index 0: No stable rubber lines.
  627.  
  628.         if( PointIndex == 0 ) {
  629.  
  630.         }
  631.  
  632. // Point index 1: No stable rubber lines.
  633.  
  634.         if( PointIndex == 1 ) {
  635.  
  636.         }
  637.  
  638. // Point index 2: Circle through point index 1
  639.  
  640.         if( PointIndex == 2 ) {
  641.           TosoInputDrawCircle( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[1].x, gPoint[1].y );
  642.         }
  643.  
  644. // Point index 3: Circle through point index 1 and point index 2
  645.  
  646.         if( PointIndex == 3 ) {
  647.           TosoInputDrawCircle( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[1].x, gPoint[1].y );
  648.           TosoInputDrawCircle( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[2].x, gPoint[2].y );
  649.         }
  650.       }
  651.  
  652. // Second step: draw all rubber lines that do change due to mouse movement.
  653.  
  654.       if( DrawVariable ) {
  655.  
  656. // Point index 0: No rubber lines visible during entry of first point (center).
  657.  
  658.         if( PointIndex == 0 ) {
  659.  
  660.         }
  661.  
  662. // Point index 1: Display a circle defined by point index 0 (center) and point index 1 (radius 1)
  663.  
  664.         if( PointIndex == 1 ) {
  665.           TosoInputDrawCircle( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[1].x, gPoint[1].y );
  666.         }
  667.  
  668. // Point index 2: Calculate and display a complete star based on point index 0 (center), point
  669. //                index 1 (radius 1) and point index 2 (radius 2).
  670.  
  671.         if( PointIndex == 2 ) {
  672.           TosoInputDrawCircle( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[2].x, gPoint[2].y );
  673.  
  674.           Total = CommandCalculateStar( gPoint + 0, gPoint + 1, gPoint + 2, gPoint + 0,
  675.                                         INFHeader.Data.IndentNum, Poly );
  676.  
  677.           for( Count = 1; Count < Total; Count++ )
  678.             TosoInputDrawLine( hDrawDC, Poly[Count-1].x, Poly[Count-1].y, Poly[Count].x, Poly[Count].y );
  679.  
  680.           TosoInputDrawLine( hDrawDC, Poly[Total-1].x, Poly[Total-1].y, Poly[0].x, Poly[0].y );
  681.         }
  682.  
  683. // Point index 3: Calculate and display a complete star based on point index 0 (center), point
  684. //                index 1 (radius 1), point index 2 (radius 2) and point index 3 (angle)
  685.  
  686.         if( PointIndex == 3 ) {
  687.           TosoInputDrawLine( hDrawDC, gPoint[0].x, gPoint[0].y, gPoint[3].x, gPoint[3].y );
  688.  
  689.           Total = CommandCalculateStar( gPoint + 0, gPoint + 1, gPoint + 2, gPoint + 3,
  690.                                         INFHeader.Data.IndentNum, Poly );
  691.  
  692.           for( Count = 1; Count < Total; Count++ )
  693.             TosoInputDrawLine( hDrawDC, Poly[Count-1].x, Poly[Count-1].y, Poly[Count].x, Poly[Count].y );
  694.  
  695.           TosoInputDrawLine( hDrawDC, Poly[Total-1].x, Poly[Total-1].y, Poly[0].x, Poly[0].y );
  696.         }
  697.       }
  698.       break;
  699.   }
  700. }
  701.  
  702. //------------------------------------------------------------------------------------------------------
  703. // This procedure is called by the serving application during the execution of the module-supplied
  704. // command "Star". It is called each time the user wants to edit the parameters of the currently active
  705. // command.
  706.  
  707. BOOL TosoInputParameterProc( int CommandID )
  708. {
  709.   gCommandID = CommandID;
  710.  
  711.   switch( CommandID ) {
  712.     case 1:                             // Star
  713.     case 2:                             // Star
  714.  
  715. // Display the parameter dialog window. If the parameters are changed (i.e. if DialogEditParameters()
  716. // return TRUE, do also return TRUE to indicate the serving application that parameters of the
  717. // currently active command have changed, i.e. this command should be re-initialised.
  718.  
  719.       return( DialogEditParameters( hGlobalWnd, eCommandName[0], &INFHeader.Data ) );
  720.   }
  721. }
  722.  
  723. //------------------------------------------------------------------------------------------------------
  724. // This procedure is called by the serving application during the execution of the module-supplied
  725. // command "Star". It is called each time the user explicity canceles the currently active command
  726. // by pressing the right mouse button. If the current command were a command that requires a non-fixed
  727. // number of point entries, this is the place to terminate the command by returning INPUT_FINISH. If
  728. // the current allowed parameters to be editing DURING its execution (like the serving application's
  729. // DRAW > CURVE command), this is the right place to display a corresponding dialog window.
  730.  
  731. int TosoInputCancelProc( int CommandID, int PointCount )
  732. {
  733.   return( INPUT_CANCEL );
  734. }
  735.  
  736. //------------------------------------------------------------------------------------------------------
  737. // This procedure is called by the serving application during the execution of the module-supplied
  738. // command "Star". It is called each time the user has successfully enteres all required points, i.e.
  739. // the command is finished and the resulting actions are to be performed.
  740.  
  741. void TosoInputFinishProc( int CommandID, int PointCount )
  742. {
  743.   BOOL          Result = TRUE;
  744.  
  745. // Tell the interface that some objects are to be created.
  746.  
  747.   if( !TosoCreationStart() )
  748.     return;
  749.  
  750. // Start a new undo level. All objects created since now can either now be inserted to the drawing by
  751. // calling TosoUndoFinishProcess() or can be deleted by calling TosoUndoCancelProcess().
  752.  
  753.   TosoUndoInitProcess();
  754.  
  755. // Execute the command, i.e. calculate the resulting polygon and create an object of type "Surface"
  756. // based on that calculation.
  757.  
  758.   switch( CommandID ) {
  759.     case 1:                             // Star
  760.       if( !CommandFinishStar( gPoint, gPoint+1, gPoint+2, gPoint+3, INFHeader.Data.IndentNum, NULL ) )
  761.         Result = FALSE;
  762.       break;
  763.  
  764.     case 2:                             // Star
  765.       if( !CommandFinishUserStar( gPoint, gPoint+1, gPoint+2, gPoint+3, INFHeader.Data.IndentNum, NULL ) )
  766.         Result = FALSE;
  767.  
  768.       if( !TosoUserFastInsert() )
  769.         Result = FALSE;
  770.       break;
  771.   }
  772.  
  773. // If creation was successful, end the newly created undo level (which inserts all objects to the
  774. // current drawing) and draw all newly created objects. Else, delete all newly created objects by
  775. // canceling the undo level.
  776.   
  777.   if( Result ) {
  778.     TosoUndoFinishProcess();
  779.     TosoUndoUpdateLinks();
  780.     TosoDrawNewObjects();
  781.   }
  782.   else
  783.     TosoUndoCancelProcess();
  784.  
  785. // Tell the interface that the object creation was ended.
  786.  
  787.   TosoCreationEnd();
  788. }
  789.  
  790. //------------------------------------------------------------------------------------------------------
  791. // This DLL entry procedure must exist in any DLL to be used in Win32. Since our DLL does all necessary
  792. // initialization in its TosoModuleInit() procedure, this procedure is quite empty.
  793.  
  794. BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD Reason, LPVOID Dummy )
  795. {
  796.   switch( Reason ) {
  797.     case DLL_PROCESS_ATTACH:
  798.       hInstDLL = hInstance;
  799.       break;
  800.  
  801.     case DLL_PROCESS_DETACH:
  802.       hInstDLL = NULL;
  803.       break;
  804.   }
  805.   return( TRUE );
  806. }
  807.  
  808. //------------------------------------------------------------------------------------------------------
  809. // This procedure is called when the module is loaded by the serving application. Its main tasks are:
  810. // - Checking whether it is compatible with the given InterfaceVersion
  811. // - Checking whether it is licensed to the given serial number (optional)
  812. // - Storing of the serving application's instance and main windows handle for further use
  813. // - Loading of the language-dependent library
  814. // - Filling in the module ID structure whose address is passed in ModuleID
  815. // - Loading of options from the registry database
  816. // - Loading profiles
  817. // - Allocating any static memory required
  818.  
  819. DLL_EXPORT int TosoModuleInit( const LPSTR SerialNumber, HINSTANCE hMainInst, HWND hMainWnd,
  820.                                                          int InterfaceVersion, MODULE_ID* ModuleID )
  821. {
  822.   int           Count;
  823.  
  824.   if( InterfaceVersion < TOSO_MODULE_VERSION ) {
  825.     MessageBox( hMainWnd, eMessageText[0], eDialogText[0], MB_OK );
  826.     return( 0 );
  827.   }
  828.   hGlobalInst = hMainInst;
  829.   hGlobalWnd  = hMainWnd;
  830.  
  831. // Load the command icon bitmap from the language DLL.
  832.  
  833.   hLanguage = LoadLibrary( "TSAMPLE.DLL" );
  834.   hBitmap = LoadBitmap( hLanguage, "IDB_COMMAND" );
  835.  
  836. // Fill the module information data block
  837.  
  838.   ModuleID->OwnerID    = DB_OWNER_TOSO;
  839.   ModuleID->ModuleID   = 0x0000;
  840.   ModuleID->ModuleCTRL = MODULECTRL_ALL;
  841.  
  842.   ModuleID->ModuleProc.InputPointInitProc = (TOSOINPUTPOINTINIT_PROC) TosoInputPointInitProc;
  843.   ModuleID->ModuleProc.InputPointMoveProc = (TOSOINPUTPOINTMOVE_PROC) TosoInputPointMoveProc;
  844.   ModuleID->ModuleProc.InputPointExitProc = (TOSOINPUTPOINTEXIT_PROC) TosoInputPointExitProc;
  845.   ModuleID->ModuleProc.InputDisplayProc   = (TOSOINPUTDISPLAY_PROC)   TosoInputDisplayProc;
  846.   ModuleID->ModuleProc.InputParameterProc = (TOSOINPUTPARAMETER_PROC) TosoInputParameterProc;
  847.   ModuleID->ModuleProc.InputCancelProc    = (TOSOINPUTCANCEL_PROC)    TosoInputCancelProc;
  848.   ModuleID->ModuleProc.InputFinishProc    = (TOSOINPUTFINISH_PROC)    TosoInputFinishProc;
  849.  
  850.   ModuleID->ModuleData.Type = MODULETYPE_DRAW;
  851.  
  852.   ModuleID->ModuleData.InputData.CommandMode = COMMAND_DIRECT;
  853.   ModuleID->ModuleData.MenuData.MenuEntry   = eStartUpText[1];
  854.   ModuleID->ModuleData.MenuData.Description = eStartUpText[2];
  855.  
  856.   ModuleID->ModuleData.IconHandle  = hBitmap;
  857.   ModuleID->ModuleData.IconXOffset = 0;
  858.   ModuleID->ModuleData.IconYOffset = 0;
  859.   ModuleID->ModuleData.IconMode    = 0;
  860.  
  861.   ModuleID->CommandData = CommandData;
  862.   ModuleID->VendorData  = NULL;
  863.  
  864. // Fill in the commands' names and the accompanying information.
  865.  
  866.   Count = 0;
  867.   while( eCommandEntry[Count] == NULL || eCommandEntry[Count][0] != END_CHAR ) {
  868.     CommandData[Count].InputData.CommandMode = COMMAND_DIRECT;
  869.     CommandData[Count].MenuData.MenuEntry   = eCommandEntry[Count];
  870.     CommandData[Count].MenuData.Description = eCommandName [Count];
  871.  
  872.     CommandData[Count].IconHandle  = hBitmap;
  873.     CommandData[Count].IconXOffset = 0;
  874.     CommandData[Count].IconYOffset = ( Count + 1 ) * 48;
  875.     CommandData[Count].IconMode    = 0;
  876.  
  877.     if( eCommandEntry[Count] )
  878.       CommandData[Count].Type = IDM_ENTRY;
  879.     else
  880.       CommandData[Count].Type = IDM_ENTRY | IDM_SEPARATOR;
  881.  
  882.     Count++;
  883.   }
  884.   CommandData[Count].Type = IDM_END;
  885.  
  886. // Fill the command description structure with the predefined global structure gInfo.
  887.  
  888.   CommandData[0].InputData = gInfo[0];
  889.   CommandData[0].InputData.PointNames[1] = eNewPoint[0];
  890.   CommandData[0].InputData.PointNames[2] = eNewPoint[1];
  891.  
  892.   CommandData[1].InputData = CommandData[0].InputData;
  893.  
  894. // Read the current settings (set to their default values if not found)
  895.  
  896.   ModuleLoadSettings();
  897.  
  898.   return( TOSO_MODULE_VERSION );
  899. }
  900.  
  901. //------------------------------------------------------------------------------------------------------
  902. // This procedure is called when the module is removed by the serving application. Its main tasks are:
  903. // - Checking whether anything is to be saved. If so, it should display a message information the user
  904. //   about it and allowing him to save those changes.
  905. // - Freeing of all statically allocated memory.
  906. // If this procedure return FALSE, the serving application will not be able to terminate. So please, do
  907. // only return FALSE if shutting down the module now would severely damage or destroy user data.
  908.  
  909. DLL_EXPORT BOOL TosoModuleExit( void )
  910. {
  911.   ModuleSaveSettings();
  912.  
  913.   DeleteBitmap( hBitmap );
  914.  
  915.   return( TRUE );
  916. }
  917.  
  918. //------------------------------------------------------------------------------------------------------
  919. // This procedure is called when a user-defined object is altered. Each command module that handles
  920. // user-defined objects must contain such a procedure. When called, the module should test whether the
  921. // user-defined object pointed to by UserObj was created by itself. If so, it must react on the request
  922. // coded in ModifyMode.
  923.  
  924. DLL_EXPORT int TosoModuleModify( UNIT_USER_PTR UserObj, int ModifyMode, void* Data )
  925. {
  926.   DB_PTR_DECLARATION
  927.  
  928.   static PROPERTY_DATA  Property;
  929.   BOOL                  Result = TRUE;
  930.  
  931.   switch( ModifyMode ) {
  932.     case USER_MODIFY_INIT:                      // Regenerate the display block based on the current data
  933.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  934.         b1 = db_first( UserObj );
  935.         b2 = db_next( b1 );
  936.         b3 = db_next( b2 );
  937.         b4 = db_next( b3 );
  938.         b5 = db_next( b4 );
  939.  
  940.         if( TosoGroupOpen() ) {
  941.           if( !CommandFinishStar( db_data_point( b1 ), db_data_point( b2 ), db_data_point( b3 ), db_data_point( b4 ),
  942.                                   db_data_long( b5 )[0], &UserObj->XProperty ) )
  943.             Result = FALSE;
  944.           if( !TosoGroupApplyToUser( UserObj ) )
  945.             Result = FALSE;
  946.         }
  947.         else
  948.           Result = FALSE;
  949.  
  950.         if( Result )
  951.           return( USER_RETURN_DONE );
  952.       }
  953.       break;
  954.  
  955.     case USER_MODIFY_MATRIX:                    // Multiply with the matrix pointed to by Matrix.
  956.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  957.         TosoEditUnitPointsMatrix( (UNIT_PTR) UserObj, (const MATRIX*) Data );
  958.         return( USER_RETURN_DONE );
  959.       }
  960.       break;
  961.  
  962.     case USER_MODIFY_TITLE:                     // Return the title of the object.
  963.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  964.         lstrcpy( (LPSTR) Data, eDialogText[1] );
  965.         return( USER_RETURN_DONE );
  966.       }
  967.       break;
  968.  
  969.     case USER_MODIFY_TEXT:                      // Edit text, n/a for this module.
  970.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  971.         return( USER_RETURN_IGNORE );
  972.       }
  973.       break;
  974.  
  975.     case USER_MODIFY_PROPERTY_INIT:             // Initalize property editing.
  976.       Property.UseFlag = 0;
  977.       return( USER_RETURN_DONE );
  978.  
  979.     case USER_MODIFY_PROPERTY_FILL:             // Fill in property structure.
  980.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  981.         b1 = db_first( UserObj );
  982.         b2 = db_next( b1 );
  983.         b3 = db_next( b2 );
  984.         b4 = db_next( b3 );
  985.         b5 = db_next( b4 );
  986.         Property.IndentNum = db_data_long( b5 )[0];
  987.         return( USER_RETURN_DONE );
  988.       }
  989.       break;
  990.  
  991.     case USER_MODIFY_PROPERTY_SINGLE:           // Edit a single object's properties
  992.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  993.         if( DialogEditParameters( *( (HWND*) Data ), eDialogText[1], &Property ) )
  994.           return( USER_RETURN_DONE );
  995.         else
  996.           return( USER_RETURN_IGNORE );
  997.       }
  998.       break;
  999.  
  1000.     case USER_MODIFY_PROPERTY_MULTIPLE:         // Edit multiple objects' properties
  1001.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  1002.         if( DialogEditParameters__( *( (HWND*) Data ), eDialogText[1], &Property ) )
  1003.           return( USER_RETURN_DONE );
  1004.         else
  1005.           return( USER_RETURN_IGNORE );
  1006.       }
  1007.       break;
  1008.  
  1009.     case USER_MODIFY_PROPERTY_APPLY:            // Apply property structure.
  1010.       if( UserObj->Header.UnitOwner == DB_OWNER_TOSO && UserObj->UserType == OBJ_TS_STAR ) {
  1011.         b1 = db_first( UserObj );
  1012.         b2 = db_next( b1 );
  1013.         b3 = db_next( b2 );
  1014.         b4 = db_next( b3 );
  1015.         b5 = db_next( b4 );
  1016.  
  1017.         if( Property.UseFlag & STAR_USE_INDENTNUM )
  1018.           db_data_long( b5 )[0] = Property.IndentNum;
  1019.         return( USER_RETURN_DONE );
  1020.       }
  1021.       break;
  1022.  
  1023.     case USER_MODIFY_PROPERTY_EXIT:             // Exit property editing.
  1024.       // Nothing to do here...
  1025.       return( USER_RETURN_DONE );
  1026.   }
  1027.   return( USER_RETURN_UNKNOWN );
  1028. }
  1029.  
  1030. //------------------------------------------------------------------------------------------------------
  1031. // This procedure is called when a module's command is chosen by the user. For a command module, its
  1032. // main tasks are:
  1033. // - If requested, display the help topic for the given command
  1034. // - Execute the chosen command (if it is a "direct" command that does not require point entry)
  1035. // - Register an external command (if it is a "indirect" command that does require point entry)
  1036. // - Error handling and display
  1037.  
  1038. DLL_EXPORT BOOL TosoModuleCommand( int CommandID, int ExecMode )
  1039. {
  1040.   BOOL          Result = FALSE;
  1041.  
  1042.   switch( ExecMode ) {                  // Check which type of action is requested
  1043.  
  1044.     case MODULEEXEC_HELP:               // Display the corresponding help topic
  1045.       switch( CommandID ) {
  1046.         case 1:
  1047.         case 2:
  1048.         case 4:
  1049.           {
  1050.             FILENAME    FileName;
  1051.             TosoFileApplicationPath( "TSAMPLE.HLP", FileName );
  1052.             WinHelp( hGlobalWnd, FileName, HELP_CONTEXT, gCommandID );
  1053.           }
  1054.           break;
  1055.       }
  1056.       break;
  1057.  
  1058.     case MODULEEXEC_USER:               // Execute the command
  1059.     case MODULEEXEC_SYSTEM:
  1060.       gCommandID = CommandID;
  1061.       switch( CommandID ) {
  1062.         case 1:
  1063.           Result = TRUE;
  1064.  
  1065. // If the user has first selected the command from the menu, allow him to edit the parameters first.
  1066. // If the command does only use seldomly-modified parameters, this is NOT necessary.
  1067.  
  1068.           if( ExecMode == MODULEEXEC_USER ) {
  1069.             if( !DialogEditParameters( hGlobalWnd, eCommandName[0], &INFHeader.Data ) )
  1070.               Result = FALSE;
  1071.           }
  1072.           break;
  1073.  
  1074.         case 2:
  1075.           Result = TRUE;
  1076.  
  1077. // If the user has first selected the command from the menu, allow him to edit the parameters first.
  1078. // If the command does only use seldomly-modified parameters, this is NOT necessary.
  1079.  
  1080.           if( ExecMode == MODULEEXEC_USER ) {
  1081.             if( !DialogEditParameters( hGlobalWnd, eCommandName[1], &INFHeader.Data ) )
  1082.               Result = FALSE;
  1083.           }
  1084.           break;
  1085.  
  1086.         case 4:
  1087.           {
  1088.             DUMMYSTR    Text1, Text2;
  1089.             TOSO_GET_BUILD_DATE( Text2 );
  1090.             wsprintf( Text1, eStartUpText[0], Text2 );
  1091.             MessageBox( hGlobalWnd, Text1, eDialogText[0], MB_OK );
  1092.           }
  1093.           Result = TRUE;
  1094.           break;
  1095.       }
  1096.       break;
  1097.  
  1098.     case MODULEEXEC_GET_PROFILE:        // Read drawing-dependent data
  1099.       // Nothing to do here...
  1100.       break;
  1101.  
  1102.     case MODULEEXEC_SET_PROFILE:        // Write drawing-dependent data
  1103.       // Nothing to do here...
  1104.       break;
  1105.   }
  1106.   return( Result );
  1107. }
  1108.