这篇教程C++ AfxSocketInit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AfxSocketInit函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxSocketInit函数的具体用法?C++ AfxSocketInit怎么用?C++ AfxSocketInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AfxSocketInit函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sizeofBOOL CRadioAndCheckBoxesApp::InitInstance(){ // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Create the shell manager, in case the dialog contains // any shell tree view or shell list view controls. CShellManager *pShellManager = new CShellManager; // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); CRadioAndCheckBoxesDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Delete the shell manager created above. if (pShellManager != NULL) { delete pShellManager; } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE;}
开发者ID:inf-eth,项目名称:i02-0491-courses,代码行数:60,
示例2: CreateListener BOOL TLServer_IP::CreateListener() { if (!AfxSocketInit()) { CString * s = new CString("IDP_SOCKETS_INIT_FAILED"); PostMessage(UWM_INFO, (WPARAM)s, ::GetCurrentThreadId()); return FALSE; } // Create the listener socket UINT portnum = PORT; if(!m_listensoc.Create(portnum)) { /* failed to create */ DWORD err = ::GetLastError(); CString fmt; fmt.LoadString(IDS_LISTEN_CREATE_FAILED); CString * s = new CString; s->Format(fmt, portnum); PostMessage(UWM_INFO, (WPARAM)s, ::GetCurrentThreadId()); PostMessage(UWM_NETWORK_ERROR, (WPARAM)err, ::GetCurrentThreadId()); return FALSE; } /* failed to create */ { /* success */ CString fmt; fmt.LoadString(IDS_LISTENER_CREATED); CString * s = new CString; s->Format(fmt, portnum); PostMessage(UWM_INFO, (WPARAM)s,::GetCurrentThreadId()); } /* success */ m_listensoc.SetTarget(this); m_listensoc.Listen(); return TRUE; } // TLServer_IP::CreateListener
开发者ID:Decatf,项目名称:tradelink,代码行数:35,
示例3: InitInstanceBOOL CNetDiskToolApp::InitInstance(){ if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } SetUnhandledExceptionFilter(My_UnhandledExceptionFilter); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need.#ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL#else Enable3dControlsStatic(); // Call this when linking to MFC statically#endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CNetDiskToolDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CNetDiskToolView)); AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // The one and only window has been initialized, so show and update it. m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow();// GetDocumnet()->GetDataType(); return TRUE;}
开发者ID:MatthewChan,项目名称:Softlumos,代码行数:60,
示例4: InitInstanceBOOL CKeyBoardWinCEApp::InitInstance(){ if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); CKeyBoardWinCEDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 在此处放置处理何时用“确定”来关闭 // 对话框的代码 } // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, // 而不是启动应用程序的消息泵。 return FALSE;}
开发者ID:SherlockLee,项目名称:KeyBoardWinCE,代码行数:33,
示例5: sizeofBOOL CVPingApp::InitInstance(){ // InitCommonControlsEx() требуется для Windows XP, если манифест // приложения использует ComCtl32.dll версии 6 или более поздней версии для включения // стилей отображения. В противном случае будет возникать сбой при создании любого окна. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // Выберите этот параметр для включения всех общих классов управления, которые необходимо использовать // в вашем приложении. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Создать диспетчер оболочки, в случае, если диалоговое окно содержит // представление дерева оболочки или какие-либо его элементы управления. CShellManager *pShellManager = new CShellManager; // Стандартная инициализация // Если эти возможности не используются и необходимо уменьшить размер // конечного исполняемого файла, необходимо удалить из следующих // конкретных процедур инициализации, которые не требуются // Измените раздел реестра, в котором хранятся параметры // TODO: следует изменить эту строку на что-нибудь подходящее, // например на название организации SetRegistryKey(_T("Локальные приложения, созданные с помощью мастера приложений")); CVPingDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Введите код для обработки закрытия диалогового окна // с помощью кнопки "ОК" } else if (nResponse == IDCANCEL) { // TODO: Введите код для обработки закрытия диалогового окна // с помощью кнопки "Отмена" } // Удалить диспетчер оболочки, созданный выше. if (pShellManager != NULL) { delete pShellManager; } // Поскольку диалоговое окно закрыто, возвратите значение FALSE, чтобы можно было выйти из // приложения вместо запуска генератора сообщений приложения. return FALSE;}
开发者ID:KroTozeR,项目名称:CompNet_Lab3,代码行数:60,
示例6: InitInstanceBOOL CFilePosterApp::InitInstance(){ if (!AfxSocketInit()) { AfxMessageBox(IDP_SOCKETS_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization#ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL#else Enable3dControlsStatic(); // Call this when linking to MFC statically#endif CFilePosterDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { } else if (nResponse == IDCANCEL) { } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE;}
开发者ID:BrianAberle,项目名称:XMLFoundation,代码行数:32,
|