plugin.cpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // PLUGIN.CPP
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // NOTE: The following is temporary until a custom AppWizard is created and
  22. // the process is refined to include Release versions of the lib and executable
  23. // for Plugeth.
  24. // NOTE: RSPXBlue.h is in ORANGE/MFC_CNTL.
  25. ///////////////////////////////////////////////////////////////////////////////
  26. // Plug-ins:
  27. // 1) To get started making your plug-in DLL, you must first create an
  28. // AppWizard DLL project. Choose an MFC Extension DLL as the way in which your
  29. // project uses MFC (on the first step dialog in the AppWizard).
  30. //
  31. // 2) Next, you need to add PlugIn.cpp (this file) and
  32. // \\narnia\apps\plugeth\plugethD.lib to your DLL project (although these files
  33. // are in orange you need to add them to your DLL project (not RSPiX Orange)).
  34. //
  35. // 3) For debugging, set the executable for debug session (under the Debug tab)
  36. // to \\narnia\apps\plugeth\plugethD.exe. You also may want to add a custom
  37. // build step to copy your DLL to wherever you are storing your plugins.
  38. //
  39. // 4) Add GetPlugInObject to your .def file under EXPORTS (if your project name
  40. // was "hosenbank", your .def file is hosenbank.def.
  41. //
  42. ///////////////////////////////////////////////////////////////////////////////
  43. ///////////////////////////////////////////////////////////////////////////////
  44. // Macros.
  45. ///////////////////////////////////////////////////////////////////////////////
  46. ///////////////////////////////////////////////////////////////////////////////
  47. // Includes.
  48. ///////////////////////////////////////////////////////////////////////////////
  49. #include "stdafx.h"
  50. #include "PlugIn/PlugIn.h"
  51. ///////////////////////////////////////////////////////////////////////////////
  52. // Instantiate static members.
  53. ///////////////////////////////////////////////////////////////////////////////
  54. #ifndef _WINDLL
  55. /*EXE2DLL*/ CImage* CPlugIn::ms_pimBuf = NULL; // The current buffer.
  56. /*EXE2DLL*/ CDialog* CPlugIn::ms_pdlg = NULL; // The Plugger dialog.
  57. /*EXE2DLL*/ CRSPiXBlue* CPlugIn::ms_prspix = NULL; // The RSPiX window.
  58. #endif
  59. ///////////////////////////////////////////////////////////////////////////////
  60. // Construction/Destruction.
  61. ///////////////////////////////////////////////////////////////////////////////
  62. ///////////////////////////////////////////////////////////////////////////////
  63. // Other members.
  64. ///////////////////////////////////////////////////////////////////////////////
  65. ///////////////////////////////////////////////////////////////////////////////
  66. //
  67. // These are automagically defined in the DLL. They return the timestamp of
  68. // this file and the size of the CPlugIn structure. The idea is that the EXE
  69. // can then check the values returned by this function against the timestamp of
  70. // the file and size of CPlugIn at the time of its compile and determine if
  71. // there's a potential synchronization issue with the communication structure.
  72. //
  73. ///////////////////////////////////////////////////////////////////////////////
  74. #ifdef _WINDLL
  75. DLL2EXE char* CPlugIn::GetDllMagicTime(void)
  76. {
  77. return m_szMagicTime;
  78. }
  79. #endif // _WINDLL
  80. #ifdef _WINDLL
  81. DLL2EXE long CPlugIn::GetDllMagicSize(void)
  82. {
  83. return m_lMagicSize;
  84. }
  85. #endif // _WINDLL
  86. ///////////////////////////////////////////////////////////////////////////////
  87. // EOF
  88. ///////////////////////////////////////////////////////////////////////////////