home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mesaaiok.zip / ReadMe.TXT < prev   
Text File  |  1996-01-06  |  6KB  |  133 lines

  1.  
  2. Mesa for OS/2 AddIn Object Kit
  3.  
  4. This package constitues a highly un-offical kit to aid in the development
  5. of AddIns for Athena Design's Mesa for OS/2 Spreadsheet.  The base
  6. functionallity and most of the documentation for the functions can be
  7. found in the EXTADDIN.H header file.  The only other piece of knowledge
  8. that is needed is your AddIn DLL must have these functions:
  9.  
  10. extern "C"
  11. {
  12. void AddInInit(void *);
  13. void AddInFree(void *);
  14. }
  15.  
  16. The AddInInit function is called when the DLL is loaded and ready for
  17. use.  In this function is where you would initialize any data, add menu
  18. items, register functions, etc...  AddInFree is called when the program
  19. terminates so that you can cleanup any code that needs to be cleaned up.
  20.  
  21. Also, when you compile, you need to create a DEF file for you DLL that
  22. contains exports for the above functions as well as the imports for the
  23. AddIn functions.  An example DEF file looks like:
  24. LIBRARY     SAMPADD INITINSTANCE TERMINSTANCE
  25.  
  26. DESCRIPTION 'The Mesa Sample AddIn DLL'
  27.  
  28. PROTMODE
  29.  
  30. DATA        MULTIPLE NONSHARED READWRITE LOADONCALL
  31.  
  32. CODE        LOADONCALL
  33.  
  34. EXPORTS
  35.             AddInInit
  36.             AddInFree
  37.             
  38. IMPORTS
  39.             MESACORE.performAddInFunction
  40.             MESACORE.MFree
  41.             MESACORE.MMalloc
  42.             MESACORE.MRealloc
  43.  
  44.  
  45. To get Mesa to recognize your AddIn, you need to add an entry to the Mesa
  46. section of the User INI file.  The REXX script:
  47.  
  48. Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  49. Call SysLoadFuncs
  50. SysIni("USER", "Mesa2", "AddIn 1", "MESASOLV")
  51.  
  52. will do the trick, but the proper way to do it would be to see if
  53. "AddIn 1" exists first and increment until you get to an "AddIn X"
  54. that doesn't exist yet. That way, you don't disable someone elses
  55. AddIn.
  56.  
  57. The RANGE.*, ADDIN.*, and MODEL.* are C++ classes to abstract the
  58. functionality into easy to use objects.  These objects were design with a
  59. minimalistic approach.  They do very little error detecting, etc... but I
  60. find it much easier to use the objects that trying to deal with the
  61. performAddInFunction() method of AddIn programming.  The header files for
  62. these classes constain some of the notes I discovered while programming
  63. them.  These notes are noted by a (*) in the comments.
  64.  
  65. Do to time constraints, etc... I can't fully support this code.  But if
  66. you do have comments, suggestions, bug fixes, etc... I'll be glad to here
  67. it.  I also may look into seeing if I can find the error codes for the
  68. errors and also the other action flags.  Suggestions for other AddIn
  69. functions can also be mailed to me.  If we do decide to enhance the AddIn
  70. functionality, I may look over the responses to decide which ones to
  71. implement first.  (Number one on my list is a
  72. registerRecalcDoneFunction)
  73.  
  74. As a sample of the AddIns, I have included a simple Goal Seeker AddIn
  75. along with the sorce code.  I a NOT a mathematician (or a speller for
  76. that matter :) so the algorithms probably suck, but it at least shows
  77. how to use the addins.  It also registers a BEEP(FREQUENCY,DURATION)
  78. function.  Just think, what other spreadsheet can play songs during a
  79. ReCalc.  :)  It also registers a NUMIN(ITEM,RANGE) that returns the
  80. count of the number of times ITEM appears in RANGE.  Also,
  81. LAYERNAME(LAYERNUMBER) returns the name of the layer.  MESASOLV.*
  82. handles the AddIn level code as well as the functions.  SOLVER.* is a
  83. solver object to handle the Goal Seeking.
  84.  
  85. Here are some suggestions for other AddIns:
  86. 1) Using the getMenuWindowMesaAddIn you can get the HWND for the menu.
  87.    You could reorganize the menu to match Lotus, Excel, etc....
  88. 2) More functions such as the erf() function, database lookup 
  89.    functions, etc....
  90. 3) You can create forms (dialogs) to enter data into the sheet.
  91. 4) A more robust solver than the one I wrote.
  92. 5) Many, many more things can be done.....
  93.  
  94.  
  95. Enjoy the AddIns,
  96. J. Daniel Kulp
  97. Software Development Engineer
  98. Athena Design, Inc.
  99. dkulp@athena.com,dkulp@ccs.neu.edu
  100. COMPUSERVE: 75052,1436
  101.  
  102. LEGAL STUFF:
  103. The AddIn code in Mesa is extremely minimal and for the most part
  104. un-tested.  Athena Design, being a relatively small company, doesn't have
  105. the resources to testing this completey.  Basically this means that you
  106. use this at your own risk.  We cannot offer support at this time.
  107. Remember that Mesa is a fast evolving product and as it changes, so may
  108. the AddIn code.  What works in the current version might not work in
  109. future versions.  Also, because the functions are for the most part
  110. untested, we cannot guarantee that any of it actually works.  Don't
  111. complain to us if something you need doesn't seem to work.  We also
  112. cannot guarantee that the AddIns won't change in future versions.  We may
  113. increase the functionality, we might not.  Querying the version number in
  114. the AddInInit() and taking appropriate action is probably a good idea.
  115.  
  116. The code contained herein by no means reflects the code used to create
  117. Mesa for OS/2.  This code is completely written by me using my code
  118. styles and to fullfill my wants/needs/desires. It should not be taken
  119. that any "bad" code styles found within this code reflect similar
  120. deficiencies in the Mesa code.  This code is COMPLETELY separate (except
  121. for EXTADDIN.H) from Mesa for OS/2.  Remember, the Mesa programmers
  122. are being paid to do things RIGHT.  I'm doing this on my own free
  123. time (not that I have much of it) so I tend to cut corners and
  124. simplify things when possible.
  125.  
  126. Trademarks and other stuff found in the code:
  127. Mesa  is a trademark of Athena Design, Inc.
  128. OS/2 is a registered trademark of IBM
  129. REXX is a tademark of IBM
  130. C-Set is a trademark of IBM
  131. VisualAge C++ is a trademark of IBM
  132.  
  133.