ChiToLetter.cpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // ChiToLetter.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "ChiToLetter.h"
  5. #include "ChiToLetterDlg.h"
  6. #include "ChinesePinYin.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CChiToLetterApp
  14. BEGIN_MESSAGE_MAP(CChiToLetterApp, CWinApp)
  15. //{{AFX_MSG_MAP(CChiToLetterApp)
  16. // NOTE - the ClassWizard will add and remove mapping macros here.
  17. // DO NOT EDIT what you see in these blocks of generated code!
  18. //}}AFX_MSG
  19. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  20. END_MESSAGE_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CChiToLetterApp construction
  23. CChiToLetterApp::CChiToLetterApp()
  24. {
  25. // TODO: add construction code here,
  26. // Place all significant initialization in InitInstance
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // The one and only CChiToLetterApp object
  30. CChiToLetterApp theApp;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CChiToLetterApp initialization
  33. BOOL CChiToLetterApp::InitInstance()
  34. {
  35. AfxEnableControlContainer();
  36. // Standard initialization
  37. // If you are not using these features and wish to reduce the size
  38. // of your final executable, you should remove from the following
  39. // the specific initialization routines you do not need.
  40. #ifdef _AFXDLL
  41. Enable3dControls(); // Call this when using MFC in a shared DLL
  42. #else
  43. Enable3dControlsStatic(); // Call this when linking to MFC statically
  44. #endif
  45. //CStringW strPinyin = ChinesePinYin::GetChineseSpellPinyin(L"曹喆赫,在大部分情况下 StringBuilder > StringBuffer");
  46. //strPinyin = ChinesePinYin::MakeSpellCode("曹喆赫,在大部分情况下 StringBuilder > StringBuffer",NULL);
  47. CString strPinyin = _T("");
  48. //ChinesePinYin::GetPYStr(_T("喆PP.,/][*&^%$#@!~/*-+,./\';:"|?><{}"));
  49. strPinyin = ChinesePinYin::GetChineseSpellPinyin(L"喆佛");
  50. strPinyin = ChinesePinYin::MakeSpellCode("喆",NULL);
  51. strPinyin = ChinesePinYin::MakeSpellCode("黑檀木花牛角浮刻笑佛PP.,/][*&^%$#@!~/*-+,./\';:"|?><{}",NULL);
  52. CChiToLetterDlg dlg;
  53. m_pMainWnd = &dlg;
  54. int nResponse = dlg.DoModal();
  55. if (nResponse == IDOK)
  56. {
  57. // TODO: Place code here to handle when the dialog is
  58. // dismissed with OK
  59. }
  60. else if (nResponse == IDCANCEL)
  61. {
  62. // TODO: Place code here to handle when the dialog is
  63. // dismissed with Cancel
  64. }
  65. // Since the dialog has been closed, return FALSE so that we exit the
  66. // application, rather than start the application's message pump.
  67. return FALSE;
  68. }