本文整理汇总了C++中InitApplication函数的典型用法代码示例。如果您正苦于以下问题:C++ InitApplication函数的具体用法?C++ InitApplication怎么用?C++ InitApplication使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitApplication函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acrxEntryPoint
/////////////////////////////////////////////////////////////////////////////
// ObjectARX EntryPoint
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
AcRxDynamicLinker *pLinker = acrxDynamicLinker;
switch (msg) {
case AcRx::kInitAppMsg:
// Comment out the following line if your
// application should be locked into memory
pLinker->unlockApplication(pkt);
pLinker->registerAppMDIAware(pkt);
// check if the arx app is loaded or not.
// if not, load it as UI so that we won't have
// proxy if this dll is unloaded by OS
if (!isModuleLoaded("AsdkSmileyDb.dbx"))
{
if (!pLinker->loadModule("AsdkSmileyDb.dbx", false, true))
return AcRx::kRetError;
}
// bump the reference count
pLinker->loadModule("AsdkSmileyDb.dbx", false, false);
InitApplication();
break;
case AcRx::kUnloadAppMsg:
pLinker->unloadModule("AsdkSmileyDb.dbx");
UnloadApplication();
break;
}
return AcRx::kRetOK;
}
示例2: return
BOOL WinParent::Init(HINSTANCE hInstance, int nCmdShow)
{
// Save the application-instance handle.
m_hInstance = hInstance;
return ( InitApplication() && InitInstance(nCmdShow) );
}
示例3: acrxEntryPoint
/////////////////////////////////////////////////////////////////////////////
// ObjectARX EntryPoint
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg) {
case AcRx::kInitAppMsg:
// Comment out the following line if your
// application should be locked into memory
acrxDynamicLinker->unlockApplication(pkt);
acrxDynamicLinker->registerAppMDIAware(pkt);
InitApplication();
break;
case AcRx::kUnloadAppMsg:
UnloadApplication();
break;
// add or remove items to/from document status
// bar here because all databases are active at this point.
case AcRx::kLoadDwgMsg:
//CreateDocumentWorkspace(curDoc());
break;
case AcRx::kUnloadDwgMsg:
//DestroyDocumentWorkspace(curDoc());
break;
}
return AcRx::kRetOK;
}
示例4: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
// if (CheckAvailableIOCP())
// {
if (!InitApplication(hInstance))
return (FALSE);
if (!InitInstance(hInstance, nCmdShow))
return (FALSE);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/* }
else
{
TCHAR szMsg[1024];
LoadString(hInstance, IDS_NOTWINNT, szMsg, sizeof(szMsg));
MessageBox(NULL, szMsg, _LOGINGATE_SERVER_TITLE, MB_OK|MB_ICONINFORMATION);
return -1;
}
*/
return (msg.wParam);
}
示例5: WinMain
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
HANDLE hAccelTable;
if (!InitApplication(hInstance))
{
return (FALSE);
}
if (!InitInstance(hInstance, nCmdShow))
{
return (FALSE);
}
StartTimer();
hAccelTable = LoadAccelerators (hInstance, MAKEINTRESOURCE(IDR_GENERIC));
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
StopTimer();
return (msg.wParam); /* Returns the value from PostQuitMessage */
}
示例6: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInst*/, LPSTR /*lpszCmdParam*/, int nCmdShow)
{
MSG msg;
HACCEL hAccel = AtlLoadAccelerators(IDR_ACCELERATOR1);
if (!LoadLibrary("RICHED32.DLL"))
{
MessageBox(nullptr, "Could not load RICHED32.DLL", nullptr, MB_OK);
return (FALSE);
}
if (!InitApplication(hInstance))
{
MessageBox(nullptr, "Could not initialize application", nullptr, MB_OK);
return (FALSE);
}
if (!InitInstance(hInstance, nCmdShow))
{
MessageBox(nullptr, "Could not create window", nullptr, MB_OK);
return (FALSE);
}
// message loop
while (GetMessage(&msg, nullptr, 0, 0))
{
if (!TranslateAccelerator(hwnd_main,hAccel,&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} // while(GetMessage...
return static_cast<int>(msg.wParam);
} // WinMain
示例7: WinMain
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
HANDLE hAccelTable;
if(!hPrevInst)
{
if(!InitApplication(hInst))
return FALSE;
}
if(!InitInstance(hInst, nCmdShow))
return FALSE;
hAccelTable = LoadAcceleratorsW(hInst, MAKEINTRESOURCEW(IDA_OLEVIEW));
while(GetMessageW(&msg, NULL, 0, 0))
{
if(TranslateAcceleratorW(globals.hMainWnd, hAccelTable, &msg)) continue;
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
return msg.wParam;
}
示例8: WinMain
/* ************************************
* WinMain
* 功能 程序入口点,调用InitApplication,InitInstance
* 消息循环
* 参数 hinstance,应用程序本次运行实例
* hPrevInstance,应用程序之前的实例,始终为NULL
* lpCmdLine,命令行参数
* nCmdShow,如果窗口,SW_SHOW
* 返回值 失败返回FALSE
**************************************/
int WINAPI WinMain(
HINSTANCE hinstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
BOOL fGotMessage;
// InitApplication
if (!InitApplication(hinstance))
{
return FALSE;
}
// InitInstance
if (!InitInstance(hinstance, nCmdShow))
{
return FALSE;
}
// 消息循环
while ((fGotMessage = GetMessage(&msg, (HWND) NULL, 0, 0)) != 0 && fGotMessage != -1)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
UNREFERENCED_PARAMETER(lpCmdLine);
}
示例9: WinMain
/*************************************
* WinMain
**************************************/
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
BOOL fGotMessage;
if (!InitApplication(hinstance))
return 1;
if (!InitInstance(hinstance, nCmdShow))
return 1;
if(!DoRegisterDeviceInterface( GUID_DEVINTERFACE_DISK, &hDevNotify ))
// GUID_DEVINTERFACE_MEDIUMCHANGER
// GUID_DEVINTERFACE_VOLUME
// GUID_DEVINTERFACE_STORAGEPORT
// ……
{
return 1;
}
while ((fGotMessage = GetMessage(&msg, (HWND) NULL, 0, 0)) != 0 && fGotMessage != -1)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
UNREFERENCED_PARAMETER(lpCmdLine);
}
示例10: WinMain
int PASCAL WinMain(HANDLE hInstance, /* current instance */
HANDLE hPrevInstance, /* current instance */
LPSTR lpCmdLine, /* command line */
int nCmdShow) /* show-window type (open/icon) */
{
MSG msg; /* message */
if (!hPrevInstance) /* Other instances of app running? */
if (!InitApplication(hInstance)) /* Initialize shared things */
return (FALSE); /* Exits if unable to initialize */
/* Perform initializations that apply to a specific instance
*/
if (!InitInstance(hInstance, lpCmdLine, nCmdShow))
return (FALSE);
/* Acquire and dispatch messages until a WM_QUIT message is received.
*/
while (GetMessage(&msg, /* message structure */
(HWND) NULL, /* handle of window receiving the message */
0, /* lowest message to examine */
0)) /* highest message to examine */
{
TranslateMessage(&msg); /* Translates virtual key codes */
DispatchMessage(&msg); /* Dispatches message to window */
}
return (msg.wParam); /* Returns the value from PostQuitMessage */
} // WinMain
示例11: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
{
MSG msg;
// HANDLE hAccelTable;
BOOL fActivated;
SetUnhandledExceptionFilter(&MyExceptionFilter);
hInst = hInstance;
if(FAILED(ActivatePreviousInstance(szAppName, NULL, &fActivated)) || fActivated)
return 0;
InitCommonControls();
if (!InitApplication())
return 0;
// hAccelTable = LoadAccelerators(hInst,MAKEINTRESOURCE(IDACCEL));
if ((hwndMain = CreateboxworldWndClassWnd()) == (HWND)0)
return 0;
ShowWindow(hwndMain, nCmdShow);
UpdateWindow(hwndMain);
while (GetMessage(&msg,NULL,0,0)) {
// if (!TranslateAccelerator(msg.hwnd,hAccelTable,&msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
// }
}
return msg.wParam;
}
示例12: zhfzhftool_dttk
// ----- zhfzhftool._dttk command (do not rename)
static void zhfzhftool_dttk(void)
{
// Add your code for command zhfzhftool._dttk here
if (g_bIsTukuFirst)
{
InitApplication() ;
}
else
{
CMDIFrameWnd* pAcadFrame = acedGetAcadFrame();
if (g_pArrayZhfPaletteSet.GetCount()>1)
{
CZhfPaletteSet* pSet = g_pArrayZhfPaletteSet.GetAt(1) ;
if (pSet->IsWindowVisible())
{
pAcadFrame->ShowControlBar(pSet, FALSE, FALSE);
}
else
{
pAcadFrame->ShowControlBar(pSet, TRUE, FALSE);
}
}
else
{
acutPrintf(_T("\n图库面板没有创建或创建失败,无法显示!")) ;
}
}
}
示例13: WinMain
/****************************************************************************
*
* FUNCTION: WinMain
*
* PURPOSE: Main entry point for this app
*
* PARAMS: HANDLE hInstance - This instance
* HANDLE hPrevInstance - Previous instance
* LPSTR lpszCmdLine - Command Line
* int nCmdShow - Desired window status
*
* RETURNS: int - return code
*
* History:
* July '95 - Created
*
\****************************************************************************/
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
MSG msg;
// standard init stuff
if( ! hPrevInstance )
{
if( ! InitApplication( hInstance ) )
{
return FALSE;
}
}
if( ! InitInstance( hInstance, nCmdShow ) )
{
return FALSE;
}
// Standard message loop
while (GetMessage(&msg, (HWND) NULL, 0, 0))
{
if( !TranslateMDISysAccel(hMDIClientWnd, &msg) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
示例14: wWinMain
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
MSG msg;
/* Other instances of app running? */
if (!hPrevInstance)
{
/* stuff to be done once */
if (!InitApplication(hInstance))
{
return FALSE; /* exit */
}
}
/* stuff to be done every time */
if (!InitInstance(hInstance, nCmdShow))
{
return FALSE;
}
HandleCommandLine(lpCmdLine);
/* Main loop */
/* Acquire and dispatch messages until a WM_QUIT message is received */
while (GetMessageW(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
return msg.wParam;
}
示例15: CreateWindows
int CreateWindows()
{
if (!InitApplication(NULL))
return FALSE;
if (!InitInstance(NULL, TRUE))
return FALSE;
// register the video window class
WNDCLASSEX wcx;
wcx.cbSize = sizeof(wcx); // size of structure
wcx.style = 0; // redraw if size changes
wcx.lpfnWndProc = MainWndProc; // points to window procedure
wcx.cbClsExtra = 0; // no extra class memory
wcx.cbWndExtra = 0; // no extra window memory
wcx.hInstance = NULL; // handle to instance
wcx.hIcon = LoadIcon(NULL,
IDI_APPLICATION); // predefined app. icon
wcx.hCursor = LoadCursor(NULL,
IDC_ARROW); // predefined arrow
wcx.hbrBackground = (HBRUSH)GetStockObject(
BLACK_BRUSH); // black background brush
wcx.lpszMenuName = NULL; // name of menu resource
wcx.lpszClassName = "PlaceCallVideoClass"; // name of window class
wcx.hIconSm = NULL;
ATOM x = RegisterClassEx(&wcx);
// create the Preview Window and the Video Window
HWND hPreview = createPreviewWindow(hMain);
HWND hVideo = createVideoWindow(hMain);
return 0;
}