CModule::CModule(ModHandle pDLL, const CString& sModName, const CString& sDataDir) { m_pDLL = pDLL; m_pManager = &(CZNC::Get().GetManager()); m_pUser = NULL; m_pClient = NULL; m_sModName = sModName; m_sDataDir = sDataDir; m_sSavePath = CZNC::Get().GetZNCPath() + "/moddata/" + m_sModName; LoadRegistry(); }
CModule::CModule(ModHandle pDLL, CUser* pUser, const CString& sModName, const CString& sDataDir) { m_bGlobal = false; m_pDLL = pDLL; m_pManager = &(CZNC::Get().GetManager());; m_pUser = pUser; m_pClient = NULL; m_sModName = sModName; m_sDataDir = sDataDir; if (m_pUser) { m_sSavePath = m_pUser->GetUserPath() + "/moddata/" + m_sModName; LoadRegistry(); } }
//---------------------------------------------------------------------------------------------- // CSetting //---------------------------------------------------------------------------------------------- CSetting::CSetting( HINSTANCE Instance ,HWND Wnd ) { // インスタンス this->Instance = Instance; // ウィンドウ ハンドル this->Wnd = Wnd; // コントローラーの設定 Setting = NULL; // コントローラーの設定の名称 SettingName = NULL; // レジストリから設定を読み込む LoadRegistry(); }
CModule::CModule(ModHandle pDLL, CUser* pUser, CIRCNetwork* pNetwork, const CString& sModName, const CString& sDataDir) { m_pDLL = pDLL; m_pManager = &(CZNC::Get().GetManager());; m_pUser = pUser; m_pNetwork = pNetwork; m_pClient = NULL; m_sModName = sModName; m_sDataDir = sDataDir; if (m_pNetwork) { m_sSavePath = m_pNetwork->GetNetworkPath() + "/moddata/" + m_sModName; } else if (m_pUser) { m_sSavePath = m_pUser->GetUserPath() + "/moddata/" + m_sModName; } else { m_sSavePath = CZNC::Get().GetZNCPath() + "/moddata/" + m_sModName; } LoadRegistry(); }
BOOL CAboutDlg::OnInitDialog() { CDialog::OnInitDialog(); CString strVersion; strVersion.Format( _T("%i.%i.%i.%i"), theApp.m_nVersion[0], theApp.m_nVersion[1], theApp.m_nVersion[2], theApp.m_nVersion[3] ); CString strCaption; m_wndTitle.GetWindowText( strCaption ); strCaption += _T(" © ") + strVersion; m_wndTitle.SetWindowText( strCaption ); m_crWhite = CCoolInterface::GetDialogBkColor(); m_brWhite.CreateSolidBrush( m_crWhite ); LoadRegistry(); return TRUE; }
void CProfile::LoadData() { FuncDefs::Load(); LevelUp(); LoadRegistry(); }
int Cn3DNoWin::Run(void) { TRACEMSG("Hello! Running build from " << __DATE__); int status = 1; try { // validate arguments const CArgs& args = GetArgs(); if (!(args["f"].HasValue() || args["d"].HasValue()) || (args["f"].HasValue() && args["d"].HasValue())) ERRORTHROW("Command line: Must supply one (and only one) of -f or -d"); EModel_type model = eModel_type_ncbi_all_atom; if (args["o"].HasValue()) { if (args["o"].AsString() == "alpha") model = eModel_type_ncbi_backbone; else if (args["o"].AsString() == "PDB") model = eModel_type_pdb_model; } string favorite(args["s"].HasValue() ? args["s"].AsString() : kEmptyStr); // setup dirs SetUpWorkingDirectories(GetArguments().GetProgramName().c_str()); // read dictionary wxString dictFile = wxString(GetDataDir().c_str()) + "bstdt.val"; LoadStandardDictionary(dictFile.c_str()); // set up registry LoadRegistry(); // local structure set and renderer StructureSet *sset = NULL; OpenGLRenderer renderer(NULL); // load data from file if (args["f"].HasValue()) { // if -o is present, assume this is a Biostruc file if (args["o"].HasValue()) { CNcbi_mime_asn1 *mime = CreateMimeFromBiostruc(args["f"].AsString(), model); if (!mime || !LoadDataOnly(&sset, &renderer, NULL, mime, favorite)) ERRORTHROW("Failed to load Biostruc file " << args["f"].AsString()); } else { if (!LoadDataOnly(&sset, &renderer, args["f"].AsString().c_str(), NULL, favorite, model)) ERRORTHROW("Failed to load file " << args["f"].AsString()); } } // else network fetch else { CNcbi_mime_asn1 *mime = LoadStructureViaCache(args["d"].AsString(), model, 0); if (!mime || !LoadDataOnly(&sset, &renderer, NULL, mime, favorite)) ERRORTHROW("Failed to load from network with id " << args["d"].AsString()); } if (!sset) ERRORTHROW("Somehow ended up with NULL sset"); auto_ptr < StructureSet > sset_ap(sset); // so we can be sure it's deleted // export PNG image if (!ExportPNG(NULL, &renderer, args["p"].AsString(), args["w"].AsInteger(), args["h"].AsInteger(), args["i"].HasValue())) ERRORTHROW("PNG export failed"); TRACEMSG("Done!"); status = 0; } catch (ncbi::CException& ce) { ERRORMSG("Caught CException: " << ce.GetMsg()); } catch (std::exception& e) { ERRORMSG("Caught exception: " << e.what()); } catch (...) { ERRORMSG("Caught unknown exception"); } return status; }