本文整理汇总了C++中IApplication::get_Documents方法的典型用法代码示例。如果您正苦于以下问题:C++ IApplication::get_Documents方法的具体用法?C++ IApplication::get_Documents怎么用?C++ IApplication::get_Documents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplication
的用法示例。
在下文中一共展示了IApplication::get_Documents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CustomizeProject
//.........这里部分代码省略.........
"/out:" + pPath + "\\" + pName + "." + pExt + " " +
//sdk libs
" comctl32.lib " + GetPluginLibs(pExt) +
//maxsdk libpath
" /LIBPATH:" + sPath + "\\lib " + " /DLL /base:" + base_address;
// General Settings
sG = CString("0"); //To specify Not Using MFC
BSTR bszComp = CString("cl.exe").AllocSysString();
BSTR bszLink = CString("link.exe").AllocSysString();
BSTR bszMfc = CString("mfc").AllocSysString();
// Compiler settings
BSTR bszSettingsC[] = {
("/MDd /G6 /LD " + sInc).AllocSysString(), // Debug
("/MD /G6 /LD " + sInc).AllocSysString(), // Hybrid
("/MD /G6 /LD " + sInc).AllocSysString() // Release
};
BSTR bszRemSettingsC = CString(_T("/GX /D_MBCS /GZ")).AllocSysString();
BSTR bszHyb = CString("Hybrid").AllocSysString();
BSTR bszSettingsL = sL.AllocSysString();
BSTR bszSettingsG = sG.AllocSysString();
COleVariant res;
pProject->AddConfiguration(bszHyb, res);
pProject->get_Configurations(&pConfigs);
pConfigs->get_Count(&count);
for (long i = 1; i <= count; i++)
{
COleVariant varInd(i);
pConfigs->Item(varInd , &pConfig);
COleVariant var(0L,VT_ERROR);
var.scode=DISP_E_PARAMNOTFOUND;
pConfig->AddToolSettings(bszMfc, bszSettingsG, var);
pConfig->AddToolSettings(bszLink, bszSettingsL, var);
COleVariant varStr;
pConfig->get_Name(&V_BSTR(&varStr));
varStr.vt = VT_BSTR;
if (varStr == COleVariant(pName + " - Win32 Debug"))
{
pConfig->AddToolSettings(bszComp, bszSettingsC[0], var);
SysFreeString(bszSettingsC[0]);
}
else if (varStr == COleVariant(pName + " - Win32 Hybrid"))
{
pConfig->AddToolSettings(bszComp, bszSettingsC[1], var);
SysFreeString(bszSettingsC[1]);
}
else // release
{
pConfig->AddToolSettings(bszComp, bszSettingsC[2], var);
SysFreeString(bszSettingsC[2]);
// For release config add "/release" flag to linker settings
BSTR rel = CString(_T("/release")).AllocSysString();
pConfig->AddToolSettings(bszLink, rel, var);
SysFreeString(rel);
}
pConfig->RemoveToolSettings(bszComp, bszRemSettingsC, var);
pConfig->Release();
}
SysFreeString(bszComp);
SysFreeString(bszLink);
SysFreeString(bszMfc);
SysFreeString(bszRemSettingsC);
SysFreeString(bszHyb);
SysFreeString(bszSettingsL);
SysFreeString(bszSettingsG);
pConfigs->Release();
#if (1)
//The following opens the Root.cpp document in the DevStudio
IApplication *pApp;
IDocuments *pDocs;
IDocuments *pDoc;
BSTR bszRoot = (pName + CString(_T(".cpp"))).AllocSysString();
COleVariant varOpenAs(CString(_T("Text")));
COleVariant varReadOnly(0L, VT_BOOL);
pProject->get_Application((IDispatch **)&pApp);
pApp->get_Documents((IDispatch **)&pDocs);
pDocs->Open(bszRoot, varOpenAs, varReadOnly, (IDispatch **)&pDoc);
SysFreeString(bszRoot);
pApp->Release();
pDocs->Release();
pDoc->Release();
#endif
}