home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual Thematic 25: Programming / pc_actual_25.iso / C_C++ / RapidTranslation / data1.cab / Alles / Include / RapTraMFCFix.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-30  |  7.5 KB  |  239 lines

  1. /*****************************************************************
  2. ------------------------------------------------------------------
  3.  
  4.     RapTraMFCFix.h
  5.   
  6.     This header #define's macros that make virtual functions,
  7.     that have parameters of type CString, work correctly.
  8.  
  9.     Every time such a function is used, the correspondending macro
  10.     has to be used in the same public / protected / private section
  11.  
  12. ------------------------------------------------------------------
  13. *****************************************************************/
  14.  
  15.  
  16. /*****************************************************************
  17. ------------------------------------------------------------------
  18.  
  19.     #define macros for every mfc class that has a virtual function
  20.     with parameter CString
  21.  
  22. ------------------------------------------------------------------
  23. *****************************************************************/
  24.  
  25.  
  26. /*****************************************************************
  27.  
  28.     class CDaoRecordset
  29.  
  30. *****************************************************************/
  31.  
  32. // CString CDaoRecordset::GetDefaultDBName()
  33. #define RTFIX_CDAORECORDSET_GETDEFAULTDBNAME() \
  34.     virtual __Y_CString GetDefaultDBName() \
  35.     { return GetDefaultDBName(); } \
  36.  
  37. // CString CDaoRecordset::GetDefaultSQL()
  38. #define RTFIX_CDAORECORDSET_GETDEFAULTSQL() \
  39.     virtual __Y_CString GetDefaultSQL() \
  40.     { return GetDefaultSQL(); } \
  41.  
  42.  
  43. /*****************************************************************
  44.  
  45.     class CDocManager
  46.  
  47. *****************************************************************/
  48.  
  49. // BOOL CDocManager::DoPromptFileName(CString&, UINT, DWORD, BOOL, CDocTemplate*);
  50. #define RTFIX_CDOCMANAGER_DOPROMPTFILENAME() \
  51.     virtual BOOL DoPromptFileName(__Y_CString& fileName, UINT nIDSTitle, \
  52.         DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate) \
  53.     { return DoPromptFileName((__X_CString&)fileName, nIDSTitle, lFlags, bOpenFileDialog, pTemplate); } \
  54.  
  55.  
  56. /*****************************************************************
  57.  
  58.     class CDocTemplate
  59.  
  60. *****************************************************************/
  61.  
  62. // BOOL CDocTemplate::GetDocString(CString&, enum DocStringIndex);
  63. #define RTFIX_CDOCTEMPLATE_GETDOCSTRING() \
  64.     virtual BOOL GetDocString(__Y_CString& rString,    enum DocStringIndex index) const  \
  65.     { return GetDocString((__X_CString&)rString, index); } \
  66.  
  67.  
  68. /*****************************************************************
  69.  
  70.     class COleServerDoc
  71.  
  72. *****************************************************************/
  73.  
  74. // BOOL COleServerDoc::GetFileTypeString(CString& rString);
  75. #define RTFIX_COLESERVERDOC_GETFILETYPESTRING() \
  76.     virtual BOOL GetFileTypeString(__Y_CString& rString) \
  77.     { return GetFileTypeString((__X_CString &)rString); } \
  78.  
  79.  
  80. /*****************************************************************
  81.  
  82.     class CFile
  83.  
  84. *****************************************************************/
  85.  
  86. // CString CFile::GetFileName() const
  87. #define RTFIX_CFILE_GETFILENAME() \
  88.     virtual __Y_CString GetFileName() const \
  89.     { return (__Y_CString) GetFileName(); } \
  90.  
  91. // CString CFile::GetFileTitle() const
  92. #define RTFIX_CFILE_GETFILETITLE() \
  93.     virtual __Y_CString GetFileTitle() const \
  94.     { return (__Y_CString) GetFileTitle(); } \
  95.  
  96. // CString CFile::GetFilePath() const
  97. #define RTFIX_CFILE_GETFILEPATH() \
  98.     virtual __Y_CString GetFilePath() const \
  99.     { return (__Y_CString) GetFilePath(); } \
  100.  
  101.  
  102. /*****************************************************************
  103.  
  104.     class COleStreamFile
  105.  
  106. *****************************************************************/
  107.  
  108. // const CString COleStreamFile::GetStorageName() const;
  109. #define RTFIX_COLESTREAMFILE_GETSTORAGENAME() \
  110.     virtual const __Y_CString GetStorageName() const \
  111.     { return (__Y_CString) GetStorageName(); } \
  112.  
  113.  
  114. /*****************************************************************
  115.  
  116.     class CStdioFile
  117.  
  118. *****************************************************************/
  119.  
  120. // BOOL CStdioFile::ReadString(CString&)
  121. #define RTFIX_CSTDIOFILE_READSTRING() \
  122.     virtual BOOL ReadString(__Y_CString& rString) \
  123.     { return ReadString((__X_CString&)rString); } \
  124.  
  125.         
  126. /*****************************************************************
  127.  
  128.     class CHttpFile
  129.  
  130. *****************************************************************/
  131.  
  132. // CString CHttpFile::GetFileURL() const;
  133. #define RTFIX_CHTTPFILE_GETFILEURL() \
  134.     virtual __Y_CString GetFileURL() const \
  135.     { return (__Y_CString) GetFileURL(); } \
  136.  
  137.  
  138. /*****************************************************************
  139.  
  140.     class CFileFind
  141.  
  142. *****************************************************************/
  143.  
  144. // CString CFileFind::GetFileName() const;
  145. #define RTFIX_CFILEFIND_GETFILENAME() \
  146.     virtual __Y_CString GetFileName() const \
  147.     { return (__Y_CString) GetFileName(); } \
  148.  
  149. // CString CFileFind::GetFilePath() const;
  150. #define RTFIX_CFILEFIND_GETFILEPATH() \
  151.     virtual __Y_CString GetFilePath() const \
  152.     { return (__Y_CString) GetFilePath(); } \
  153.  
  154. // CString CFileFind::GetFileTitle() const;
  155. #define RTFIX_CFILEFIND_GETFILETITLE() \
  156.     virtual __Y_CString GetFileTitle() const \
  157.     { return (__Y_CString) GetFileTitle(); } \
  158.  
  159. // CString CFileFind::GetFileURL() const;
  160. #define RTFIX_CFILEFIND_GETFILEURL() \
  161.     virtual __Y_CString GetFileURL() const \
  162.     { return (__Y_CString) GetFileURL(); } \
  163.  
  164. // CString CFileFind::GetRoot() const;
  165. #define RTFIX_CFILEFIND_GETROOT() \
  166.     virtual __Y_CString GetRoot() const \
  167.     { return (__Y_CString) GetRoot(); } \
  168.  
  169.  
  170. /*****************************************************************
  171.  
  172.     class COleControl
  173.  
  174. *****************************************************************/
  175.  
  176. // void COleControl::GetMessageString(UINT, CString&)
  177. #define RTFIX_COLECONTROL_GETMESSAGESTRING() \
  178.     virtual void GetMessageString(UINT nID, __Y_CString& rString) \
  179.     { GetMessageString(nID, (__X_CString&)rString); } \
  180.  
  181. // BOOL COleControl::OnGetDisplayString(DISPID, CString&);
  182. #define RTFIX_COLECONTROL_ONGETDISPLAYSTRING() \
  183.     virtual BOOL OnGetDisplayString(DISPID id, __Y_CString& rString) \
  184.     { return OnGetDisplayString(id, (__X_CString&)rString); } \
  185.  
  186.  
  187. /*****************************************************************
  188.  
  189.     class CRecordset
  190.  
  191. *****************************************************************/
  192.  
  193. // CString CRecordset::GetDefaultConnect();
  194. #define RTFIX_CRECORDSET_GETDEFAULTCONNECT() \
  195.     virtual __Y_CString GetDefaultConnect() \
  196.     { return (__Y_CString) GetDefaultConnect(); } \
  197.     
  198. // CString CRecordset::GetDefaultSQL();
  199. #define RTFIX_CRECORDSET_GETDEFAULTSQL() \
  200.     virtual __Y_CString GetDefaultSQL() \
  201.     { return (__Y_CString) GetDefaultSQL(); } \
  202.  
  203.  
  204. /*****************************************************************
  205.  
  206.     class CFrameWnd
  207.  
  208. *****************************************************************/
  209.  
  210. // CFrameWnd::GetMessageString(UINT, CString&) const;
  211. #define RTFIX_CFRAMEWND_GETMESSAGESTRING() \
  212.     virtual void GetMessageString(UINT nID, __Y_CString& rMessage) const \
  213.     { GetMessageString(nID, (__X_CString&)rMessage); } \
  214.  
  215.  
  216. /*****************************************************************
  217. ------------------------------------------------------------------
  218.  
  219.     Now make some typedef's
  220.     without them it would not be possible to fix the whole problem
  221.     of virtual functions only in the headers
  222.  
  223.     This typedef gives acces to original CString as __Y_CString
  224.  
  225. ------------------------------------------------------------------
  226. *****************************************************************/
  227.  
  228. #undef CString
  229. typedef CString __Y_CString;
  230. #define CString __X_CString
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.