BlueToothExc.cpp
上传用户:shmeyee
上传日期:2015-06-28
资源大小:108k
文件大小:2k
源码类别:

通讯编程

开发平台:

Visual C++

  1. // BlueToothExc.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "BlueToothExc.h"
  5. #include "DlgBlueToothExc.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. // CBlueToothExcApp
  10. BEGIN_MESSAGE_MAP(CBlueToothExcApp, CWinApp)
  11. ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
  12. END_MESSAGE_MAP()
  13. // CBlueToothExcApp construction
  14. CBlueToothExcApp::CBlueToothExcApp()
  15. {
  16. // TODO: add construction code here,
  17. // Place all significant initialization in InitInstance
  18. }
  19. // The one and only CBlueToothExcApp object
  20. CBlueToothExcApp theApp;
  21. // CBlueToothExcApp initialization
  22. BOOL CBlueToothExcApp::InitInstance()
  23. {
  24. // InitCommonControlsEx() is required on Windows XP if an application
  25. // manifest specifies use of ComCtl32.dll version 6 or later to enable
  26. // visual styles.  Otherwise, any window creation will fail.
  27. INITCOMMONCONTROLSEX InitCtrls;
  28. InitCtrls.dwSize = sizeof(InitCtrls);
  29. // Set this to include all the common control classes you want to use
  30. // in your application.
  31. InitCtrls.dwICC = ICC_WIN95_CLASSES;
  32. InitCommonControlsEx(&InitCtrls);
  33. CWinApp::InitInstance();
  34. WSADATA wsd;
  35. WSAStartup (MAKEWORD(2,2), &wsd);
  36. if (!AfxSocketInit())
  37. {
  38. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  39. return FALSE;
  40. }
  41. AfxEnableControlContainer();
  42. // Standard initialization
  43. // If you are not using these features and wish to reduce the size
  44. // of your final executable, you should remove from the following
  45. // the specific initialization routines you do not need
  46. // Change the registry key under which our settings are stored
  47. // TODO: You should modify this string to be something appropriate
  48. // such as the name of your company or organization
  49. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  50. CDlgBlueToothExc dlg;
  51. m_pMainWnd = &dlg;
  52. INT_PTR nResponse = dlg.DoModal();
  53. if (nResponse == IDOK)
  54. {
  55. // TODO: Place code here to handle when the dialog is
  56. //  dismissed with OK
  57. }
  58. else if (nResponse == IDCANCEL)
  59. {
  60. // TODO: Place code here to handle when the dialog is
  61. //  dismissed with Cancel
  62. }
  63. // Since the dialog has been closed, return FALSE so that we exit the
  64. //  application, rather than start the application's message pump.
  65. return FALSE;
  66. }
  67. int CBlueToothExcApp::ExitInstance()
  68. {
  69. WSACleanup();
  70. return CWinApp::ExitInstance();
  71. }