MachineCenter.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // MachineCenter.cpp: 定义 DLL 的初始化例程。
  2. //
  3. #include "pch.h"
  4. #include "framework.h"
  5. #include "MachineCenter.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. //
  10. //TODO: 如果此 DLL 相对于 MFC DLL 是动态链接的,
  11. // 则从此 DLL 导出的任何调入
  12. // MFC 的函数必须将 AFX_MANAGE_STATE 宏添加到
  13. // 该函数的最前面。
  14. //
  15. // 例如:
  16. //
  17. // extern "C" BOOL PASCAL EXPORT ExportedFunction()
  18. // {
  19. // AFX_MANAGE_STATE(AfxGetStaticModuleState());
  20. // // 此处为普通函数体
  21. // }
  22. //
  23. // 此宏先于任何 MFC 调用
  24. // 出现在每个函数中十分重要。 这意味着
  25. // 它必须作为以下项中的第一个语句:
  26. // 出现,甚至先于所有对象变量声明,
  27. // 这是因为它们的构造函数可能生成 MFC
  28. // DLL 调用。
  29. //
  30. // 有关其他详细信息,
  31. // 请参阅 MFC 技术说明 33 和 58。
  32. //
  33. // CMachineCenterApp
  34. BEGIN_MESSAGE_MAP(CMachineCenterApp, CWinApp)
  35. END_MESSAGE_MAP()
  36. // CMachineCenterApp 构造
  37. CMachineCenterApp::CMachineCenterApp()
  38. {
  39. // TODO: 在此处添加构造代码,
  40. // 将所有重要的初始化放置在 InitInstance 中
  41. }
  42. // 唯一的 CMachineCenterApp 对象
  43. CMachineCenterApp theApp;
  44. // CMachineCenterApp 初始化
  45. BOOL CMachineCenterApp::InitInstance()
  46. {
  47. CWinApp::InitInstance();
  48. if (!AfxSocketInit())
  49. {
  50. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  51. return FALSE;
  52. }
  53. return TRUE;
  54. }