当前位置: 首页>>代码示例>>C++>>正文


C++ MainDialog类代码示例

本文整理汇总了C++中MainDialog的典型用法代码示例。如果您正苦于以下问题:C++ MainDialog类的具体用法?C++ MainDialog怎么用?C++ MainDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MainDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    // Now we make sure the current dir is set to application path
    QDir dir(QCoreApplication::applicationDirPath());

    #if defined(Q_OS_MAC)
    if (dir.dirName() == "MacOS") {
        dir.cdUp();
        dir.cdUp();
        dir.cdUp();
    }
    #endif

    QDir::setCurrent(dir.absolutePath());

    // Load the stylesheet
    QFile file("./launcher.qss");

    file.open(QFile::ReadOnly);
    QString styleSheet = QLatin1String(file.readAll());
    app.setStyleSheet(styleSheet);

    MainDialog dialog;
    return dialog.exec();

}
开发者ID:jpn,项目名称:openmw,代码行数:28,代码来源:main.cpp

示例2: _tWinMain

int WINAPI _tWinMain(HINSTANCE  hInstance,
                     HINSTANCE  /*hPrevInstance*/,
                     LPTSTR     lpstrCmdLine,
                     int        nCmdShow)
{

    g_hInstance = hInstance;

	HRESULT hr =    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

    if (FAILED(hr))
    {
        MessageBox(NULL, TEXT("CoInitialize failed."), NULL, MB_ICONSTOP);
        return 1;
    }

	MainDialog *pDlg = new MainDialog();
	if (pDlg == NULL)
	{
        MessageBox(NULL, TEXT("Out of memory."), NULL, MB_ICONSTOP);
	}
	else
	{
		pDlg->ShowDialog(hInstance, NULL);

		delete pDlg;
	}




    CoUninitialize();

    return 0;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:35,代码来源:winmain.cpp

示例3: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)

{

	CPaintManagerUI::SetInstance(hInstance);
	CWndShadow::Initialize(hInstance);
	CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("\\FileTree\\"));
	//CPaintManagerUI::SetResourceZip(_T("Control.zip"),true);

	HRESULT Hr = ::CoInitialize(NULL);
	if( FAILED(Hr) ) return 0;
	
	MainDialog* pFrame = new MainDialog();
	if( pFrame == NULL ) 
		return 0;

	pFrame->Create(NULL, _T("TokenControl"), 
		UI_WNDSTYLE_FRAME,
		UI_WNDSTYLE_EX_FRAME, 0, 0, 300, 500);

	pFrame->CenterWindow();
	::ShowWindow(*pFrame, SW_SHOW);
	CPaintManagerUI::MessageLoop();

	::CoUninitialize();
	return 0;
}
开发者ID:wyrover,项目名称:myhistoryprojects,代码行数:27,代码来源:FileTree.cpp

示例4: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
 	MSG msg = {0};
	
	INITCOMMONCONTROLSEX icex;
	DWORD dwICC = ICC_ANIMATE_CLASS | \
							ICC_BAR_CLASSES | \
							ICC_COOL_CLASSES | \
							ICC_DATE_CLASSES | \
							ICC_LISTVIEW_CLASSES | \
							ICC_PROGRESS_CLASS | \
							ICC_TAB_CLASSES | \
							ICC_TREEVIEW_CLASSES | \
							ICC_UPDOWN_CLASS | \
							ICC_USEREX_CLASSES | \
							ICC_WIN95_CLASSES;

	icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
	icex.dwICC  = dwICC;
	::InitCommonControlsEx(&icex);

	if(CheckInstance() == TRUE) return FALSE;

	MainDialog mainDlg;
	return (int)mainDlg.Create(hInstance, NULL);
};
开发者ID:soeminnminn,项目名称:ServerManager,代码行数:29,代码来源:svrmangr.cpp

示例5: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainDialog w;
    w.show();

    return a.exec();
}
开发者ID:slug404,项目名称:ImageGame,代码行数:8,代码来源:main.cpp

示例6: main

int main(int argc, char *argv[]) 
{
  // Setting up the app
  QApplication CsvParser(argc, argv);

  MainDialog *dialog = new MainDialog;
  dialog->show();
  return CsvParser.exec();
}
开发者ID:WouterSpekkink,项目名称:csv_parser_gephi,代码行数:9,代码来源:main.cpp

示例7: main

int main(int argc, char** argv)
{
    Database database("address_book_db", "root", "wwwggg");
    if (!database.isOpen())
        return 1;

    QApplication app(argc, argv);
    MainDialog mainDialog;
    mainDialog.show();
    return app.exec();
}
开发者ID:Loafer-Kyamran,项目名称:address-book,代码行数:11,代码来源:main.cpp

示例8: main

int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    QTextCodec::setCodecForCStrings (QTextCodec::codecForName("UTF-8"));
    MainDialog m;
    m.show();
	
    if ( startMainApp() == 0 )
    {
        //we are closing!
    }
	
    return 0;
}
开发者ID:realisim,项目名称:realisim,代码行数:14,代码来源:main.cpp

示例9: wWinMain

INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, INT /*nCmdShow*/)
{
    (void)HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    // Initialize the COM library.
    HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);

    if (FAILED(hr))
    {
        MessageBox(NULL, L"CoInitialize failed.", NULL, MB_ICONSTOP);
        return 0;
    }

    // Initialize the common control library.
    INITCOMMONCONTROLSEX icc;
    icc.dwSize = sizeof(icc);
    icc.dwICC = ICC_STANDARD_CLASSES | ICC_BAR_CLASSES;
    if (!InitCommonControlsEx(&icc))
    {
        MessageBox(NULL, L"InitCommonControlsEx failed.", NULL, MB_ICONSTOP);
        CoUninitialize();
        return 0;
    }

    // Initialize our custom slider class.
    hr = Slider_Init(); 
    if (FAILED(hr))
    {
        MessageBox(NULL, L"Slider_Init failed.", NULL, MB_ICONSTOP);
        CoUninitialize();
        return 0;
    }

    // Create and show the dialog.
    MainDialog *pDlg = new (std::nothrow) MainDialog();
    if (pDlg == NULL)
    {
        MessageBox(NULL, L"Out of memory.", NULL, MB_ICONSTOP);
    }
    else
    {
        pDlg->ShowDialog(hInstance);

        delete pDlg;
    }

    CoUninitialize();
    return 0;
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:49,代码来源:winmain.cpp

示例10: main

int main(int argc, char *argv[])
{
    SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
    if (SDL_Init(SDL_INIT_VIDEO) != 0)
    {
        qDebug() << "SDL_Init failed: " << QString::fromStdString(SDL_GetError());
        return 0;
    }

    QApplication app(argc, argv);

    // Now we make sure the current dir is set to application path
    QDir dir(QCoreApplication::applicationDirPath());

#ifdef Q_OS_MAC
    if (dir.dirName() == "MacOS") {
        dir.cdUp();
        dir.cdUp();
        dir.cdUp();
    }

    // force Qt to load only LOCAL plugins, don't touch system Qt installation
    QDir pluginsPath(QCoreApplication::applicationDirPath());
    pluginsPath.cdUp();
    pluginsPath.cd("Plugins");

    QStringList libraryPaths;
    libraryPaths << pluginsPath.path() << QCoreApplication::applicationDirPath();
    app.setLibraryPaths(libraryPaths);
#endif

    QDir::setCurrent(dir.absolutePath());

    // Support non-latin characters
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

    MainDialog mainWin;

    if (mainWin.setup()) {
        mainWin.show();
    } else {
        return 0;
    }

    int returnValue = app.exec();
    SDL_Quit();
    return returnValue;
}
开发者ID:hean01,项目名称:openmw,代码行数:48,代码来源:main.cpp

示例11: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    if (!openConnection())
        return -1;

    MainDialog mainDialog;
    mainDialog.setTitle("Статистика филиала \"МЦ АУВД\"");
    mainDialog.showMaximized();

    app.exec();

    if (!closeConnection())
        return -1;

    return 0;
}
开发者ID:Wushaowei001,项目名称:vyborg_src,代码行数:18,代码来源:main.cpp

示例12: DoMainDialog

// Do main dialog, return TRUE if canceled
BOOL DoMainDialog(BOOL &optionPlaceStructs, BOOL &optionProcessStatic, BOOL &optionOverwriteComments, BOOL &optionAudioOnDone, BOOL &optionClean, BOOL &optionFullClear)
{
    MainDialog dlg = MainDialog(optionPlaceStructs, optionProcessStatic, optionOverwriteComments, optionAudioOnDone, optionClean, optionFullClear);
    if (dlg.exec())
    {
        #define CHECKSTATE(obj,var) var = dlg.obj->isChecked()
        CHECKSTATE(checkBox1, optionPlaceStructs);
        CHECKSTATE(checkBox2, optionProcessStatic);
        CHECKSTATE(checkBox3, optionOverwriteComments);
        CHECKSTATE(checkBox4, optionAudioOnDone);
        CHECKSTATE(checkBox5, optionClean);
        CHECKSTATE(checkBox6, optionFullClear);
        #undef CHECKSTATE

        return(FALSE);
    }
    return(TRUE);
}
开发者ID:Hugues92,项目名称:IDA_ClassInformer_Modified,代码行数:19,代码来源:MainDialog.cpp

示例13: WinMain

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int show)
{
	MainDialog dlg;
	WTL::CMessageLoop loop;
	int ret = 1;
	
	CoInitialize(NULL);
	_Module.Init(NULL, hinst);
	_Module.AddMessageLoop(&loop);
	if(dlg.Create(NULL)) {
		dlg.ShowWindow(show);
		ret = loop.Run();
	}
	_Module.RemoveMessageLoop();
	_Module.Term();
	CoUninitialize();
	
	return ret;
}
开发者ID:Tietew,项目名称:mediawiki-xml2sql,代码行数:19,代码来源:xml2sql-fe.cpp

示例14: sizeof

BOOL CalculatorApp::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();


	AfxEnableControlContainer();

	// Create the shell manager, in case the dialog contains
	// any shell tree view or shell list view controls.
	CShellManager *pShellManager = new CShellManager;

	// Activate "Windows Native" visual manager for enabling themes in MFC controls
	CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));

	// 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("Calculator-Framebassman"));

	MainDialog dlg;
	m_pMainWnd = &dlg;
    dlg.DoModal();
	return FALSE;
}
开发者ID:FrameBassman,项目名称:Calculator,代码行数:38,代码来源:mfc.cpp

示例15: assert

BOOL AudioQualityIdentificationApp::InitInstance()
{
    assert(!atExit);
    atExit = new base::AtExitManager;

    SetErrorMode(SEM_NOGPFAULTERRORBOX);
    SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);

    // 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 initControls;
    initControls.dwSize = sizeof(initControls);

    // Set this to include all the common control classes you want to use
    // in your application.
    initControls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&initControls);

    CWinApp::InitInstance();

    MainDialog dialog;
    m_pMainWnd = &dialog;
    INT_PTR response = dialog.DoModal();
    if (response == IDOK) {
        // TODO: Place code here to handle when the dialog is
        // dismissed with OK
    } else if (response == IDCANCEL) {
        // TODO: Place code here to handle when the dialog is
        // dismissed with Cancel
    }

    // 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:snowlesswinter,项目名称:audio_quality_identification,代码行数:36,代码来源:my_app.cpp


注:本文中的MainDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。