[commit] r1241 - in trunk/GME/Gme: . AutoRoute
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Mar 31 16:33:52 CDT 2011
Author: ksmyth
Date: Thu Mar 31 16:33:52 2011
New Revision: 1241
Log:
Compile under UNICODE
Modified:
trunk/GME/Gme/AboutDlg.cpp
trunk/GME/Gme/AutoRoute/ArHelper.cpp
trunk/GME/Gme/GME.vcxproj
trunk/GME/Gme/GMEApp.cpp
trunk/GME/Gme/GMEApp.h
trunk/GME/Gme/GMEBrowser.cpp
trunk/GME/Gme/GMEChildFrame.cpp
trunk/GME/Gme/GMEConsole.cpp
trunk/GME/Gme/GMEDoc.cpp
trunk/GME/Gme/GMEDoc.h
trunk/GME/Gme/GMEEventLogger.h
trunk/GME/Gme/GMEOLEError.h
trunk/GME/Gme/GMEOLEIt.cpp
trunk/GME/Gme/GMEOLEModel.cpp
trunk/GME/Gme/GMEObjectInspector.cpp
trunk/GME/Gme/GMEPanningWindow.cpp
trunk/GME/Gme/GMEPartBrowser.cpp
trunk/GME/Gme/GMESearch.cpp
trunk/GME/Gme/GMEView.cpp
trunk/GME/Gme/GUIObject.cpp
trunk/GME/Gme/GraphicsUtil.cpp
trunk/GME/Gme/MainFrm.cpp
trunk/GME/Gme/MgaOpenDlg.cpp
trunk/GME/Gme/ModelPropertiesDlgBar.cpp
trunk/GME/Gme/NewXmlbackendProjDlg.cpp
trunk/GME/Gme/ParadigmPropertiesDlg.cpp
trunk/GME/Gme/ProjectPropertiesDlg.cpp
trunk/GME/Gme/RecentConnStrList.cpp
Modified: trunk/GME/Gme/AboutDlg.cpp
==============================================================================
--- trunk/GME/Gme/AboutDlg.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/AboutDlg.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -221,7 +221,7 @@
CRect rect;
m_DLLList.GetClientRect(&rect);
- m_DLLList.InsertColumn(0, "Dynamic Library Path", LVCFMT_LEFT, rect.Size().cx-::GetSystemMetrics(SM_CXVSCROLL));
+ m_DLLList.InsertColumn(0, _T("Dynamic Library Path"), LVCFMT_LEFT, rect.Size().cx-::GetSystemMetrics(SM_CXVSCROLL));
// TODO: Add extra initialization here
HMODULE modules[1024];
DWORD needed;
@@ -246,7 +246,7 @@
}
if (!success) {
- AfxMessageBox("Error in EnumProcessModules().");
+ AfxMessageBox(_T("Error in EnumProcessModules()."));
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
Modified: trunk/GME/Gme/AutoRoute/ArHelper.cpp
==============================================================================
--- trunk/GME/Gme/AutoRoute/ArHelper.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/AutoRoute/ArHelper.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -38,71 +38,71 @@
void CustomPathData::Serialize(CString& outChannel)
{
- outChannel.Format("%ld,%ld,%ld,%d,%ld", GetVersion(), GetAspect(), GetEdgeIndex(),
+ outChannel.Format(_T("%ld,%ld,%ld,%d,%ld"), GetVersion(), GetAspect(), GetEdgeIndex(),
GetEdgeCount(), GetType());
CString additionalDataStr;
- additionalDataStr.Format(",%ld,%ld,%ld,%ld", IsHorizontalOrVertical() ? 1 : 0,
+ additionalDataStr.Format(_T(",%ld,%ld,%ld,%ld"), IsHorizontalOrVertical() ? 1 : 0,
GetX(), GetY(), GetLongDataCount());
outChannel.Append(additionalDataStr);
for(long i = 0; i < GetLongDataCount(); i++) {
- additionalDataStr.Format(",%ld", l[i]);
+ additionalDataStr.Format(_T(",%ld"), l[i]);
outChannel.Append(additionalDataStr);
}
- additionalDataStr.Format(",%ld", GetDoubleDataCount());
+ additionalDataStr.Format(_T(",%ld"), GetDoubleDataCount());
outChannel.Append(additionalDataStr);
for(long i = 0; i < GetDoubleDataCount(); i++) {
- additionalDataStr.Format(",%lf", d[i]);
+ additionalDataStr.Format(_T(",%lf"), d[i]);
outChannel.Append(additionalDataStr);
}
}
bool CustomPathData::Deserialize(const CString& inChannel)
{
- TRACE1("\tResulting token: %s\n", inChannel);
+ TRACE(_T("\tResulting token: %s\n"), inChannel);
int curSubPos = 0;
- CString versionStr = inChannel.Tokenize(",", curSubPos);
- SetVersion(strtol(versionStr, NULL, 10));
+ CString versionStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetVersion(_tcstol(versionStr, NULL, 10));
ASSERT(GetVersion() == CONNECTIONCUSTOMIZATIONDATAVERSION);
if (GetVersion() != CONNECTIONCUSTOMIZATIONDATAVERSION) {
// TODO: Convert from older version to newer
return false;
}
- CString aspectStr = inChannel.Tokenize(",", curSubPos);
- SetAspect(strtol(aspectStr, NULL, 10));
- CString edgeIndexStr = inChannel.Tokenize(",", curSubPos);
- SetEdgeIndex(strtol(edgeIndexStr, NULL, 10));
- CString edgeCountStr = inChannel.Tokenize(",", curSubPos);
- SetEdgeCount(strtol(edgeCountStr, NULL, 10));
- CString edgeCustomTypeStr = inChannel.Tokenize(",", curSubPos);
- SetType((PathCustomizationType)strtol(edgeCustomTypeStr, NULL, 10));
- TRACE("\tAsp %ld, Ind %ld, Cnt %d, Typ %ld", GetAspect(), GetEdgeIndex(), GetEdgeCount(), GetType());
- CString directionStr = inChannel.Tokenize(",", curSubPos);
- SetHorizontalOrVertical(strtol(directionStr, NULL, 10) != 0);
- CString positionStr = inChannel.Tokenize(",", curSubPos);
- SetX(strtol(positionStr, NULL, 10));
- positionStr = inChannel.Tokenize(",", curSubPos);
- SetY(strtol(positionStr, NULL, 10));
- positionStr = inChannel.Tokenize(",", curSubPos);
- long numOfExtraLongData = strtol(positionStr, NULL, 10);
+ CString aspectStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetAspect(_tcstol(aspectStr, NULL, 10));
+ CString edgeIndexStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetEdgeIndex(_tcstol(edgeIndexStr, NULL, 10));
+ CString edgeCountStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetEdgeCount(_tcstol(edgeCountStr, NULL, 10));
+ CString edgeCustomTypeStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetType((PathCustomizationType)_tcstol(edgeCustomTypeStr, NULL, 10));
+ TRACE(_T("\tAsp %ld, Ind %ld, Cnt %d, Typ %ld"), GetAspect(), GetEdgeIndex(), GetEdgeCount(), GetType());
+ CString directionStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetHorizontalOrVertical(_tcstol(directionStr, NULL, 10) != 0);
+ CString positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetX(_tcstol(positionStr, NULL, 10));
+ positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ SetY(_tcstol(positionStr, NULL, 10));
+ positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ long numOfExtraLongData = _tcstol(positionStr, NULL, 10);
ASSERT(numOfExtraLongData >= 0 && numOfExtraLongData <= 4);
- TRACE(", Dir %ld, x %ld, y %ld, num %ld", IsHorizontalOrVertical(), GetX(), GetY(), numOfExtraLongData);
+ TRACE(_T(", Dir %ld, x %ld, y %ld, num %ld"), IsHorizontalOrVertical(), GetX(), GetY(), numOfExtraLongData);
for(long i = 0; i < numOfExtraLongData; i++) {
- positionStr = inChannel.Tokenize(",", curSubPos);
- AddLongData(strtol(positionStr, NULL, 10));
- TRACE2(", l%ld %ld", i, l[i]);
+ positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ AddLongData(_tcstol(positionStr, NULL, 10));
+ TRACE(_T(", l%ld %ld"), i, l[i]);
}
- TRACE0("\n");
+ TRACE(_T("\n"));
- positionStr = inChannel.Tokenize(",", curSubPos);
- long numOfExtraDoubleData = strtol(positionStr, NULL, 10);
+ positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ long numOfExtraDoubleData = _tcstol(positionStr, NULL, 10);
ASSERT(numOfExtraDoubleData >= 0 && numOfExtraDoubleData <= 8);
- TRACE1(", num %ld", numOfExtraDoubleData);
+ TRACE(_T(", num %ld"), numOfExtraDoubleData);
for(long i = 0; i < numOfExtraDoubleData; i++) {
- positionStr = inChannel.Tokenize(",", curSubPos);
- AddDoubleData(atof(positionStr));
- TRACE2(", l%ld %lf", i, d[i]);
+ positionStr = inChannel.Tokenize(_T(","), curSubPos);
+ AddDoubleData(_ttof(positionStr));
+ TRACE(_T(", l%ld %lf"), i, d[i]);
}
- TRACE0("\n");
+ TRACE(_T("\n"));
return true;
}
@@ -1160,16 +1160,16 @@
void CPointListPath::DumpPoints(const CString& msg) const
{
- TRACE0(msg);
- TRACE0(", points dump begin:\n");
+ TRACE(msg);
+ TRACE(_T(", points dump begin:\n"));
POSITION pos = GetHeadPosition();
int i = 0;
while(pos != NULL) {
CPoint p = GetNext(pos);
- TRACE3("%ld.: (%ld, %ld)\n", i, p.x, p.y);
+ TRACE(_T("%ld.: (%ld, %ld)\n"), i, p.x, p.y);
i++;
}
- TRACE0("points dump end.\n");
+ TRACE(_T("points dump end.\n"));
}
#endif
Modified: trunk/GME/Gme/GME.vcxproj
==============================================================================
--- trunk/GME/Gme/GME.vcxproj Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GME.vcxproj Thu Mar 31 16:33:52 2011 (r1241)
@@ -23,13 +23,13 @@
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEApp.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -127,22 +127,22 @@
// You may change it if you prefer to choose a specific identifier.
-/*static*/ const char * CGMEApp::m_no_model_open_string = "_NO_MODEL_IS_OPEN_";
+/*static*/ const TCHAR * CGMEApp::m_no_model_open_string = _T("_NO_MODEL_IS_OPEN_");
/////////////////////////////////////////////////////////////////////////////
// CGMEApp construction
CGMEApp::CGMEApp() :
- m_RecentProjectList(0, "Recent Project List", "Project%d", 8)
+ m_RecentProjectList(0, _T("Recent Project List"), _T("Project%d"), 8)
, m_compFilterOn( false)
{
multipleView = false;
useAutoRouting = true;
labelAvoidance = false;
- defZoomLev = "100";
+ defZoomLev = _T("100");
mouseOverNotify = false;
maintainHistory = false;
- realFmtStr = "%.12g";
+ realFmtStr = _T("%.12g");
// TODO: add construction code here,
// Place all significant initialization in InitInstance
@@ -165,17 +165,17 @@
if(bFlag && !strcmp(pszParam, "d")) bNoProtect = true;
else if(bFlag && !strcmp(pszParam, "l")) bOpenLast = true;
else if(bFlag && !strcmp(pszParam, "REGSERVER")) {
- char c[200];
- GetModuleFileName(NULL, c, sizeof(c));
+ TCHAR c[200];
+ GetModuleFileName(NULL, c, sizeof(c)/sizeof(c[0]));
CComPtr<ITypeLib> it;
HRESULT hr = LoadTypeLibEx(CComBSTR(c),REGKIND_REGISTER, &it);
- if(hr == S_OK) { AfxMessageBox("Registered"); exit(0); }
- else { AfxMessageBox("Registration error: " + hr); exit(-1); }
+ if(hr == S_OK) { AfxMessageBox(_T("Registered")); exit(0); }
+ else { AfxMessageBox(_T("Registration error: ") + hr); exit(-1); }
}
else if(bFlag && !strcmp(pszParam, "UNREGSERVER")) {
HRESULT hr = UnRegisterTypeLib(LIBID_GmeLib, 1, 0, LANG_NEUTRAL, SYS_WIN32);
- if(hr == S_OK) { AfxMessageBox("Unregistered"); exit(0); }
- else { AfxMessageBox("Unregistration error: " + hr); exit(-1); }
+ if(hr == S_OK) { AfxMessageBox(_T("Unregistered")); exit(0); }
+ else { AfxMessageBox(_T("Unregistration error: ") + hr); exit(-1); }
}
else CCommandLineInfo::ParseParam(pszParam, bFlag, bLast);
}
@@ -195,8 +195,8 @@
NULL };
CString errstring;
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- char hrbuf[20];
- if(hr != S_OK) AfxMessageBox(CString("Coinitialize failure. Err: #") + _ltoa(hr,hrbuf,16));
+ TCHAR hrbuf[20];
+ if(hr != S_OK) AfxMessageBox(CString(_T("Coinitialize failure. Err: #")) + _ltot(hr,hrbuf,16));
for(LPCOLESTR *p = components; *p; p++) {
GMEInterfaceVersion verid = GMEInterfaceVersion_None;
CComPtr<IUnknown> unk;
@@ -204,7 +204,7 @@
if(S_OK != (hr = unk.CoCreateInstance(*p))) {
{
_com_error error(hr);
- errstring.Format("Cannot create object %%S (Err: #%X, %s)", hr, error.ErrorMessage());
+ errstring.Format(_T("Cannot create object %%s (Err: #%X, %s)"), hr, error.ErrorMessage());
}
gerr:
CString a;
@@ -215,15 +215,15 @@
}
CComQIPtr<IGMEVersionInfo> vinf = unk;
if(!vinf) {
- errstring = "Incompatible version of object %S (does not support version information)";
+ errstring = _T("Incompatible version of object %s (does not support version information)");
goto gerr;
}
if(S_OK != vinf->get_version(&verid)) {
- errstring = "Get_Version failed for object %S";
+ errstring = _T("Get_Version failed for object %s");
goto gerr;
}
if(verid != GMEInterfaceVersion_Current) {
- errstring = "Interface version for class %S (%d.%d) differs from GME interface version (%d.%d)";
+ errstring = _T("Interface version for class %s (%d.%d) differs from GME interface version (%d.%d)");
goto gerr;
}
}
@@ -390,7 +390,7 @@
CGMEEventLogger::LogGMEEvent("GME started\r\n");
}
}
- MSGCATCH("Error while trying to get logfile settings",;);
+ MSGCATCH(_T("Error while trying to get logfile settings"),;);
if( (CMainFrame*)m_pMainWnd)
{
@@ -424,8 +424,8 @@
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
if( cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen ) {
CString conn = cmdInfo.m_strFileName;
- if(conn.Find("=") < 0) {
- conn.Insert(0,"MGA=");
+ if(conn.Find(_T("=")) < 0) {
+ conn.Insert(0,_T("MGA="));
}
OpenProject(conn);
@@ -477,19 +477,19 @@
p = embackupname.GetLength();
CString emcode;
static int emnum;
- emcode.Format("-emergency%ld", ++emnum);
+ emcode.Format(_T("-emergency%ld"), ++emnum);
embackupname.Insert(p, emcode);
#pragma warning(disable: 4310) // cast truncates constant value
HRESULT hr = mgaProject->Save(PutInBstr(embackupname), VARIANT_TRUE);
#pragma warning(default: 4310) // cast truncates constant value
if (proj_type_is_xmlbackend) {
- AfxMessageBox("Your current work can be found in the local checkout directory.");
+ AfxMessageBox(_T("Your current work can be found in the local checkout directory."));
} else {
CString emergencySaveMsg;
- emergencySaveMsg.FormatMessage("Your current work %1 been saved to %2.\n"
- "The original project file has not been modified. "
- "We apologize for the inconvenience.",
- (hr == S_OK)? "has" : "might have",
+ emergencySaveMsg.FormatMessage(_T("Your current work %1 been saved to %2.\n")
+ _T("The original project file has not been modified. ")
+ _T("We apologize for the inconvenience."),
+ (hr == S_OK)? _T("has") : _T("might have"),
embackupname);
AfxMessageBox(emergencySaveMsg);
m_RecentProjectList.Add(embackupname);
@@ -565,7 +565,7 @@
if(mgaProject == NULL || (0&&!proj_type_is_mga) || (!autosaveEnabled)) {
// The KillTimer function does not remove WM_TIMER messages
// already posted to the message queue ...
- CGMEEventLogger::LogGMEEvent("WARNING: CGMEApp::Autosave was called with no active project or autosave disabled.\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("WARNING: CGMEApp::Autosave was called with no active project or autosave disabled.\r\n"));
return;
}
@@ -575,7 +575,7 @@
int p = currentConnection.ReverseFind('\\');
CString fname = currentConnection.Mid(p + 1);
- conn = CString("MGA=") + autosaveDir + CString("\\") + fname + GME_AUTOSAVE_EXTENSION;
+ conn = CString(_T("MGA=")) + autosaveDir + CString(_T("\\")) + fname + GME_AUTOSAVE_EXTENSION;
}
else {
conn = currentConnection + GME_AUTOSAVE_EXTENSION;
@@ -598,8 +598,8 @@
}
if (inTrans) {
- CGMEEventLogger::LogGMEEvent("WARNING: CGMEApp::Autosave failed " +
- conn + ". We are in transaction.\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("WARNING: CGMEApp::Autosave failed ") +
+ conn + _T(". We are in transaction.\r\n"));
return;
}
@@ -608,12 +608,12 @@
#pragma warning(disable: 4310) // cast truncates constant value
COMTHROW(mgaProject->Save(CComBSTR(conn), VARIANT_TRUE));
#pragma warning(default: 4310) // cast truncates constant value
- CGMEEventLogger::LogGMEEvent("CGMEApp::Autosave succeeded " +
- conn + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::Autosave succeeded ") +
+ conn + _T("\r\n"));
}
catch(hresult_exception &e) {
- CGMEEventLogger::LogGMEEvent("WARNING: CGMEApp::Autosave failed " +
- conn + " " + e.what() + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("WARNING: CGMEApp::Autosave failed ") +
+ conn + _T(" ") + e.what() + _T("\r\n"));
}
}
@@ -659,22 +659,22 @@
if( mgaProject != NULL ) {
mgaClient = NULL;
if(mgaProject->Close(abort_on_close ? VARIANT_TRUE : VARIANT_FALSE) != S_OK) {
- AfxMessageBox(CString("Error occurred ") + (abort_on_close ? "aborting" : "closing") + " the project");
+ AfxMessageBox(CString(_T("Error occurred ")) + (abort_on_close ? _T("aborting") : _T("closing")) + _T(" the project"));
}
mgaProject.Release();
}
if(updateStatusBar) {
- CMainFrame::theInstance->WriteStatusParadigm("-");
- CMainFrame::theInstance->WriteStatusMode("EDIT");
+ CMainFrame::theInstance->WriteStatusParadigm(_T("-"));
+ CMainFrame::theInstance->WriteStatusMode(_T("EDIT"));
CMainFrame::theInstance->WriteStatusZoom(100);
}
projectName.Empty();
ChangedProjectConnStrings();
if(CGMEDoc::theInstance)
- CGMEDoc::theInstance->SetTitle("");
+ CGMEDoc::theInstance->SetTitle(_T(""));
if(CMainFrame::theInstance) {
CMainFrame::theInstance->SetTitle(m_pszAppName);
CMainFrame::theInstance->UpdateTitle(0);//WAS: "" .By passing 0 instead of "" we won't get title such as "GME-" after a project was closed
@@ -702,7 +702,7 @@
TCHAR cd[200];
GetCurrentDirectory(200, cd);
projectDir = cd;
- if (conn.Find("MGA=") == 0) {
+ if (conn.Find(_T("MGA=")) == 0) {
proj_type_is_mga = true;
int epos = conn.ReverseFind('\\');
if(epos >= 4) {
@@ -713,13 +713,13 @@
}
else proj_type_is_mga = false;
- if( conn.Find("MGX=") == 0 )
+ if( conn.Find(_T("MGX=")) == 0 )
proj_type_is_xmlbackend = true;
else
proj_type_is_xmlbackend = false;
}
if(!metaconn.IsEmpty()) {
- if (metaconn.Find("MGA=") == 0) {
+ if (metaconn.Find(_T("MGA=")) == 0) {
int epos = metaconn.ReverseFind('\\');
if(epos >= 4) {
paradigmDir = metaconn.Mid(4, epos-4);
@@ -748,7 +748,7 @@
COMTHROW(mgaProject->get_Name(&nm));
COMTHROW(mgaProject->CommitTransaction());
}
- MSGCATCH("Error getting project name", mgaProject->AbortTransaction())
+ MSGCATCH(_T("Error getting project name"), mgaProject->AbortTransaction())
CopyTo(nm,projectName);
}
@@ -788,7 +788,7 @@
}
#endif
CChildFrame* childFrame = STATIC_DOWNCAST(CChildFrame, pChild);
- projectName = childFrame->GetTitle() + " - " + childFrame->GetAppTitle();
+ projectName = childFrame->GetTitle() + _T(" - ") + childFrame->GetAppTitle();
}
CMainFrame::theInstance->UpdateTitle(projectName);
}
@@ -800,7 +800,7 @@
MGACOLL_ITERATE(IMgaComponent, comps) {
CComBSTR name;
COMTHROW(MGACOLL_ITER->get_ComponentName(&name));
- if(name == "ConstraintManager") {
+ if(name == _T("ConstraintManager")) {
mgaConstMgr = CComQIPtr<IMgaComponentEx>(MGACOLL_ITER);
#pragma warning(disable: 4310) // cast truncates constant value
COMTHROW(mgaConstMgr->put_InteractiveMode(VARIANT_TRUE));
@@ -1001,7 +1001,7 @@
}
}
}
- if(redo && AfxMessageBox("AddOn configuration has changed.\nRestart addons?", MB_YESNO) == IDYES) {
+ if(redo && AfxMessageBox(_T("AddOn configuration has changed.\nRestart addons?"), MB_YESNO) == IDYES) {
COMTHROW(mgaProject->EnableAutoAddOns(VARIANT_FALSE));
#pragma warning(disable: 4310) // cast truncates constant value
COMTHROW(mgaProject->EnableAutoAddOns(VARIANT_TRUE));
@@ -1019,8 +1019,8 @@
void CGMEApp::UpdateDynMenus(CMenu *toolmenu)
{
- CString runPluginLabel = "R&un Plug-In";
- CString runInterpreterLabel = "Run In&terpreter";
+ CString runPluginLabel = _T("R&un Plug-In");
+ CString runInterpreterLabel = _T("Run In&terpreter");
CString label;
// [ Begin workaround
// If you just go left to the Window menu next to the Tools menu, and back to the Tools menu (so not even abandoming the menubar)
@@ -1038,7 +1038,7 @@
for(UINT idxa = 0; idxa < mainMenu->GetMenuItemCount(); idxa++) {
CString labela;
mainMenu->GetMenuString(idxa, labela, MF_BYPOSITION);
- if (!labela.CompareNoCase("&Tools")) {
+ if (!labela.CompareNoCase(_T("&Tools"))) {
toolmenu = mainMenu->GetSubMenu(idxa);
break;
}
@@ -1193,31 +1193,31 @@
try {
HRESULT hr = reg.CoCreateInstance(CComBSTR(L"Mga.MgaRegistrar"));
if(hr != S_OK) {
- throw CString("Cannot create the registrar component\n"
- "We recommend you to reinstall GME");
+ throw CString(_T("Cannot create the registrar component\n")
+ _T("We recommend you to reinstall GME"));
}
CComBSTR conn;
CComVariant guid;
hr = reg->QueryParadigm(CComBSTR(metaname), &conn, &guid,
syscheck ? REGACCESS_SYSTEM : REGACCESS_PRIORITY);
if(hr != S_OK) {
- throw CString("Cannot access registry info for paradigm " + metaname +
- "\nWe recommend you remove and re-register the paradigm");
+ throw CString(_T("Cannot access registry info for paradigm ") + metaname +
+ _T("\nWe recommend you remove and re-register the paradigm"));
}
CComObjPtr<IMgaMetaProject> paradigm;
hr = paradigm.CoCreateInstance(OLESTR("MGA.MgaMetaProject"));
if(hr != S_OK) {
- throw CString("Cannot create the meta component\n"
- "We recommend you reinstall GME");
+ throw CString(_T("Cannot create the meta component\n")
+ _T("We recommend you reinstall GME"));
}
hr = paradigm->Open(conn);
if(hr != S_OK) {
- throw CString("Cannot open the paradigm " + metaname + "\n"
- "Probable cause is file non-existence,\n"
- "insufficient access, or format error\n"
- "Connection string: " + CString(conn));
+ throw CString(_T("Cannot open the paradigm ") + metaname + _T("\n")
+ _T("Probable cause is file non-existence,\n")
+ _T("insufficient access, or format error\n")
+ _T("Connection string: ") + CString(conn));
}
@@ -1228,15 +1228,15 @@
hr |= paradigm->Close();
if(hr != S_OK) {
- throw CString("Cannot read the paradigm " + metaname + "\n"
- "Probable cause is file format error\n"
- "Connection string: " + CString(conn));
+ throw CString(_T("Cannot read the paradigm ") + metaname + _T("\n")
+ _T("Probable cause is file format error\n")
+ _T("Connection string: ") + CString(conn));
}
if(!( parname == CComBSTR( (LPCTSTR) metaname))) {
- throw CString("The paradigm opened '" + CString(parname) + "'\n"
- "differs from the requested paradigm '"+ metaname + "'\n"
- "We recommend you unregister '" + metaname + "'\n"
- "Connection string: " + CString(conn));
+ throw CString(_T("The paradigm opened '") + CString(parname) + _T("'\n")
+ _T("differs from the requested paradigm '")+ metaname + _T("'\n")
+ _T("We recommend you unregister '") + metaname + _T("'\n")
+ _T("Connection string: ") + CString(conn));
}
@@ -1247,12 +1247,12 @@
CopyTo(guid, g);
CopyTo(g, parg2);
if(parg1 != parg2) {
- throw CString("The GUID in paradigm '" + CString(parname) + "'\n"
- "{" + CString(parg1) + "}\n"
- "differs from the requested GUID for '"+ metaname + "'\n"
- "{" + CString(parg2) + "}\n"
- "We recommend you unregister '" + metaname + "'\n"
- "Connection string: " + CString(conn));
+ throw CString(_T("The GUID in paradigm '") + CString(parname) + _T("'\n")
+ _T("{") + CString(parg1) + _T("}\n")
+ _T("differs from the requested GUID for '")+ metaname + _T("'\n")
+ _T("{") + CString(parg2) + _T("}\n")
+ _T("We recommend you unregister '") + metaname + _T("'\n")
+ _T("Connection string: ") + CString(conn));
}
} catch( CString &c) {
if(!syscheck) {
@@ -1260,12 +1260,12 @@
CComBSTR cc; CComVariant gg;
if(reg && E_NOTFOUND != reg->QueryParadigm(CComBSTR(metaname), &cc, &gg, REGACCESS_SYSTEM)) {
if(DiagnoseParadigm(metaname, true)) {
- AfxMessageBox("SYSTEM registry for '" + metaname + "' is correct\n"
- "We recommend you remove the USER registration for " + metaname);
+ AfxMessageBox(_T("SYSTEM registry for '") + metaname + _T("' is correct\n")
+ _T("We recommend you remove the USER registration for ") + metaname);
}
else {
- AfxMessageBox("SYSTEM registry for '" + metaname + "' is also incorrect\n"
- "We recommend you reinstall the paradigm.");
+ AfxMessageBox(_T("SYSTEM registry for '") + metaname + _T("' is also incorrect\n")
+ _T("We recommend you reinstall the paradigm."));
}
}
}
@@ -1300,32 +1300,32 @@
long version;
CComVariant parg;
VARIANT_BOOL ro_mode;
- if( conn.Left(5) == "MGX=\"")
+ if( conn.Left(5) == _T("MGX=\""))
{
if( E_FILEOPEN == hr) {
- consoleMessage( "Could not open project!", MSG_ERROR);
+ consoleMessage( _T("Could not open project!"), MSG_ERROR);
}
else if( E_MGA_PARADIGM_INVALID == hr) {
- consoleMessage( "Project could not access its original version of paradigm!", MSG_ERROR);
+ consoleMessage( _T("Project could not access its original version of paradigm!"), MSG_ERROR);
}
else if( E_MGA_PARADIGM_NOTREG == hr) {
- consoleMessage( "Project could not access its paradigm!", MSG_ERROR);
+ consoleMessage( _T("Project could not access its paradigm!"), MSG_ERROR);
}
else if( E_MGA_META_INCOMPATIBILITY == hr) {
- consoleMessage( "Versioned project is not compatible with the registered paradigm!", MSG_ERROR);
+ consoleMessage( _T("Versioned project is not compatible with the registered paradigm!"), MSG_ERROR);
}
else if( E_UNKNOWN_STORAGE == hr) {
// no additional comment in this case
}
else {
- consoleMessage( "Could not open project (unknown error)!", MSG_ERROR);
+ consoleMessage( _T("Could not open project (unknown error)!"), MSG_ERROR);
}
CloseProject();
return; // ensures no more exception handlers or explanatory messages (or QueryProjectInfo calls)
}
if(S_OK != mgaProject->QueryProjectInfo(PutInBstr(conn), &version, &parn, &parv, &parg, &ro_mode)) {
- AfxMessageBox("Cannot query project information. Possible cause: missing/corrupt project file or database");
+ AfxMessageBox(_T("Cannot query project information. Possible cause: missing/corrupt project file or database"));
COMTHROW(hr);
}
while(hr) {
@@ -1335,16 +1335,16 @@
bool tryit = false;
if(hr == E_MGA_MODULE_INCOMPATIBILITY) {
- msg = "WARNING: The project data is not in the current MGA format\n"
- "Do you want to upgrade it?";
+ msg = _T("WARNING: The project data is not in the current MGA format\n")
+ _T("Do you want to upgrade it?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
tryit = true;
}
}
if(hr == E_MGA_PARADIGM_INVALID) {
- msg = "WARNING: Project could not access its original version of\n"
- "paradigm '" + CString(parn) + "'\n"
- "Do you want to try with the current version of the paradigm?";
+ msg = _T("WARNING: Project could not access its original version of\n")
+ _T("paradigm '") + CString(parn) + _T("'\n")
+ _T("Do you want to try with the current version of the paradigm?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
guidpar = true;
tryit = true;
@@ -1352,10 +1352,10 @@
}
}
if(hr == E_MGA_PARADIGM_NOTREG) {
- CString msg = "Could not find paradigm paradigm '" + CString(parn);
- if (CString(parn) == "MetaGME2000")
- msg += "'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)";
- msg += "\nDo you want to import with an other registered paradigm ?";
+ CString msg = _T("Could not find paradigm paradigm '") + CString(parn);
+ if (CString(parn) == _T("MetaGME2000"))
+ msg += _T("'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)");
+ msg += _T("\nDo you want to import with an other registered paradigm ?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
CComObjPtr<IMgaLauncher> launcher;
@@ -1370,9 +1370,9 @@
}
}
if(hr == E_MGA_META_INCOMPATIBILITY && (parv.Length() > 0)) {
- msg = "WARNING: Versioned project is not compatible with the paradigm '" + CString(parn) + "'\n"
- " (Eg.: Same version string was assigned to incompatible paradigms)\n"
- "Do you want to open it based on the paradigm GUID?";
+ msg = _T("WARNING: Versioned project is not compatible with the paradigm '") + CString(parn) + _T("'\n")
+ _T(" (Eg.: Same version string was assigned to incompatible paradigms)\n")
+ _T("Do you want to open it based on the paradigm GUID?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
guidpar = parg;
tryit = true;
@@ -1390,7 +1390,7 @@
if(hr == E_MGA_COMPONENT_ERROR) {
BSTR errorInfo;
GetErrorInfo(&errorInfo);
- _bstr_t err("ERROR: automatic addon components could not start up:\n");
+ _bstr_t err(_T("ERROR: automatic addon components could not start up:\n"));
err += errorInfo;
AfxMessageBox(err);
}
@@ -1398,7 +1398,7 @@
}
if(readable_only != VARIANT_FALSE) {
- AfxMessageBox("WARNING: Project file is read-only\nChange file access or use Save As to save your work");
+ AfxMessageBox(_T("WARNING: Project file is read-only\nChange file access or use Save As to save your work"));
}
else {
CComVariant g, g2;
@@ -1420,8 +1420,8 @@
mgareg->VersionFromGUID(pname, g2, &pver2, REGACCESS_PRIORITY);
}
if(guidcmp(g, g2) && versioncmp(pver, pver2)) {
- int answer = AfxMessageBox("The paradigm used to open this file is not the current version\n"
- "Do you want to upgrade to the current paradigm?" ,MB_YESNO);
+ int answer = AfxMessageBox(_T("The paradigm used to open this file is not the current version\n")
+ _T("Do you want to upgrade to the current paradigm?") ,MB_YESNO);
if(answer == IDYES) {
COMTHROW(mgaProject->Close());
@@ -1432,13 +1432,13 @@
HRESULT hr = mgaProject->OpenEx(PutInBstr(conn), pname, g2);
if(hr == E_MGA_PARADIGM_NOTREG || hr == E_MGA_PARADIGM_INVALID) {
- AfxMessageBox("Paradigm error");
+ AfxMessageBox(_T("Paradigm error"));
DiagnoseParadigm(CString(pname));
}
else if(hr != S_OK) {
- AfxMessageBox("Upgrade failed, probably due to incompatibility.\n"
- "You can probably reopen the file without upgrade,\n"
- "and use the 'Upgrade through XML' function later.");
+ AfxMessageBox(_T("Upgrade failed, probably due to incompatibility.\n")
+ _T("You can probably reopen the file without upgrade,\n")
+ _T("and use the 'Upgrade through XML' function later."));
}
else readable_only = false;
COMTHROW(hr);
@@ -1447,7 +1447,7 @@
}
AfterOpenOrCreateProject(conn);
}
- MSGCATCH("Could not open project", CloseProject())
+ MSGCATCH(_T("Could not open project"), CloseProject())
UpdateProjectName();
@@ -1463,7 +1463,7 @@
CWaitCursor wait;
// create the project
- msg = "Fatal error while initializing project";
+ msg = _T("Fatal error while initializing project");
ASSERT( mgaProject == 0 );
COMTHROW( mgaProject.CoCreateInstance(L"Mga.MgaProject") );
ASSERT( mgaProject != NULL );
@@ -1471,11 +1471,11 @@
#pragma warning(disable: 4310) // cast truncates constant value
COMTHROW( mgaProject->EnableAutoAddOns(VARIANT_TRUE));
#pragma warning(default: 4310) // cast truncates constant value
- msg = "Could not create project";
+ msg = _T("Could not create project");
HRESULT hr = mgaProject->Create(PutInBstr(conn), PutInBstr(metaname)) ;
if(hr == E_MGA_PARADIGM_NOTREG || hr == E_MGA_PARADIGM_INVALID) {
TCHAR buf[200];
- sprintf(buf, "Could not open current version of paradigm %s",
+ _stprintf_s(buf, _T("Could not open current version of paradigm %s"),
metaname);
AfxMessageBox(buf);
@@ -1484,11 +1484,11 @@
if(hr == E_MGA_COMPONENT_ERROR) {
BSTR errorInfo;
GetErrorInfo(&errorInfo);
- _bstr_t err("ERROR: automatic addon components could not start up:\n");
+ _bstr_t err(L"ERROR: automatic addon components could not start up:\n");
err += errorInfo;
AfxMessageBox(err);
}
- if( hr == E_UNKNOWN_STORAGE && conn.Left(5) == "MGX=\"") {
+ if( hr == E_UNKNOWN_STORAGE && conn.Left(5) == _T("MGX=\"")) {
CloseProject();
return; // no more exception handler explanatory messages
}
@@ -1496,7 +1496,7 @@
AfterOpenOrCreateProject(conn);
}
- MSGCATCH("Could not create project", CloseProject())
+ MSGCATCH(_T("Could not create project"), CloseProject())
}
@@ -1504,7 +1504,7 @@
if( mgaProject != NULL ) {
HRESULT hr = mgaProject->Save(CComBSTR(conn));
if(hr != S_OK) {
- AfxMessageBox("ERROR: Could not save project\nCheck access permissions");
+ AfxMessageBox(_T("ERROR: Could not save project\nCheck access permissions"));
}
}
@@ -1560,11 +1560,11 @@
if(enablelogging != VARIANT_FALSE)
{
CGMEEventLogger::initialize();
- CGMEEventLogger::LogGMEEvent("CGMEApp::GetSettings() Event Logging Enabled\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::GetSettings() Event Logging Enabled\r\n"));
}
else
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::GetSettings() Event Logging Disabled\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::GetSettings() Event Logging Disabled\r\n"));
CGMEEventLogger::StopLogging();
}
@@ -1599,7 +1599,7 @@
COMTHROW( registrar->GetNavigation( REGACCESS_USER, &history_maintained));
maintainHistory = ( history_maintained != VARIANT_FALSE);
}
- MSGCATCH("Error while trying to get program settings",;);
+ MSGCATCH(_T("Error while trying to get program settings"),;);
if(CGMEDoc::theInstance) {
// Global AutoRouting policy changed, convert opened views if necessary
if (!useAutoRouting && oldUseAutoRouting) {
@@ -1656,7 +1656,7 @@
if( pos == NULL)
{
// No quotes found
- pos = strstr( key, _T("%1")); // Check for % 1, without quotes
+ pos = _tcsstr( key, _T("%1")); // Check for % 1, without quotes
if( pos == NULL) // No parameter at all...
pos = key+lstrlen( key)-1;
else
@@ -1669,7 +1669,8 @@
lstrcat(pos, _T(" "));
lstrcat(pos, url);
- hResult = (HINSTANCE)WinExec( key,showcmd);
+ // FIXME: should use CreateProcess
+ hResult = (HINSTANCE)WinExec( CStringA(key),showcmd);
}
}
}
@@ -1692,7 +1693,7 @@
CMgaOpenDlg dlg(CMgaOpenDlg::OpenDialog);
CString conn = dlg.AskConnectionString(true);
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileOpen "+conn+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileOpen ")+conn+_T("\r\n"));
if( conn.IsEmpty() )
return;
@@ -1702,7 +1703,7 @@
if( mgaProject != NULL )
CloseProject();
- if (conn.Left(4) == "XML=") {
+ if (conn.Left(4) == _T("XML=")) {
MSGTRY {
CString fullPath = conn.Right(conn.GetLength() - 4);
TCHAR buffer[MAX_PATH];
@@ -1714,22 +1715,22 @@
CString filename = filepart;
CString title = filename.Left(filename.ReverseFind('.'));
Importxml(fullPath, filepart, title);
- } MSGCATCH("Error opening XME file",;)
+ } MSGCATCH(_T("Error opening XME file"),;)
} else {
- if (conn.Left(4) == "MGX=") {
+ if (conn.Left(4) == _T("MGX=")) {
CString fullPath = conn.Right(conn.GetLength() - 4);
TCHAR buffer[MAX_PATH];
TCHAR* filepart = NULL;
GetFullPathName(fullPath, MAX_PATH, buffer, &filepart);
if (filepart == NULL) {
- DisplayError("Error opening MGX file", E_FILEOPEN);
+ DisplayError(_T("Error opening MGX file"), E_FILEOPEN);
return;
}
// FIXME: KMS: yes, the quotes are necessary...
- conn = "MGX=\"";
+ conn = _T("MGX=\"");
// FIXME: KMS: yes, a trailing slash makes it not work
- conn += fullPath.Left(fullPath.GetLength() - strlen(filepart) - 1);
- conn += "\"";
+ conn += fullPath.Left(fullPath.GetLength() - _tcslen(filepart) - 1);
+ conn += _T("\"");
}
OpenProject(conn);
}
@@ -1746,7 +1747,7 @@
long l;
COMTHROW(mgaProject->get_ProjectStatus(&l));
if (IsUndoPossible() && (l & PROJECT_STATUS_CHANGED))
- ret = AfxMessageBox("Save project '" + projectName + "'?", MB_YESNOCANCEL);
+ ret = AfxMessageBox(_T("Save project '") + projectName + _T("'?"), MB_YESNOCANCEL);
if (ret == IDCANCEL) {
return FALSE;
} else if (ret == IDNO) {
@@ -1775,7 +1776,7 @@
void CGMEApp::OnFileNew()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileNew\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileNew\r\n"));
MSGTRY {
CString metaname;
@@ -1813,7 +1814,7 @@
OnFileSave();
}
}
- MSGCATCH("Error creating new project",;)
+ MSGCATCH(_T("Error creating new project"),;)
}
@@ -1829,7 +1830,7 @@
ASSERT(conn.GetLength() != 0);
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnOpenRecentProject "+conn+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnOpenRecentProject ")+conn+_T("\r\n"));
CWaitCursor wait;
@@ -1848,7 +1849,7 @@
if(mgaProject != NULL && (proj_type_is_mga||proj_type_is_xmlbackend)) {
HRESULT hr = mgaProject->Save(NULL);
if(hr != S_OK) {
- AfxMessageBox("ERROR: Could not save project\nCheck access permissions");
+ AfxMessageBox(_T("ERROR: Could not save project\nCheck access permissions"));
return false;
}
abort_on_close = true;
@@ -1863,7 +1864,7 @@
void CGMEApp::OnFileCloseproject()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileCloseproject\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileCloseproject\r\n"));
SaveAllModified();
}
@@ -1871,19 +1872,19 @@
void CGMEApp::OnFileSaveAs() {
CMgaOpenDlg dlg(CMgaOpenDlg::SaveAsDialog);
CString spec_ext;
- if( currentConnection.Left(4) == "MGA=") // if MGA format
+ if( currentConnection.Left(4) == _T("MGA=")) // if MGA format
{
int rps = currentConnection.ReverseFind('.');
if( rps != -1 && rps < currentConnection.GetLength())
{
spec_ext = currentConnection.Mid( rps + 1);
- if( spec_ext.CompareNoCase( "mga") == 0) // oh, just the plain 'mga' extension
- spec_ext = ""; // we need not have specific behaviour
+ if( spec_ext.CompareNoCase( _T("mga")) == 0) // oh, just the plain 'mga' extension
+ spec_ext = _T(""); // we need not have specific behaviour
}
}
CString conn = dlg.AskMGAConnectionString( spec_ext);
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileSaveAs "+conn+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileSaveAs ")+conn+_T("\r\n"));
if( conn.IsEmpty() )
return;
@@ -1894,21 +1895,21 @@
void CGMEApp::OnFileSave()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileSave\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileSave\r\n"));
BeginWaitCursor();
- SaveProject("");
+ SaveProject(_T(""));
EndWaitCursor();
}
void CGMEApp::OnFileAbortProject()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileAbortProject\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileAbortProject\r\n"));
((CMainFrame*)m_pMainWnd)->clearMgaProj();
long l;
COMTHROW(mgaProject->get_ProjectStatus(&l));
if(!abort_on_close && IsUndoPossible() && (l & PROJECT_STATUS_CHANGED) &&
- AfxMessageBox("Discard edits to project " + projectName + "?",
+ AfxMessageBox(_T("Discard edits to project ") + projectName + _T("?"),
MB_OKCANCEL) == IDCANCEL) {
return;
}
@@ -1923,7 +1924,7 @@
void CGMEApp::OnFileExportxml()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileExportxml ");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileExportxml "));
MSGTRY
{
CComPtr<IMgaDumper> dumper;
@@ -1934,16 +1935,16 @@
CString initialDir;
if (theApp.isMgaProj()) {
CString conn = theApp.connString();
- const char* zsConn = conn;
+ const TCHAR* zsConn = conn;
zsConn += 4; // skip MGA=
- char currentMgaPath[MAX_PATH];
- char* filename;
+ TCHAR currentMgaPath[MAX_PATH];
+ TCHAR* filename;
if (!GetFullPathName(zsConn, MAX_PATH, currentMgaPath, &filename) || filename == 0) {
} else {
initialFile = filename;
- if (initialFile.Right(3) == "mga") {
+ if (initialFile.Right(3) == _T("mga")) {
initialFile.Truncate(initialFile.GetLength() - 3);
- initialFile += "xme";
+ initialFile += _T("xme");
}
filename--;
*filename = '\0';
@@ -1951,53 +1952,53 @@
}
}
- CFileDialog dlg(FALSE, "xme", initialFile,
+ CFileDialog dlg(FALSE, _T("xme"), initialFile,
OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR,
- "Exported Files (*.xme)|*.xme|All Files (*.*)|*.*||");
+ _T("Exported Files (*.xme)|*.xme|All Files (*.*)|*.*||"));
if (initialDir)
{
dlg.GetOFN().lpstrInitialDir = initialDir;
}
if( dlg.DoModal() != IDOK )
{
- CGMEEventLogger::LogGMEEvent("Canceled\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("Canceled\r\n"));
return;
}
- CGMEEventLogger::LogGMEEvent(dlg.GetPathName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(dlg.GetPathName()+_T("\r\n"));
CWaitCursor wait;
COMTHROW( dumper->DumpProject(theApp.mgaProject,PutInBstr(dlg.GetPathName())) );
- if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( CString( "Project successfully exported into ") + dlg.GetPathName() + ".", 1);
+ if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( CString( _T("Project successfully exported into ")) + dlg.GetPathName() + _T("."), 1);
}
- MSGCATCH("Error while generating XML file",;)
+ MSGCATCH(_T("Error while generating XML file"),;)
}
void CGMEApp::OnFileImportxml()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileImportxml ");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileImportxml "));
- CString new_file_name = "";
+ CString new_file_name = _T("");
MSGTRY
{
- CFileDialog dlg(TRUE, "xme", (LPCTSTR) new_file_name,
+ CFileDialog dlg(TRUE, _T("xme"), (LPCTSTR) new_file_name,
OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
OFN_FILEMUSTEXIST,
- "GME Exported Files (*.xme;*.xml)|*.xme; *.xml|All Files (*.*)|*.*||");
+ _T("GME Exported Files (*.xme;*.xml)|*.xme; *.xml|All Files (*.*)|*.*||"));
if( dlg.DoModal() != IDOK )
{
- CGMEEventLogger::LogGMEEvent("Cancelled\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("Cancelled\r\n"));
return;
}
- CGMEEventLogger::LogGMEEvent(dlg.GetPathName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(dlg.GetPathName()+_T("\r\n"));
CString fullPath = dlg.GetPathName();
CString fname = dlg.GetFileName();
CString ftitle = dlg.GetFileTitle();
Importxml(fullPath, fname, ftitle);
}
- MSGCATCH("Error importing XML file",;)
+ MSGCATCH(_T("Error importing XML file"),;)
}
void CGMEApp::Importxml(CString fullPath, CString fname, CString ftitle)
@@ -2008,11 +2009,11 @@
CString folderPath = fullPath.Left(fullPath.GetLength() - fname.GetLength());
- if (fullPath.Right(3).CompareNoCase("xml") == 0 ) {
+ if (fullPath.Right(3).CompareNoCase(_T("xml")) == 0 ) {
AfxMessageBox(
- "Newer versions of GME use the \".xme.\" filename extension\n"
- "for exported XML data files.\n"
- "Please, rename your existing files to avoid further problems!\n",
+ _T("Newer versions of GME use the \".xme.\" filename extension\n")
+ _T("for exported XML data files.\n")
+ _T("Please, rename your existing files to avoid further problems!\n"),
MB_OK | MB_ICONINFORMATION);
}
@@ -2033,7 +2034,7 @@
opdlg.SetFolderPathHint(folderPath);
dataconn = opdlg.AskConnectionString(false);
if (dataconn.IsEmpty()) {
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileImportxml exited because empty connection string has been given");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileImportxml exited because empty connection string has been given"));
return;
}
@@ -2045,13 +2046,13 @@
CComVariant pg2;
conn.Empty();
HRESULT h2 = reg->QueryParadigm(paradigm, PutOut(conn), &pg2, REGACCESS_PRIORITY);
- char buf[300];
+ TCHAR buf[300];
if(h2 != S_OK) {
ASSERT(h1 != S_OK);
- CString msg = "Could not find paradigm paradigm '" + CString(paradigm);
- if (CString(paradigm) == "MetaGME2000")
- msg += "'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)";
- msg += "\nDo you want to import with an other registered paradigm ?";
+ CString msg = _T("Could not find paradigm paradigm '") + CString(paradigm);
+ if (CString(paradigm) == _T("MetaGME2000"))
+ msg += _T("'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)");
+ msg += _T("\nDo you want to import with an other registered paradigm ?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(CComBSTR(L"Mga.MgaLauncher")) );
@@ -2080,28 +2081,28 @@
CopyTo(gg, parguid2);
if(h1 != S_OK) {
- sprintf(buf, "Could not locate paradigm %s\nVersion ID: %s\n"
- "Do you want to upgrade to the current version instead?\nCurrent ID: %s",
+ _stprintf_s(buf, _T("Could not locate paradigm %s\nVersion ID: %s\n")
+ _T("Do you want to upgrade to the current version instead?\nCurrent ID: %s"),
PutInCString(paradigm), PutInCString(parguid1), PutInCString(parguid2));
if(AfxMessageBox(buf,MB_OKCANCEL | MB_ICONQUESTION) == IDOK) {
parguid = pg2;
}
else {
- AfxMessageBox("Import canceled");
+ AfxMessageBox(_T("Import canceled"));
return; // safe before create
}
}
else if(parguid1.Compare(parguid2)) {
- sprintf(buf, "This model was exported using paradigm %s\nVersion ID: %s\n"
- "Do you want to upgrade to the current version?\nCurrent ID: %s",
+ _stprintf_s(buf, _T("This model was exported using paradigm %s\nVersion ID: %s\n")
+ _T("Do you want to upgrade to the current version?\nCurrent ID: %s"),
PutInCString(paradigm), PutInCString(parguid1), PutInCString(parguid2));
int answer = AfxMessageBox(buf,MB_YESNOCANCEL | MB_ICONQUESTION);
if(answer == IDYES) {
parguid = pg2;
}
else if(answer == IDCANCEL) {
- AfxMessageBox("Import canceled");
+ AfxMessageBox(_T("Import canceled"));
return; // safe before create
}
}
@@ -2113,12 +2114,12 @@
#pragma warning(default: 4310) // cast truncates constant value
HRESULT hr = mgaProject->CreateEx(PutInBstr(dataconn), PutInBstr(paradigm), parguid);
if(hr == E_MGA_PARADIGM_NOTREG || hr == E_MGA_PARADIGM_INVALID) {
- char buf[300];
+ TCHAR buf[300];
CComBstrObj parguid1;
GUID gg;
CopyTo(parguid,gg);
CopyTo(gg, parguid1);
- sprintf(buf, "Could not open paradigm %s\nVersion ID: %s",
+ _stprintf_s(buf, _T("Could not open paradigm %s\nVersion ID: %s"),
PutInCString(paradigm), PutInCString(parguid1));
AfxMessageBox(buf);
@@ -2126,7 +2127,7 @@
if(hr == E_MGA_COMPONENT_ERROR) {
CComBSTR errorInfo;
GetErrorInfo(&errorInfo);
- _bstr_t err("ERROR: automatic addon components could not start up:\n");
+ _bstr_t err(L"ERROR: automatic addon components could not start up:\n");
err += (BSTR)errorInfo;
AfxMessageBox(err);
}
@@ -2134,7 +2135,7 @@
AfterOpenOrCreateProject(dataconn);
} catch(hresult_exception &e) {
CloseProject();
- DisplayError("Could not create the project", e.hr);
+ DisplayError(_T("Could not create the project"), e.hr);
throw;
}
}
@@ -2145,7 +2146,7 @@
if(mgaConstMgr) COMTHROW(mgaConstMgr->Enable(false));
CString file_name = fullPath;
- if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( CString( "Importing ") + file_name + "...", 1);
+ if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( CString( _T("Importing ")) + file_name + _T("..."), 1);
COMTHROW(parser->ParseProject(theApp.mgaProject,PutInBstr(fullPath)) );
// mgaproject has been filled with data, let's update title:
@@ -2155,8 +2156,8 @@
OnFileSave();
}
- if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( fullPath + " was successfully imported.", 1);
- else AfxMessageBox(fullPath + " was successfully imported.");
+ if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( fullPath + _T(" was successfully imported."), 1);
+ else AfxMessageBox(fullPath + _T(" was successfully imported."));
if (mgaConstMgr) COMTHROW(mgaConstMgr->Enable(true));
}
@@ -2165,15 +2166,15 @@
void CGMEApp::OnFileXMLUpdate()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileXMLUpdate\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileXMLUpdate\r\n"));
ASSERT(mgaProject);
ASSERT(mgaMetaProject);
TCHAR xmlname[MAX_PATH];
- GetTempFileName(".", "XEX",0, xmlname);
+ GetTempFileName(_T("."), _T("XEX"),0, xmlname);
- if(currentConnection.Find("MGA=") != 0) {
- AfxMessageBox("Function is available only for .mga models");
+ if(currentConnection.Find(_T("MGA=")) != 0) {
+ AfxMessageBox(_T("Function is available only for .mga models"));
}
CString fname = currentConnection.Mid(4);
@@ -2206,8 +2207,8 @@
CopyTo(gg, currentguid);
if(!parguid1.Compare(currentguid)) {
- char buf[200];
- sprintf(buf, "There is no need to upgrade this model\nIts Meta Version ID is the current ID\nCurrent ID: %s",
+ TCHAR buf[200];
+ _stprintf_s(buf, _T("There is no need to upgrade this model\nIts Meta Version ID is the current ID\nCurrent ID: %s"),
PutInCString(currentguid));
AfxMessageBox(buf);
return;
@@ -2227,12 +2228,12 @@
backupname = fname;
int p = backupname.ReverseFind('.');
if(!p || backupname.Find('\\',p) != -1) p = backupname.GetLength();
- backupname.Insert(p,"-backup");
+ backupname.Insert(p,_T("-backup"));
DeleteFile(backupname);
if(!MoveFile(fname, backupname)) {
backupname = fname;
- char buf[300];
- sprintf( buf, "Could not save original file '%s' to '%s'", fname, backupname);
+ TCHAR buf[300];
+ _stprintf_s( buf, _T("Could not save original file '%s' to '%s'"), fname, backupname);
AfxMessageBox(buf);
COMTHROW(E_NOTFOUND);
}
@@ -2242,7 +2243,7 @@
CreateProject(PutInCString(parname), currentConnection);
if(!mgaProject || !mgaMetaProject) {
- AfxMessageBox("Error creating project");
+ AfxMessageBox(_T("Error creating project"));
return;
}
@@ -2255,23 +2256,23 @@
if(mgaConstMgr) COMTHROW(mgaConstMgr->Enable(false));
COMTHROW(parser->ParseProject(mgaProject, PutInBstr(CString(xmlname))) );
{
- char buf[200];
- sprintf(buf, "The model has been updated\nCurrent ID: %s\nThe original model has been saved to %s",
+ TCHAR buf[200];
+ _stprintf_s(buf, _T("The model has been updated\nCurrent ID: %s\nThe original model has been saved to %s"),
PutInCString(currentguid), backupname);
AfxMessageBox(buf);
}
}
catch(hresult_exception &e) {
- char buf[200];
+ TCHAR buf[200];
if(backupname.IsEmpty()) {
- sprintf(buf, "The upgrade failed: %ld\nThe model has not been closed", e.hr);
+ _stprintf_s(buf, _T("The upgrade failed: %ld\nThe model has not been closed"), e.hr);
AfxMessageBox(buf);
}
else {
if(backupname.Compare(fname)) {
if(MoveFile(backupname, fname)) backupname = fname;
}
- sprintf(buf, "The upgrade failed: %ld\nThe original model is in file %s", e.hr, backupname);
+ _stprintf_s(buf, _T("The upgrade failed: %ld\nThe original model is in file %s"), e.hr, backupname);
AfxMessageBox(buf);
}
}
@@ -2283,7 +2284,7 @@
void CGMEApp::OnFileRegcomponents()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileRegcomponents ");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileRegcomponents "));
MSGTRY
{
CComObjPtr<IMgaLauncher> launcher;
@@ -2301,7 +2302,7 @@
CComBSTR p;
if(compx) COMTHROW(compx->get_ComponentProgID(&p));
else COMTHROW(MGACOLL_ITER->get_ComponentName(&p));
- if(runningcomps) runningcomps += " ";
+ if(runningcomps) runningcomps += _T(" ");
runningcomps += p;
}
MGACOLL_ITERATE_END;
@@ -2309,24 +2310,24 @@
// FIXME: huge kludge here: enables CCompDlg to show which addons are running
COMTHROW(launcher->put_Parameter(CComVariant(runningcomps)));
- CGMEEventLogger::LogGMEEvent(CString(runningcomps)+"\r\n");
+ CGMEEventLogger::LogGMEEvent(CString(runningcomps)+_T("\r\n"));
COMTHROW( launcher->ComponentDlg(COMPONENTDLG_INTERP));
UpdateComponentLists(true);
}
- MSGCATCH("Error while trying to register the interpreter",;)
+ MSGCATCH(_T("Error while trying to register the interpreter"),;)
}
void CGMEApp::OnFileSettings()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileSettings\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileSettings\r\n"));
MSGTRY
{
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
COMTHROW( launcher->GmeDlg());
}
- MSGCATCH("Error while trying to get GME settings",;)
+ MSGCATCH(_T("Error while trying to get GME settings"),;)
GetSettings();
}
@@ -2352,26 +2353,26 @@
COMTHROW( project->CheckLocks(PutInBstr(conn), VARIANT_TRUE) );
#pragma warning(default: 4310) // cast truncates constant value
- AfxMessageBox("Database locks are cleared");
+ AfxMessageBox(_T("Database locks are cleared"));
}
- MSGCATCH("Error while clearing locks in database",;)
+ MSGCATCH(_T("Error while clearing locks in database"),;)
}
void CGMEApp::OnHelpContents()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnHelpContents\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnHelpContents\r\n"));
MSGTRY {
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
COMTHROW( launcher->ShowHelp(NULL) );
}
- MSGCATCH("Error while showing help contents.",;)
+ MSGCATCH(_T("Error while showing help contents."),;)
}
void CGMEApp::OnFileCheckall()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileCheckall\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileCheckall\r\n"));
ASSERT(mgaConstMgr);
if (!mgaConstMgr)
return;
@@ -2381,7 +2382,7 @@
void CGMEApp::OnFileDisplayConstraints()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileDisplayConstraints\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileDisplayConstraints\r\n"));
ASSERT(mgaConstMgr);
if (!mgaConstMgr)
return;
@@ -2393,7 +2394,7 @@
void CGMEApp::OnFileRegparadigms()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnFileRegparadigms\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileRegparadigms\r\n"));
MSGTRY
{
CComPtr<IMgaLauncher> launcher;
@@ -2422,7 +2423,7 @@
CComBSTR p;
if(compx) COMTHROW(compx->get_ComponentProgID(&p));
else COMTHROW(MGACOLL_ITER->get_ComponentName(&p));
- if(runningcomps) runningcomps += " ";
+ if(runningcomps) runningcomps += _T(" ");
runningcomps += p;
}
MGACOLL_ITERATE_END;
@@ -2433,7 +2434,7 @@
if(workonrunningparadigm) UpdateComponentLists(true);
}
- } MSGCATCH("Error registering paradigms", ;);
+ } MSGCATCH(_T("Error registering paradigms"), ;);
}
@@ -2511,7 +2512,7 @@
void CGMEApp::OnEditProjectproperties()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnEditProjectproperties " + projectName +"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnEditProjectproperties ") + projectName +_T("\r\n"));
CProjectPropertiesDlg dlg;
if(dlg.DoModal() == IDOK) {
if(CGMEDoc::theInstance)
@@ -2523,28 +2524,28 @@
void CGMEApp::OnEditUndo()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnEditUndo\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnEditUndo\r\n"));
mgaProject->Undo();
}
void CGMEApp::OnEditRedo()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnEditRedo\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnEditRedo\r\n"));
mgaProject->Redo();
}
void CGMEApp::OnEditClearUndo()
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnEditClearUndo\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnEditClearUndo\r\n"));
if( mgaProject == NULL )
return;
- if(AfxMessageBox("You are about to loose all Undo/Redo information. Proceed?",MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if(AfxMessageBox(_T("You are about to loose all Undo/Redo information. Proceed?"),MB_YESNO | MB_ICONQUESTION) == IDYES) {
MSGTRY
{
COMTHROW( mgaProject->FlushUndoQueue() );
}
- MSGCATCH("Error while clearing the undo queue",;)
+ MSGCATCH(_T("Error while clearing the undo queue"),;)
}
}
@@ -2619,7 +2620,7 @@
*/
void CGMEApp::OnRunPlugin(UINT nID) {
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnRunPlugin "+plugins[nID - ID_FILE_RUNPLUGIN1]+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnRunPlugin ")+plugins[nID - ID_FILE_RUNPLUGIN1]+_T("\r\n"));
// Focus must be killed to flush ObjectInspector and Browser
::SetFocus(NULL);
@@ -2628,7 +2629,7 @@
}
void CGMEApp::OnRunInterpreter(UINT nID) {
- CGMEEventLogger::LogGMEEvent("CGMEApp::OnRunInterpreter "+interpreters[nID - ID_FILE_INTERPRET1]+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnRunInterpreter ")+interpreters[nID - ID_FILE_INTERPRET1]+_T("\r\n"));
// Focus must be killed to flush ObjectInspector and Browser
::SetFocus(NULL);
@@ -2644,7 +2645,7 @@
CComPtr<IMgaLauncher> launcher;
launcher.CoCreateInstance(CComBSTR(L"Mga.MgaLauncher") );
if(!launcher) {
- AfxMessageBox("Cannot start up component launcher");
+ AfxMessageBox(_T("Cannot start up component launcher"));
}
else {
CComPtr<IMgaFCO> focus;
@@ -2672,12 +2673,12 @@
if (errinfo) {
_bstr_t desc;
errinfo->GetDescription(desc.GetAddress());
- std::string error;
- error += "Component execution failed: ";
- error += static_cast<const char*>(desc);
+ std::wstring error;
+ error += L"Component execution failed: ";
+ error += desc;
AfxMessageBox(error.c_str());
} else {
- AfxMessageBox("Component execution failed");
+ AfxMessageBox(_T("Component execution failed"));
}
}
}
@@ -2703,7 +2704,7 @@
void CGMEApp::ImportDroppedFile(const CString& fname)
{
- CGMEEventLogger::LogGMEEvent("CGMEApp::ImportFile ");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEApp::ImportFile "));
CString file_name = fname;
@@ -2753,13 +2754,13 @@
CComVariant pg2;
conn.Empty();
HRESULT h2 = reg->QueryParadigm(paradigm, PutOut(conn), &pg2, REGACCESS_PRIORITY);
- char buf[300];
+ TCHAR buf[300];
if (h2 != S_OK) {
ASSERT(h1 != S_OK);
- CString msg = "Could not find paradigm paradigm '" + CString(paradigm);
- if (CString(paradigm) == "MetaGME2000")
- msg += "'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)";
- msg += "\nDo you want to import with an other registered paradigm ?";
+ CString msg = _T("Could not find paradigm paradigm '") + CString(paradigm);
+ if (CString(paradigm) == _T("MetaGME2000"))
+ msg += _T("'\n (In GME3 the MetaGME2000 paradigm was renamed to MetaGME)");
+ msg += _T("\nDo you want to import with an other registered paradigm ?");
if (AfxMessageBox(msg ,MB_OKCANCEL) == IDOK) {
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(CComBSTR(L"Mga.MgaLauncher")) );
@@ -2788,25 +2789,25 @@
CopyTo(gg, parguid2);
if(h1 != S_OK) {
- sprintf(buf, "Could not locate paradigm %s\nVersion ID: %s\n"
- "Do you want to upgrade to the current version instead?\nCurrent ID: %s",
+ _stprintf_s(buf, _T("Could not locate paradigm %s\nVersion ID: %s\n")
+ _T("Do you want to upgrade to the current version instead?\nCurrent ID: %s"),
PutInCString(paradigm), PutInCString(parguid1), PutInCString(parguid2));
if (AfxMessageBox(buf,MB_OKCANCEL | MB_ICONQUESTION) == IDOK) {
parguid = pg2;
} else {
- AfxMessageBox("Import canceled");
+ AfxMessageBox(_T("Import canceled"));
return; // safe before create
}
}
else if(parguid1.Compare(parguid2)) {
- sprintf(buf, "This model was exported using paradigm %s\nVersion ID: %s\n"
- "Do you want to upgrade to the current version?\nCurrent ID: %s",
+ _stprintf_s(buf, _T("This model was exported using paradigm %s\nVersion ID: %s\n")
+ _T("Do you want to upgrade to the current version?\nCurrent ID: %s"),
PutInCString(paradigm), PutInCString(parguid1), PutInCString(parguid2));
int answer = AfxMessageBox(buf,MB_YESNOCANCEL | MB_ICONQUESTION);
if (answer == IDYES) {
parguid = pg2;
} else if (answer == IDCANCEL) {
- AfxMessageBox("Import canceled");
+ AfxMessageBox(_T("Import canceled"));
return; // safe before create
}
}
@@ -2818,12 +2819,12 @@
#pragma warning(default: 4310) // cast truncates constant value
HRESULT hr = mgaProject->CreateEx(PutInBstr(dataconn), PutInBstr(paradigm), parguid);
if(hr == E_MGA_PARADIGM_NOTREG || hr == E_MGA_PARADIGM_INVALID) {
- char buf[300];
+ TCHAR buf[300];
CComBstrObj parguid1;
GUID gg;
CopyTo(parguid,gg);
CopyTo(gg, parguid1);
- sprintf(buf, "Could not open paradigm %s\nVersion ID: %s",
+ _stprintf_s(buf, _T("Could not open paradigm %s\nVersion ID: %s"),
PutInCString(paradigm), PutInCString(parguid1));
AfxMessageBox(buf);
@@ -2831,7 +2832,7 @@
if(hr == E_MGA_COMPONENT_ERROR) {
BSTR errorInfo;
GetErrorInfo(&errorInfo);
- _bstr_t err("ERROR: automatic addon components could not start up:\n");
+ _bstr_t err(L"ERROR: automatic addon components could not start up:\n");
err += errorInfo;
AfxMessageBox(err);
}
@@ -2839,7 +2840,7 @@
AfterOpenOrCreateProject(dataconn);
} catch(hresult_exception &e) {
CloseProject();
- DisplayError("Could not create the project", e.hr);
+ DisplayError(_T("Could not create the project"), e.hr);
throw;
}
}
@@ -2858,10 +2859,10 @@
OnFileSave();
}
- if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( file_name + " was successfully imported.", 1);
- else AfxMessageBox(file_name + " was successfully imported.");
+ if( CMainFrame::theInstance) CMainFrame::theInstance->m_console.Message( file_name + _T(" was successfully imported."), 1);
+ else AfxMessageBox(file_name + _T(" was successfully imported."));
}
- MSGCATCH("Error importing XML file",;)
+ MSGCATCH(_T("Error importing XML file"),;)
if (mgaConstMgr) COMTHROW(mgaConstMgr->Enable(true));
}
@@ -2880,11 +2881,11 @@
CComBSTR newname;
COMTHROW(registrar->RegisterParadigmFromData(PutInBstr( fname), &newname, reg_access));
- CMainFrame::theInstance->m_console.Message( "Done.", 1);
+ CMainFrame::theInstance->m_console.Message( _T("Done."), 1);
}
catch( hresult_exception &)
{
- CMainFrame::theInstance->m_console.Message( "Error while registering paradigm!", 3);
+ CMainFrame::theInstance->m_console.Message( _T("Error while registering paradigm!"), 3);
}
}
@@ -2973,8 +2974,8 @@
int nm_of_tokens = 0; // will count the parsed kind names
int pos = 0;
CString t_kind;
- t_kind = pKindSeq.Tokenize( ";", pos); // tokenize by ';'
- while( t_kind != "")
+ t_kind = pKindSeq.Tokenize( _T(";"), pos); // tokenize by ';'
+ while( t_kind != _T(""))
{
ONE_COMP_LIST &my_comps = m_compsOfKind[ t_kind ];
ONE_COMP_LIST::const_iterator it = my_comps.find( pComp);
@@ -2982,7 +2983,7 @@
m_compsOfKind[ t_kind ].insert( pComp);
++nm_of_tokens;
- t_kind = pKindSeq.Tokenize( ";", pos); // move to next token
+ t_kind = pKindSeq.Tokenize( _T(";"), pos); // move to next token
}
}
@@ -3110,7 +3111,7 @@
return;
}
}
- MSGCATCH("Error getting project rootfolder", mgaProject->AbortTransaction())
+ MSGCATCH(_T("Error getting project rootfolder"), mgaProject->AbortTransaction())
}
MSGTRY
@@ -3125,7 +3126,7 @@
if( id.Length() > 0)
CGMEBrowser::theInstance->FocusItem( id);
}
- MSGCATCH("Error getting project rootfolder", mgaProject->AbortTransaction())
+ MSGCATCH(_T("Error getting project rootfolder"), mgaProject->AbortTransaction())
}
void CGMEApp::OnFocusInspector()
Modified: trunk/GME/Gme/GMEApp.h
==============================================================================
--- trunk/GME/Gme/GMEApp.h Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEApp.h Thu Mar 31 16:33:52 2011 (r1241)
@@ -126,7 +126,7 @@
// called from CGMEView:
void UpdateCompList4CurrentKind( const CString& kind);
- static const char * m_no_model_open_string;
+ static const TCHAR * m_no_model_open_string;
// directory preferred by the user
CString m_preferredPath;
Modified: trunk/GME/Gme/GMEBrowser.cpp
==============================================================================
--- trunk/GME/Gme/GMEBrowser.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEBrowser.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -135,7 +135,7 @@
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
- if(!m_GMEActiveBrowser.Create("ttt",WS_CHILD | WS_VISIBLE,CRect(0,0,100,100),this,IDC_GME_ACTIVE_BROWSER_CTRL))
+ if(!m_GMEActiveBrowser.Create(_T("ttt"),WS_CHILD | WS_VISIBLE,CRect(0,0,100,100),this,IDC_GME_ACTIVE_BROWSER_CTRL))
return -1;
/* m_szMin = CSize(200,200);
Modified: trunk/GME/Gme/GMEChildFrame.cpp
==============================================================================
--- trunk/GME/Gme/GMEChildFrame.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEChildFrame.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -54,7 +54,7 @@
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
- if (!m_ChildFrame.Create("ChildFrame", WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_CHILDFRAMECTRL1))
+ if (!m_ChildFrame.Create(_T("ChildFrame"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_CHILDFRAMECTRL1))
return -1;
return 0;
Modified: trunk/GME/Gme/GMEConsole.cpp
==============================================================================
--- trunk/GME/Gme/GMEConsole.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEConsole.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -57,7 +57,7 @@
return -1;
- if(!m_Console.Create("Console",WS_CHILD | WS_BORDER | WS_VISIBLE,CRect(0,0,230,300),this,IDC_CONSOLE_CTRL)) {
+ if(!m_Console.Create(_T("Console"),WS_CHILD | WS_BORDER | WS_VISIBLE,CRect(0,0,230,300),this,IDC_CONSOLE_CTRL)) {
return -1;
}
Modified: trunk/GME/Gme/GMEDoc.cpp
==============================================================================
--- trunk/GME/Gme/GMEDoc.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEDoc.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -83,7 +83,7 @@
COMTHROW( resolver.CoCreateInstance(L"Mga.MgaResolver"));
}
catch(hresult_exception e) {
- AfxMessageBox("Fatal error: cannot create MGA Resolver component!",MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Fatal error: cannot create MGA Resolver component!"),MB_OK | MB_ICONSTOP);
}
}
@@ -378,7 +378,7 @@
if( number_of_elems == 0)
{
- AfxMessageBox("No object selected", MB_ICONERROR);
+ AfxMessageBox(_T("No object selected"), MB_ICONERROR);
return;
}
@@ -395,7 +395,7 @@
// if container selected no other kinds allowed
//if( any_container && !all_containers || number_of_elems > 1 && all_containers)
//{
- // AfxMessageBox("Invalid selection for smart copy. You can select either one container or several non-containers.", MB_ICONERROR);
+ // AfxMessageBox(_T("Invalid selection for smart copy. You can select either one container or several non-containers."), MB_ICONERROR);
// return;
//}
@@ -653,7 +653,7 @@
if (!theApp.multipleView) {
view = FindView(model);
if(!view) {
- SetNextToView(model,"", fco);
+ SetNextToView(model,_T(""), fco);
}
else {
#if !defined (ACTIVEXGMEVIEW)
@@ -667,7 +667,7 @@
}
}
else {
- SetNextToView(model,"", fco);
+ SetNextToView(model,_T(""), fco);
}
CMainFrame::theInstance->CreateNewView(view, model);
@@ -856,7 +856,7 @@
void CGMEDoc::OnModeAutoconnect()
{
CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeAutoconnect\r\n");
- SetEditMode(GME_AUTOCONNECT_MODE, "AUTOCONNECT");
+ SetEditMode(GME_AUTOCONNECT_MODE, _T("AUTOCONNECT"));
}
void CGMEDoc::OnUpdateModeAutoconnect(CCmdUI* pCmdUI)
@@ -867,7 +867,7 @@
void CGMEDoc::OnModeDisconnect()
{
CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeDisconnect\r\n");
- SetEditMode(GME_DISCONNECT_MODE, "DISCONNECT");
+ SetEditMode(GME_DISCONNECT_MODE, _T("DISCONNECT"));
}
void CGMEDoc::OnUpdateModeDisconnect(CCmdUI* pCmdUI)
@@ -877,8 +877,8 @@
void CGMEDoc::OnModeEdit()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeEdit\r\n");
- SetEditMode(GME_EDIT_MODE, "EDIT");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeEdit\r\n"));
+ SetEditMode(GME_EDIT_MODE, _T("EDIT"));
}
void CGMEDoc::OnUpdateModeEdit(CCmdUI* pCmdUI)
@@ -888,8 +888,8 @@
void CGMEDoc::OnModeSet()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeSet\r\n");
- SetEditMode(GME_SET_MODE, "SET");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeSet\r\n"));
+ SetEditMode(GME_SET_MODE, _T("SET"));
}
void CGMEDoc::OnUpdateModeSet(CCmdUI* pCmdUI)
@@ -899,8 +899,8 @@
void CGMEDoc::OnModeZoom()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeZoom\r\n");
- SetEditMode(GME_ZOOM_MODE, "ZOOM");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeZoom\r\n"));
+ SetEditMode(GME_ZOOM_MODE, _T("ZOOM"));
}
void CGMEDoc::OnUpdateModeZoom(CCmdUI* pCmdUI)
@@ -910,8 +910,8 @@
void CGMEDoc::OnModeVisualize()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeVisualize\r\n");
- SetEditMode(GME_VISUAL_MODE, "VISUALIZE");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeVisualize\r\n"));
+ SetEditMode(GME_VISUAL_MODE, _T("VISUALIZE"));
}
void CGMEDoc::OnUpdateModeVisualize(CCmdUI* pCmdUI)
@@ -921,8 +921,8 @@
void CGMEDoc::OnModeShortConnect()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeShortConnect\r\n");
- SetEditMode(GME_SHORTAUTOCONNECT_MODE, "AUTOCONNECT");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeShortConnect\r\n"));
+ SetEditMode(GME_SHORTAUTOCONNECT_MODE, _T("AUTOCONNECT"));
}
void CGMEDoc::OnUpdateModeShortConnect(CCmdUI* pCmdUI)
@@ -932,8 +932,8 @@
void CGMEDoc::OnModeShortDisconnect()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnModeShortDisconnect\r\n");
- SetEditMode(GME_SHORTDISCONNECT_MODE, "DISCONNECT");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnModeShortDisconnect\r\n"));
+ SetEditMode(GME_SHORTDISCONNECT_MODE, _T("DISCONNECT"));
}
void CGMEDoc::OnUpdateModeShortDisconnect(CCmdUI* pCmdUI)
@@ -949,7 +949,7 @@
void CGMEDoc::OnCloseDocument(bool suppressErrors)
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnCloseDocument\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnCloseDocument\r\n"));
m_isClosing = true;
POSITION pos = GetFirstViewPosition();
while (pos) {
@@ -973,7 +973,7 @@
BOOL CGMEDoc::OnNewDocument()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnNewDocument\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnNewDocument\r\n"));
if (!CDocument::OnNewDocument())
return FALSE;
@@ -985,7 +985,7 @@
BOOL CGMEDoc::OnOpenDocument(LPCTSTR /*lpszPathName*/)
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnOpenDocument\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnOpenDocument\r\n"));
if (!CDocument::OnNewDocument())
return FALSE;
@@ -997,7 +997,7 @@
void CGMEDoc::OnViewRefresh()
{
- CGMEEventLogger::LogGMEEvent("CGMEDoc::OnViewRefresh\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::OnViewRefresh\r\n"));
ResetAllViews();
CGMEBrowser::theInstance->RefreshAll();
}
@@ -1017,7 +1017,7 @@
presentModel( prev.id().c_str(), prev.aspect().c_str());
}
else
- CGMEConsole::theInstance->Message( "Could not go further backward", 1);
+ CGMEConsole::theInstance->Message( _T("Could not go further backward"), 1);
}
}
@@ -1033,7 +1033,7 @@
presentModel( e.id().c_str(), e.aspect().c_str());
}
else
- CGMEConsole::theInstance->Message( "Could not go further forward", 1);
+ CGMEConsole::theInstance->Message( _T("Could not go further forward"), 1);
}
}
@@ -1048,7 +1048,7 @@
presentModel( home.id().c_str(), home.aspect().c_str());
}
else
- CGMEConsole::theInstance->Message( "Could not go home", 1);
+ CGMEConsole::theInstance->Message( _T("Could not go home"), 1);
//m_historian.totalBrainWash();
}
@@ -1156,7 +1156,7 @@
if( theApp.multipleView) return; // do not bother with history in this scenario
if( !modid || modid.Length() == 0) return;
- CGMEEventLogger::LogGMEEvent("CGMEDoc::tellHistorian(str,asp)\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::tellHistorian(str,asp)\r\n"));
Historian::HistoryElem e( (LPCTSTR) PutInCString( modid), (LPCTSTR) asp);
m_historian.erasePrevOccurencesB( e);
@@ -1169,7 +1169,7 @@
if( theApp.multipleView) return; // do not bother with history in this scenario
if( !model) return;
- CGMEEventLogger::LogGMEEvent("CGMEDoc::tellHistorian(ptr,asp)\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEDoc::tellHistorian(ptr,asp)\r\n"));
try {
long status;
@@ -1375,7 +1375,7 @@
}
}
-void CGMEDoc::Historian::eraseOccurences( const std::string& p_id)
+void CGMEDoc::Historian::eraseOccurences( const std::wstring& p_id)
{
HISTLIST_ITER it;
Modified: trunk/GME/Gme/GMEDoc.h
==============================================================================
--- trunk/GME/Gme/GMEDoc.h Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEDoc.h Thu Mar 31 16:33:52 2011 (r1241)
@@ -64,8 +64,8 @@
{
}
- HistoryElem( const std::string& p_id
- , const std::string& p_aspect)
+ HistoryElem( const std::wstring& p_id
+ , const std::wstring& p_aspect)
: m_id( p_id)
, m_an( p_aspect)
{
@@ -87,8 +87,8 @@
return *this;
}
- const std::string& id() const { return m_id; }
- const std::string& aspect() const { return m_an; }
+ const std::wstring& id() const { return m_id; }
+ const std::wstring& aspect() const { return m_an; }
bool operator==( const HistoryElem& peer) const
{
@@ -101,8 +101,8 @@
}
private:
- std::string m_id;
- std::string m_an; // aspect name
+ std::wstring m_id;
+ std::wstring m_an; // aspect name
};
public:
@@ -121,7 +121,7 @@
void popF( HistoryElem& e);
void frontB( HistoryElem& e);
- void eraseOccurences( const std::string& p_id);
+ void eraseOccurences( const std::wstring& p_id);
void erasePrevOccurencesB( const HistoryElem& e);
private:
Modified: trunk/GME/Gme/GMEEventLogger.h
==============================================================================
--- trunk/GME/Gme/GMEEventLogger.h Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEEventLogger.h Thu Mar 31 16:33:52 2011 (r1241)
@@ -95,38 +95,38 @@
};
// %Z for first fco %z for second ONLY WORKS IN TRANSACTION - this function does not make it's own transaction
- static void GMEEventPrintf(const char *format, IMgaObject *objOne, IMgaObject *objTwo, ...) //Only works in Transaction!!!!!!!!!
+ static void GMEEventPrintf(const TCHAR *format, IMgaObject *objOne, IMgaObject *objTwo, ...) //Only works in Transaction!!!!!!!!!
{
if(comLogger != NULL)
{
CString output(format);
- if(output.Find("%Z")) {
+ if(output.Find(_T("%Z"))) {
if(objOne == NULL)
- output.Replace(CString("%Z"),CString(""));
+ output.Replace(CString(_T("%Z")),CString(_T("")));
else
{
CComBSTR ID;
CComPtr<IMgaObject> ONE = objOne;
COMTHROW(ONE->get_ID(&ID));
- output.Replace(CString("%Z"),CString(ID));
+ output.Replace(CString(_T("%Z")),CString(ID));
}
}
- if(output.Find("%z")) {
+ if(output.Find(_T("%z"))) {
if(objTwo == NULL)
- output.Replace(CString("%z"),CString(""));
+ output.Replace(CString(_T("%z")),CString(_T("")));
else
{
CComBSTR ID;
CComPtr<IMgaObject> TWO = objTwo;
COMTHROW(TWO->get_ID(&ID));
- output.Replace(CString("%z"),CString(ID));
+ output.Replace(CString(_T("%z")),CString(ID));
}
}
- char buffer[250];
+ TCHAR buffer[250];
va_list v1;
va_start(v1,objTwo);
- vsprintf(buffer,output,v1);
+ _vstprintf_s(buffer,output,v1);
va_end(v1);
CComBSTR b = buffer;
Modified: trunk/GME/Gme/GMEOLEError.h
==============================================================================
--- trunk/GME/Gme/GMEOLEError.h Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEOLEError.h Thu Mar 31 16:33:52 2011 (r1241)
@@ -64,7 +64,7 @@
#define SHOW_ERROR( z) \
{ \
AfxThrowOleDispatchException(ID_ERROR_NOT_FOUND, \
- _T(z)); \
+ (z)); \
}
#define THROW_IF_NULL( x, y) \
Modified: trunk/GME/Gme/GMEOLEIt.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEIt.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEOLEIt.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -19,7 +19,7 @@
#endif
#define CATCHALL_AND_CALL_END \
- catch( const char * p) \
+ catch( const wchar_t * p) \
{ \
end(); \
SHOW_ERROR( p ); \
@@ -27,7 +27,7 @@
catch(...) \
{ \
end(); \
- SHOW_ERROR( "Unhandled error occurred" ); \
+ SHOW_ERROR( L"Unhandled error occurred" ); \
} \
end();
@@ -271,9 +271,9 @@
CComBSTR to_connect_as_src = roleNameOf( p_srcRole1);
CComBSTR to_connect_as_dst = roleNameOf( p_dstRole1);
- to_connect_as_src.Append(" ");
+ to_connect_as_src.Append(_T(" "));
to_connect_as_src.AppendBSTR( roleNameOf( p_srcRole2)); // now we have a path like: "model port" composed of roles
- to_connect_as_dst.Append(" ");
+ to_connect_as_dst.Append(_T(" "));
to_connect_as_dst.AppendBSTR( roleNameOf( p_dstRole2));
return connMetaRolePtrInBetween( p_model, to_connect_as_src, to_connect_as_dst);
@@ -282,8 +282,8 @@
//static
CComPtr<IMgaMetaRole> CGMEOLEIt::connMetaRolePtrInBetween( CComPtr<IMgaModel> p_model, const CComBSTR& src_localpath, const CComBSTR& dst_localpath)
{
- CComBSTR src_nm( "src");
- CComBSTR dst_nm( "dst");
+ CComBSTR src_nm( L"src");
+ CComBSTR dst_nm( L"dst");
// check for connection allowed in p_model between p_src and p_dst
@@ -342,9 +342,9 @@
CComBSTR ds; // "role1 role2" or "role" most tipically (see local path defined in meta.idl)
COMTHROW( (*item_it)->get_Desc( &ds ));
- if( nm == "src" && ds == src_localpath)
+ if( nm == _T("src") && ds == src_localpath)
src_found = true;
- if( nm == "dst" && ds == dst_localpath)
+ if( nm == _T("dst") && ds == dst_localpath)
dst_found = true;
}
}
@@ -520,11 +520,11 @@
COMTHROW( p_parent->CreateChildObject( metarole, PutOut( newfco)));
THROW_IF_NULL( newfco, _T("Invalid new object pointer"));
- CComBSTR new_name("New"); new_name.Append( p_partToCreate);
+ CComBSTR new_name(L"New"); new_name.Append( p_partToCreate);
CComBSTR b_given_name( p_givenName);
if( newfco)
- COMTHROW( newfco->put_Name( b_given_name == ""? new_name : b_given_name ));
+ COMTHROW( newfco->put_Name( b_given_name == _T("")? new_name : b_given_name ));
ASSERT( p_pNewObj);
*p_pNewObj = newfco.Detach();
@@ -579,11 +579,11 @@
CComPtr<IMgaFCO> newfco;
COMTHROW( coll->get_Item( 1, &newfco));
- CComBSTR new_name("Cloned"); new_name.Append(p_existingFcoName);
+ CComBSTR new_name(L"Cloned"); new_name.Append(p_existingFcoName);
CComBSTR given_name( p_givenName);
if( newfco)
- COMTHROW( newfco->put_Name( given_name == "" ? new_name : given_name));
+ COMTHROW( newfco->put_Name( given_name == _T("") ? new_name : given_name));
ASSERT( p_pNewObj);
*p_pNewObj = newfco.Detach();
@@ -707,21 +707,21 @@
BOOL CGMEOLEIt::GetValid()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetValid()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetValid()\r\n"));
return AmIValid() ? TRUE : FALSE;
}
void CGMEOLEIt::SetValid(BOOL)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetValid()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetValid()\r\n"));
SetNotSupported();
}
LPDISPATCH CGMEOLEIt::GetMgaModel()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetMgaModel()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetMgaModel()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -751,14 +751,14 @@
void CGMEOLEIt::SetMgaModel(LPDISPATCH)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetMgaModel()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetMgaModel()\r\n"));
SetNotSupported();
}
void CGMEOLEIt::Print()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Print()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Print()\r\n"));
PRECONDITION_VALID_MODEL
@@ -767,7 +767,7 @@
void CGMEOLEIt::PrintDialog()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::PrintDialog()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::PrintDialog()\r\n"));
PRECONDITION_VALID_MODEL
@@ -777,14 +777,14 @@
void CGMEOLEIt::DumpWindowsMetaFile(LPCTSTR filePath)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::DumpWindowsMetaFile()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::DumpWindowsMetaFile()\r\n"));
PRECONDITION_VALID_MODEL
CMetaFileDC cDC;
BOOL ret = cDC.CreateEnhanced(m_theView->GetDC(),filePath,NULL,_T("GME Model"));
if (ret == FALSE) {
- AfxMessageBox("Unable to create metafile.", MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Unable to create metafile."), MB_OK | MB_ICONSTOP);
return;
}
@@ -799,7 +799,7 @@
void CGMEOLEIt::CheckConstraints()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::CheckConstraints()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::CheckConstraints()\r\n"));
PRECONDITION_VALID_MODEL
PRECONDITION_ACTIVE_CONSTMGR
@@ -809,7 +809,7 @@
void CGMEOLEIt::RunComponent(LPCTSTR appID)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::RunComponent()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::RunComponent()\r\n"));
PRECONDITION_VALID_MODEL
@@ -818,16 +818,16 @@
void CGMEOLEIt::RunComponentDialog()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::RunComponentDialog()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::RunComponentDialog()\r\n"));
PRECONDITION_VALID_MODEL
- m_theView->RunComponent("");
+ m_theView->RunComponent(_T(""));
}
LPDISPATCH CGMEOLEIt::GetAspects()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetAspects()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetAspects()\r\n"));
PRECONDITION_VALID_MODEL
@@ -848,14 +848,14 @@
void CGMEOLEIt::SetAspects(LPDISPATCH)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetAspects()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetAspects()\r\n"));
SetNotSupported();
}
void CGMEOLEIt::Close()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Close()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Close()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -864,7 +864,7 @@
void CGMEOLEIt::GrayOutFCO(BOOL bGray, BOOL bNeighbours, LPDISPATCH mgaFCOs)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GrayOutFCO()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GrayOutFCO()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -910,7 +910,7 @@
void CGMEOLEIt::GrayOutHide()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GrayOutHide()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GrayOutHide()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -924,7 +924,7 @@
void CGMEOLEIt::ShowSetMembers(LPDISPATCH mgaFCO)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ShowSetMembers()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ShowSetMembers()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -978,7 +978,7 @@
void CGMEOLEIt::HideSetMembers()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::HideSetMembers()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::HideSetMembers()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -991,7 +991,7 @@
void CGMEOLEIt::Zoom(long percent)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Zoom()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Zoom()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -1001,7 +1001,7 @@
void CGMEOLEIt::ZoomTo(LPDISPATCH mgaFCOs)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ZoomTo()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ZoomTo()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -1046,7 +1046,7 @@
void CGMEOLEIt::Scroll(long bar, long scroll)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Scroll()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Scroll()\r\n"));
PRECONDITION_VALID_MODEL;
@@ -1083,7 +1083,7 @@
HRESULT CGMEOLEIt::DumpModelGeometryXML(LPCTSTR filePath)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::DumpModelGeometryXML()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::DumpModelGeometryXML()\r\n"));
PRECONDITION_VALID_MODEL
@@ -1137,21 +1137,21 @@
}
- std::string path( path_ptr);
- if( path.compare( "./") == 0) return CComPtr<IMgaFCO>( mod);
+ std::wstring path( path_ptr);
+ if( path.compare( _T("./")) == 0) return CComPtr<IMgaFCO>( mod);
bool went_up = false;
bool null_ptr_found = newparent == 0;
while( !null_ptr_found && !path.empty() &&
- ( path.compare("..") == 0
- || path.substr(0, 3).compare( "../") == 0))
+ ( path.compare(_T("..")) == 0
+ || path.substr(0, 3).compare( _T("../")) == 0))
{
newparent = myParent( newparent);
null_ptr_found = newparent == 0;
went_up = true;
if( path.length() > 2) path = path.substr( 3); // passing one directory : '../'
- else path = "";
+ else path = _T("");
}
if( null_ptr_found) // rootfolder reached => invalid path
@@ -1169,7 +1169,7 @@
void CGMEOLEIt::ShowFCO( LPCTSTR p_objName, BOOL p_inParent)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ShowFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ShowFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1195,7 +1195,7 @@
void CGMEOLEIt::ShowFCOPtr( LPDISPATCH p_obj, BOOL p_inParent)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ShowFCOPtr\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ShowFCOPtr\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1212,7 +1212,7 @@
LPDISPATCH CGMEOLEIt::Child( LPCTSTR p_objName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Child\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Child\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1234,7 +1234,7 @@
LPDISPATCH CGMEOLEIt::Create( LPCTSTR p_partName, LPCTSTR p_objname)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Create\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Create\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1255,7 +1255,7 @@
LPDISPATCH CGMEOLEIt::CreateInChild( LPCTSTR p_childAsParent, LPCTSTR p_part, LPCTSTR p_objname)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::CreateInChild\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::CreateInChild\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1280,7 +1280,7 @@
LPDISPATCH CGMEOLEIt::CreateInChildFCO( LPDISPATCH p_childAsParent, LPCTSTR p_part, LPCTSTR p_objname)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Create\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Create\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1307,7 +1307,7 @@
LPDISPATCH CGMEOLEIt::Duplicate( LPCTSTR p_existingObjName, LPCTSTR p_objName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Duplicate\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Duplicate\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1322,7 +1322,7 @@
THROW_IF_NULL( model, _T("Invalid parent model"));
CComPtr<IMgaFCO> exist_obj( getChildInByName( model, p_existingObjName));
THROW_IF_NULL( exist_obj, _T("Duplicable object not found"));
- cloneObjs( model, exist_obj, "" , p_objName, &obj_ptr);
+ cloneObjs( model, exist_obj, _T("") , p_objName, &obj_ptr);
}
CATCHALL_AND_CALL_END;
return obj_ptr.Detach();
@@ -1330,7 +1330,7 @@
LPDISPATCH CGMEOLEIt::DuplicateFCO( LPDISPATCH p_existingFCO, LPCTSTR p_objName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::DuplicateFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::DuplicateFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1346,7 +1346,7 @@
CComQIPtr<IMgaFCO> exist_fco( putInTerr( p_existingFCO));
THROW_IF_NULL( exist_fco, _T("Invalid object pointer"));
- cloneObjs( model, exist_fco, "", p_objName, &obj_ptr);
+ cloneObjs( model, exist_fco, _T(""), p_objName, &obj_ptr);
}
CATCHALL_AND_CALL_END;
@@ -1355,7 +1355,7 @@
void CGMEOLEIt::Rename( LPCTSTR p_oldName, LPCTSTR p_newName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Rename\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Rename\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1377,7 +1377,7 @@
void CGMEOLEIt::SetName( LPDISPATCH p_lpDisp, LPCTSTR p_name)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetName\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetName\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1397,7 +1397,7 @@
void CGMEOLEIt::Include( LPCTSTR psetnm, LPCTSTR pfconm)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Include\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Include\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1421,7 +1421,7 @@
void CGMEOLEIt::IncludeFCO( LPDISPATCH pset, LPDISPATCH pfco)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::IncludeFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::IncludeFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1446,7 +1446,7 @@
}
void CGMEOLEIt::Exclude( LPCTSTR psetnm, LPCTSTR pfconm)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Exclude\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Exclude\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1470,7 +1470,7 @@
}
void CGMEOLEIt::ExcludeFCO( LPDISPATCH pset, LPDISPATCH pfco)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ExcludeFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ExcludeFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1497,7 +1497,7 @@
LPDISPATCH CGMEOLEIt::Connect( LPCTSTR p_srcName, LPCTSTR p_dstName, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Connect\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Connect\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1519,7 +1519,7 @@
CComBSTR conn_name( p_connName);
try
{
- if( conn_name != "")
+ if( conn_name != _T(""))
metarole = metaRolePtrInByName( model, conn_name);
}catch(...)
{
@@ -1539,7 +1539,7 @@
void CGMEOLEIt::Disconnect( LPCTSTR p_srcName, LPCTSTR p_dstName, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Disconnect\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Disconnect\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1550,8 +1550,8 @@
start();
try
{
- CComBSTR src_role( "src");
- CComBSTR dst_role( "dst");
+ CComBSTR src_role( L"src");
+ CComBSTR dst_role( L"dst");
CComQIPtr<IMgaModel> model( putInTerr( m_theMgaModel));
THROW_IF_NULL( model, _T("Invalid parent model"));
@@ -1599,7 +1599,7 @@
}
bool name_checked = true; // name or kind could be checked. The Disconnect uses: NAME
CComBSTR conn_name( p_connName);
- if( conn_name != "") // if name provided
+ if( conn_name != _T("")) // if name provided
{
name_checked = false;
@@ -1627,7 +1627,7 @@
LPDISPATCH CGMEOLEIt::ConnectThruPort( LPCTSTR p_srcRole1, LPCTSTR p_srcRole2, LPCTSTR p_dstRole1, LPCTSTR p_dstRole2, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ConnectThruPort\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ConnectThruPort\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1653,36 +1653,36 @@
objtype_enum type1_info = myTypeIs( src1);
objtype_enum type2_info = myTypeIs( dst1);
- if( type1_info == OBJTYPE_MODEL && CComBSTR( p_srcRole2) != "")
+ if( type1_info == OBJTYPE_MODEL && CComBSTR( p_srcRole2) != _T(""))
{
// for models only:
sport = getChildInByName( CComQIPtr<IMgaModel>(src1), p_srcRole2);
}
- else if( type1_info == OBJTYPE_REFERENCE && CComBSTR( p_srcRole2) != "")
+ else if( type1_info == OBJTYPE_REFERENCE && CComBSTR( p_srcRole2) != _T(""))
{
refPortFinderAndChainBuilder( p_srcRole2, src1, sport, srefs );
}
- if( type2_info == OBJTYPE_MODEL && CComBSTR( p_dstRole2) != "")
+ if( type2_info == OBJTYPE_MODEL && CComBSTR( p_dstRole2) != _T(""))
{
dport = getChildInByName( CComQIPtr<IMgaModel>(dst1), p_dstRole2);
}
- else if( type2_info == OBJTYPE_REFERENCE && CComBSTR( p_dstRole2) != "")
+ else if( type2_info == OBJTYPE_REFERENCE && CComBSTR( p_dstRole2) != _T(""))
{
refPortFinderAndChainBuilder( p_dstRole2, dst1, dport, drefs);
}
bool error;
- error = CComBSTR( p_srcRole2) != "" && !sport; // if sport == NULL and the p_srcRole2 != NULL then error state
+ error = CComBSTR( p_srcRole2) != _T("") && !sport; // if sport == NULL and the p_srcRole2 != NULL then error state
THROW_IF_BOOL( error, _T("SourceRole2 object not found"));
- error = CComBSTR( p_dstRole2) != "" && !dport; // if dport == NULL and the p_dstRole2 != NULL then error state
+ error = CComBSTR( p_dstRole2) != _T("") && !dport; // if dport == NULL and the p_dstRole2 != NULL then error state
THROW_IF_BOOL( error, _T("DestinationRole2 object not found"));
CComPtr<IMgaMetaRole> metarole;
CComBSTR conn_name( p_connName);
try
{
- if( conn_name != "")
+ if( conn_name != _T(""))
metarole = metaRolePtrInByName( model, conn_name);
}catch(...)
{
@@ -1720,7 +1720,7 @@
LPDISPATCH CGMEOLEIt::ConnectThruPortFCO( LPDISPATCH p_src1, LPDISPATCH p_src2Port, LPDISPATCH p_dst1, LPDISPATCH p_dst2Port, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ConnectThruPortFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ConnectThruPortFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1794,7 +1794,7 @@
CComBSTR conn_name( p_connName);
try
{
- if( conn_name != "")
+ if( conn_name != _T(""))
metarole = metaRolePtrInByName( model, conn_name);
}catch(...)
{
@@ -1843,8 +1843,8 @@
start();
try
{
- CComBSTR src_role( "src");
- CComBSTR dst_role( "dst");
+ CComBSTR src_role( L"src");
+ CComBSTR dst_role( L"dst");
CComQIPtr<IMgaModel> model( putInTerr( m_theMgaModel));
THROW_IF_NULL( model, _T("Invalid parent model"));
@@ -1881,9 +1881,9 @@
}
bool error;
- error = CComBSTR( p_srcRole2) != "" && !sport;
+ error = CComBSTR( p_srcRole2) != _T("") && !sport;
THROW_IF_BOOL( error, _T("SourceRole2 object not found"));
- error = CComBSTR( p_dstRole2) != "" && !dport;
+ error = CComBSTR( p_dstRole2) != _T("") && !dport;
THROW_IF_BOOL( error, _T("DestinationRole2 object not found"));
// will look for a connection inside model
// between
@@ -1939,7 +1939,7 @@
}
bool name_checked = true;
CComBSTR conn_name( p_connName);
- if( conn_name != "") // if name provided
+ if( conn_name != _T("")) // if name provided
{
name_checked = false;
@@ -1967,7 +1967,7 @@
LPDISPATCH CGMEOLEIt::ConnectFCOs( LPDISPATCH p_src, LPDISPATCH p_dst, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ConnectFCOs\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ConnectFCOs\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -1991,7 +1991,7 @@
try
{
- if( conn_name != "")
+ if( conn_name != _T(""))
metarole = metaRolePtrInByName( model, conn_name);
}catch(...)
{
@@ -2010,7 +2010,7 @@
void CGMEOLEIt::DisconnectFCOs( LPDISPATCH p_src, LPDISPATCH p_dst, LPCTSTR p_connName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::DisconnectFCOs\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::DisconnectFCOs\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2021,8 +2021,8 @@
start();
try
{
- CComBSTR src_role( "src");
- CComBSTR dst_role( "dst");
+ CComBSTR src_role( L"src");
+ CComBSTR dst_role( L"dst");
CComQIPtr<IMgaModel> model( putInTerr( m_theMgaModel));
THROW_IF_NULL( model, _T("Invalid parent model"));
@@ -2070,7 +2070,7 @@
}
bool name_checked = true; // name or kind could be checked. DisconnectFCO uses: NAME
CComBSTR conn_name( p_connName);
- if( conn_name != "") // if name provided
+ if( conn_name != _T("")) // if name provided
{
name_checked = false;
@@ -2098,7 +2098,7 @@
void CGMEOLEIt::Refer( LPCTSTR prefnm, LPCTSTR pfconm)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Refer\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Refer\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2123,7 +2123,7 @@
void CGMEOLEIt::ReferFCO( LPDISPATCH pref, LPDISPATCH pfco)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ReferFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ReferFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2150,7 +2150,7 @@
void CGMEOLEIt::ClearRef( LPCTSTR prefnm)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ClearRef\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ClearRef\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2173,7 +2173,7 @@
void CGMEOLEIt::ClearRefFCO( LPDISPATCH pref)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::ClearRefFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::ClearRefFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2199,7 +2199,7 @@
void CGMEOLEIt::FollowRef( LPCTSTR prefnm)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::FollowRef\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::FollowRef\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2226,7 +2226,7 @@
void CGMEOLEIt::FollowRefFCO( LPDISPATCH pref)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::FollowRefFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::FollowRefFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2252,14 +2252,14 @@
LPDISPATCH CGMEOLEIt::NullFCO()
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::NullFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::NullFCO\r\n"));
CComPtr<IMgaFCO> nullobj;
return nullobj.Detach();
}
void CGMEOLEIt::SetAttribute( LPCTSTR p_partName, LPCTSTR p_attrName, VARIANT& p_attrValue)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetAttribute\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetAttribute\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2286,7 +2286,7 @@
VARIANT CGMEOLEIt::GetAttribute( LPCTSTR p_partName, LPCTSTR p_attrName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetAttribute\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetAttribute\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2314,7 +2314,7 @@
void CGMEOLEIt::SetAttributeFCO( LPDISPATCH p_fco, LPCTSTR p_attrName, VARIANT& p_attrValue)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetAttributeFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetAttributeFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2343,7 +2343,7 @@
VARIANT CGMEOLEIt::GetAttributeFCO( LPDISPATCH p_fco, LPCTSTR p_attrName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetAttributeFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetAttributeFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2374,7 +2374,7 @@
LPDISPATCH CGMEOLEIt::SubType( LPCTSTR p_baseName, LPCTSTR p_subtypeName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Subtype\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Subtype\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2406,7 +2406,7 @@
LPDISPATCH CGMEOLEIt::Instantiate( LPCTSTR p_baseName, LPCTSTR p_instanceName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Instantiate\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Instantiate\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2438,7 +2438,7 @@
LPDISPATCH CGMEOLEIt::SubTypeFCO( LPDISPATCH p_base, LPCTSTR p_subtypeName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SubTypeFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SubTypeFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2472,7 +2472,7 @@
LPDISPATCH CGMEOLEIt::InstantiateFCO( LPDISPATCH p_base, LPCTSTR p_instanceName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::InstantiateFCO\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::InstantiateFCO\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2507,7 +2507,7 @@
void CGMEOLEIt::BeginTransaction( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::BeginTransaction\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::BeginTransaction\r\n"));
beginTrans();
m_isInUserInitiatedTransaction = true;
@@ -2516,7 +2516,7 @@
void CGMEOLEIt::CommitTransaction( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::CommitTransaction\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::CommitTransaction\r\n"));
commitTrans();
m_isInUserInitiatedTransaction = false;
@@ -2524,7 +2524,7 @@
void CGMEOLEIt::AbortTransaction( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::AbortTransaction\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::AbortTransaction\r\n"));
abortTrans();
m_isInUserInitiatedTransaction = false;
@@ -2532,7 +2532,7 @@
VARIANT_BOOL CGMEOLEIt::IsInTransaction( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::IsInTransaction\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::IsInTransaction\r\n"));
CComPtr<IMgaTerritory> act_terr;
COMTHROW( theApp.mgaProject->get_ActiveTerritory( &act_terr));
@@ -2542,7 +2542,7 @@
LPDISPATCH CGMEOLEIt::PutInTerritory( LPDISPATCH one_obj)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::PutInTerritory\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::PutInTerritory\r\n"));
return putInTerr( one_obj);
}
@@ -2550,7 +2550,7 @@
void CGMEOLEIt::Help( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Help\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Help\r\n"));
static const char * htmlhelp =
"Scripting HELP<br>\
@@ -2570,7 +2570,7 @@
void CGMEOLEIt::SetSelected( LPCTSTR list)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetSelected()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetSelected()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2588,8 +2588,8 @@
CString tok,m = list;
int i = 0;
- tok = m.Tokenize( " ", i);
- while( tok != "")
+ tok = m.Tokenize( _T(" "), i);
+ while( tok != _T(""))
{
CComPtr<IMgaFCO> ch;
CComBSTR nm( (LPCTSTR) tok);
@@ -2598,7 +2598,7 @@
{
COMTHROW( coll->Append( ch ));
}
- tok = m.Tokenize( " ", i);
+ tok = m.Tokenize( _T(" "), i);
}
long l = 0;
@@ -2643,7 +2643,7 @@
BSTR CGMEOLEIt::GetSelected( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetSelected()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetSelected()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2677,8 +2677,8 @@
CComQIPtr<IMgaFCO> tfco( putInTerr( fco));
CComBSTR nm;
COMTHROW( tfco->get_Name( &nm));
- TRACE( "setselectedFCO input collection: %s", nm);
- if( !string_res.Length() == 0) string_res.Append(" ");
+ TRACE( _T("setselectedFCO input collection: %s"), nm);
+ if( !string_res.Length() == 0) string_res.Append(_T(" "));
string_res.AppendBSTR( nm);
}
}
@@ -2690,7 +2690,7 @@
void CGMEOLEIt::SetSelectedFCOs( LPDISPATCH p_dispColl)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetSelectedFCOs()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetSelectedFCOs()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2748,7 +2748,7 @@
LPDISPATCH CGMEOLEIt::GetSelectedFCOs( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetSelectedFCOs()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetSelectedFCOs()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2793,7 +2793,7 @@
CString CGMEOLEIt::GetCurrentAspect(void)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::GetCurrentAspect()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::GetCurrentAspect()\r\n"));
PRECONDITION_VALID_MODEL
@@ -2802,7 +2802,7 @@
void CGMEOLEIt::SetCurrentAspect(const CString& aspectName)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::SetCurrentAspect()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::SetCurrentAspect()\r\n"));
PRECONDITION_VALID_MODEL
@@ -2811,7 +2811,7 @@
void CGMEOLEIt::NextAspect( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::NextAspect()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::NextAspect()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2823,7 +2823,7 @@
void CGMEOLEIt::PrevAspect( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::PrevAspect()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::PrevAspect()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2885,7 +2885,7 @@
}
void CGMEOLEIt::Next( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Next()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Next()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2897,7 +2897,7 @@
void CGMEOLEIt::Prev( )
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Prev()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Prev()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2913,15 +2913,15 @@
if( !pChild) return;
CString path;
- path.Format( "PartRegs/%s/Position", pAspectName);
+ path.Format( _T("PartRegs/%s/Position"), pAspectName);
CString valu;
- valu.Format( "%u,%u", parX, parY);
+ valu.Format( _T("%u,%u"), parX, parY);
COMTHROW( pChild->put_RegistryValue( PutInBstr(path), PutInBstr(valu)));
}
void CGMEOLEIt::Position( LPCTSTR pObjName, LPCTSTR pAspectName, long parX, long parY)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::Position()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::Position()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -2944,7 +2944,7 @@
void CGMEOLEIt::PositionFCO( LPDISPATCH pObjPtr, LPCTSTR pAspectName, long parX, long parY)
{
- CGMEEventLogger::LogGMEEvent("CGMEOLEIt::PositionFCO()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::PositionFCO()\r\n"));
PRECONDITION_VALID_MODEL // calls AmIValid
@@ -3724,7 +3724,7 @@
TRY_DUAL(IID_IGMEOLEIt)
{
- TRACE( "XDual::SetSelectedFCOs");
+ TRACE( _T("XDual::SetSelectedFCOs"));
pThis->SetSelectedFCOs( fcos_to_select);
return NOERROR;
}
@@ -3737,7 +3737,7 @@
TRY_DUAL(IID_IGMEOLEIt)
{
- TRACE( "XDual::GetSelectedFCOs");
+ TRACE( _T("XDual::GetSelectedFCOs"));
LPDISPATCH lpDisp = pThis->GetSelectedFCOs();
lpDisp->QueryInterface(IID_IMgaFCOs, (LPVOID*)selected_fcos);
Modified: trunk/GME/Gme/GMEOLEModel.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEModel.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEOLEModel.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -137,7 +137,7 @@
CMetaFileDC cDC;
BOOL ret = cDC.CreateEnhanced(m_view->GetDC(),filePath,NULL,_T("GME Model"));
if (ret == FALSE) {
- AfxMessageBox("Unable to create metafile.", MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Unable to create metafile."), MB_OK | MB_ICONSTOP);
return;
}
Modified: trunk/GME/Gme/GMEObjectInspector.cpp
==============================================================================
--- trunk/GME/Gme/GMEObjectInspector.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEObjectInspector.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -54,7 +54,7 @@
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
- if(!m_ObjectInspector.Create("ObjectInspector",WS_CHILD | WS_VISIBLE,CRect(0,0,230,300),this,IDC_OBJECT_INSPECTOR_CTRL))
+ if(!m_ObjectInspector.Create(_T("ObjectInspector"),WS_CHILD | WS_VISIBLE,CRect(0,0,230,300),this,IDC_OBJECT_INSPECTOR_CTRL))
return -1;
return 0;
Modified: trunk/GME/Gme/GMEPanningWindow.cpp
==============================================================================
--- trunk/GME/Gme/GMEPanningWindow.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEPanningWindow.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -49,7 +49,7 @@
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
- if (!m_PanningWindowWrapper.Create("PanningWindow", WS_CHILD | WS_VISIBLE, CRect(0, 0, 150, 150), this, IDC_PANNINGWINDOWCTRL1))
+ if (!m_PanningWindowWrapper.Create(_T("PanningWindow"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 150, 150), this, IDC_PANNINGWINDOWCTRL1))
return -1;
return 0;
Modified: trunk/GME/Gme/GMEPartBrowser.cpp
==============================================================================
--- trunk/GME/Gme/GMEPartBrowser.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEPartBrowser.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -54,12 +54,12 @@
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
- if (!m_PartBrowserWrapper.Create("PartBrowser", WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_PARTBROWSERCTRL1))
+ if (!m_PartBrowserWrapper.Create(_T("PartBrowser"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 300, 150), this, IDC_PARTBROWSERCTRL1))
return -1;
// older versions of Windows* (NT 3.51 for instance) fail with DEFAULT_GUI_FONT
if (!m_font.CreateStockObject(DEFAULT_GUI_FONT))
- if (!m_font.CreatePointFont(80, "MS Sans Serif"))
+ if (!m_font.CreatePointFont(80, _T("MS Sans Serif")))
return -1;
m_PartBrowserWrapper.SetFont(&m_font);
Modified: trunk/GME/Gme/GMESearch.cpp
==============================================================================
--- trunk/GME/Gme/GMESearch.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMESearch.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -117,7 +117,7 @@
if(m_search.GetMgaProject()==NULL)
return 0;*/
- if(!m_search.Create("Search",WS_CHILD | WS_VISIBLE,CRect(0,0,230,300),this,IDC_SEARCHCTRL))
+ if(!m_search.Create(_T("Search"),WS_CHILD | WS_VISIBLE,CRect(0,0,230,300),this,IDC_SEARCHCTRL))
return -1;
// if(!m_search.Create("Search",WS_CHILD | WS_VISIBLE,CRect(0,0,230,300),this,IDC_SEARCHCTRL))
Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GMEView.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -158,30 +158,30 @@
COMTHROW( obj->get_ID( &id)); // get the id of the deleted object
view->GetDocument()->eraseFromHistory( PutInCString( id)); // clear from history
}
- TRACE(" OBJEVENT_DESTROYED\n");
+ TRACE(_T(" OBJEVENT_DESTROYED\n"));
viewsToKill.AddTail(view);
attrNeedsRefresh = true;
}
if(eventmask & OBJEVENT_NEWCHILD) {
- TRACE(" OBJEVENT_NEWCHILD\n");
+ TRACE(_T(" OBJEVENT_NEWCHILD\n"));
view->needsReset = true;
}
if(eventmask & OBJEVENT_LOSTCHILD) {
- TRACE(" OBJEVENT_LOSTCHILD\n");
+ TRACE(_T(" OBJEVENT_LOSTCHILD\n"));
view->needsReset = true;
}
if(eventmask & OBJEVENT_REGISTRY) {
view->needsReset = true;
}
if(eventmask & OBJEVENT_PROPERTIES) {
- TRACE(" OBJEVENT_PROPERTIES\n");
+ TRACE(_T(" OBJEVENT_PROPERTIES\n"));
view->SetName();
attrNeedsRefresh = true;
}
}
else if(IsEqualObject(obj,view->baseType)) {
if(eventmask & OBJEVENT_PROPERTIES) {
- TRACE(" OBJEVENT_PROPERTIES\n");
+ TRACE(_T(" OBJEVENT_PROPERTIES\n"));
view->SetTypeNameProperty();
}
}
@@ -189,12 +189,12 @@
// CHILD EVENT!!!
if(eventmask & OBJEVENT_CREATED) {
view->needsReset = true;
- TRACE(" OBJEVENT_CREATED\n");
+ TRACE(_T(" OBJEVENT_CREATED\n"));
}
else if(eventmask & OBJEVENT_DESTROYED) {
view->needsReset = true;
attrNeedsRefresh = true;
- TRACE(" OBJEVENT_DESTROYED\n");
+ TRACE(_T(" OBJEVENT_DESTROYED\n"));
}
else if(eventmask & OBJEVENT_SETINCLUDED || eventmask & OBJEVENT_SETEXCLUDED) {
view->needsReset = true;
@@ -1057,17 +1057,17 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to open model",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent("CGMEView::OnInitialUpdate - Unable to open model.\r\n");
+ AfxMessageBox(_T("Unable to open model"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnInitialUpdate - Unable to open model.\r\n"));
frame->PostMessage(WM_CLOSE);
EndWaitCursor();
return;
}
- CGMEEventLogger::LogGMEEvent("CGMEView::OnInitialUpdate() - opened model: "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnInitialUpdate() - opened model: ")+path+name+_T("\r\n"));
// AutoRoute();
- TRACE("CGMEView::OnInitialUpdate DoPannWinRefresh\n");
+ TRACE(_T("CGMEView::OnInitialUpdate DoPannWinRefresh\n"));
DoPannWinRefresh(); // terge - new window opened
SetScroll();
SetCenterObject(centerObj);
@@ -1134,26 +1134,26 @@
CString line1;
CString line2;
line1 = name;
- line2 = "Paradigm: " + theApp.guiMetaProject->displayedName;
- line2 += " Project: " + theApp.projectName;
- line2 += " Model: " + kindDisplayedName;
- line2 += " Aspect: " + currentAspect->displayedName;
+ line2 = _T("Paradigm: ") + theApp.guiMetaProject->displayedName;
+ line2 += _T(" Project: ") + theApp.projectName;
+ line2 += _T(" Model: ") + kindDisplayedName;
+ line2 += _T(" Aspect: ") + currentAspect->displayedName;
CString tim;
{
struct tm *newtime;
- char am_pm[] = "AM";
+ TCHAR am_pm[] = _T("AM");
time_t long_time;
time( &long_time ); /* Get time as long integer. */
newtime = localtime( &long_time ); /* Convert to local time. */
if( newtime->tm_hour > 12 ) /* Set up extension. */
- strcpy( am_pm, "PM" );
+ _tcscpy( am_pm, _T("PM") );
if( newtime->tm_hour > 12 ) /* Convert from 24-hour */
newtime->tm_hour -= 12; /* to 12-hour clock. */
if( newtime->tm_hour == 0 ) /* Set hour to 12 if midnight. */
newtime->tm_hour = 12;
- tim.Format("%.19s %s", asctime( newtime ), am_pm );
+ tim.Format(_T("%.19s %s"), asctime( newtime ), am_pm );
}
- line2 += " Time: " + tim;
+ line2 += _T(" Time: ") + tim;
// Setup mapping mode to have 50 pixel in 1 inch
pDC->SetMapMode(MM_ISOTROPIC);
@@ -1330,7 +1330,7 @@
void CGMEView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnPrint\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnPrint\r\n"));
CGmePrintDialog* pdlg = (CGmePrintDialog*)(pInfo->m_pPD);
int headerY = 0;
@@ -1856,7 +1856,7 @@
CString val;
COMTHROW(currentModel->get_RegistryValue(pathBstr, PutOut(val)));
if (!val.IsEmpty()) {
- if (val == "false")
+ if (val == _T("false"))
isModelAutoRouted = false;
else
isModelAutoRouted = true;
@@ -1937,7 +1937,7 @@
// if (gmeviewA)
if (m_isActive)
{
- TRACE("CGMEView::Reset GetActiveView\n");
+ TRACE(_T("CGMEView::Reset GetActiveView\n"));
/*gmeviewA->*/m_refreshpannwin = true;
}
CComPtr<IMgaFCO> selConn;
@@ -2151,8 +2151,8 @@
}
catch (hresult_exception& e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to refresh model");
- CGMEEventLogger::LogGMEEvent("CGMEView::Reset - Unable to refresh model.\r\n");
+ AfxMessageBox(_T("Unable to refresh model"));
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::Reset - Unable to refresh model.\r\n"));
frame->PostMessage(WM_CLOSE);
EndWaitCursor();
return;
@@ -2182,8 +2182,8 @@
}
}
catch (hresult_exception&) {
- AfxMessageBox("Unable to refresh selected status to decorators");
- CGMEEventLogger::LogGMEEvent("CGMEView::Reset - Unable to refresh selected status to decorators.\r\n");
+ AfxMessageBox(_T("Unable to refresh selected status to decorators"));
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::Reset - Unable to refresh selected status to decorators.\r\n"));
}
if (selConn != NULL) {
@@ -2271,7 +2271,7 @@
void CGMEView::ShowProperties(CGuiFco* guiFco)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowProperties("+guiFco->GetName()+" "+guiFco->GetID()+")\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowProperties(")+guiFco->GetName()+_T(" ")+guiFco->GetID()+_T(")\r\n"));
ChangeAttrPrefFco(guiFco);
CGMEObjectInspector::theInstance->ShowPanel(2);
@@ -2279,7 +2279,7 @@
void CGMEView::ShowProperties()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowProperties()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowProperties()\r\n"));
ChangeAttrPrefFco();
CGMEObjectInspector::theInstance->ShowPanel(2);
@@ -2287,7 +2287,7 @@
void CGMEView::ShowAttributes(CGuiFco* guiFco)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowAttributes("+guiFco->GetName()+" "+guiFco->GetID()+")\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowAttributes(")+guiFco->GetName()+_T(" ")+guiFco->GetID()+_T(")\r\n"));
ChangeAttrPrefFco(guiFco);
CGMEObjectInspector::theInstance->ShowPanel(0);
@@ -2296,7 +2296,7 @@
// TODO
void CGMEView::ShowAttributes() // currentModel
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowAttributes() on "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowAttributes() on ")+path+name+_T("\r\n"));
ChangeAttrPrefFco();
CGMEObjectInspector::theInstance->ShowPanel(0);
@@ -2304,7 +2304,7 @@
void CGMEView::ShowPreferences(CGuiFco *guiFco)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowPreferences("+guiFco->GetName()+" "+guiFco->GetID()+")\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowPreferences(")+guiFco->GetName()+_T(" ")+guiFco->GetID()+_T(")\r\n"));
ChangeAttrPrefFco(guiFco);
CGMEObjectInspector::theInstance->ShowPanel(1);
@@ -2314,7 +2314,7 @@
// TODO
void CGMEView::ShowPreferences() // currentModel
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowPreferences()\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowPreferences()\r\n"));
ChangeAttrPrefFco();
CGMEObjectInspector::theInstance->ShowPanel(1);
@@ -2324,20 +2324,20 @@
{
if ( currentModel ) {
BeginTransaction(TRANSACTION_READ_ONLY);
- path = "";
+ path = _T("");
CComPtr<IMgaObject> spObject = currentModel.p;
while ( true ) {
CComPtr<IMgaObject> spParent;
if ( SUCCEEDED( spObject->GetParent( &spParent ) ) && spParent ) {;
CComBSTR bstrName;
COMTHROW( spParent->get_Name( &bstrName ) );
- path = CString( bstrName ) + "/" + path;
+ path = CString( bstrName ) + _T("/") + path;
spObject = spParent;
}
else
break;
}
- path = "/" + path;
+ path = _T("/") + path;
CommitTransaction();
}
}
@@ -2426,7 +2426,7 @@
void CGMEView::ZoomIn(CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ZoomIn() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ZoomIn() in ")+path+name+_T("\r\n"));
// zoomIdx = min(GME_ZOOM_LEVEL_NUM-1, zoomIdx+1);
int curzoom = m_zoomVal;
frame->propBar.NextZoomVal(m_zoomVal);
@@ -2441,7 +2441,7 @@
void CGMEView::ZoomOut(CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ZoomOut() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ZoomOut() in ")+path+name+_T("\r\n"));
// zoomIdx = max(0, zoomIdx-1);
int curzoom = m_zoomVal;
frame->propBar.PrevZoomVal(m_zoomVal);
@@ -2459,7 +2459,7 @@
try {
BeginTransaction(TRANSACTION_READ_ONLY);
- CGMEEventLogger::GMEEventPrintf("CGMEView::ShowHelp(%Z) in "+path+name+"\r\n",fco,NULL);
+ CGMEEventLogger::GMEEventPrintf(_T("CGMEView::ShowHelp(%Z) in ")+path+name+_T("\r\n"),fco,NULL);
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
COMTHROW( launcher->ShowHelp(fco) );
@@ -2467,8 +2467,8 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to access context-specific help information!",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowHelp - Unable to access context-specific help information.\r\n");
+ AfxMessageBox(_T("Unable to access context-specific help information!"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowHelp - Unable to access context-specific help information.\r\n"));
}
}
@@ -2479,7 +2479,7 @@
if (!model) return;
#if !defined (ACTIVEXGMEVIEW)
// endFIX
- CString newAspect = aspect != "" ? aspect : currentAspect->name;
+ CString newAspect = aspect != _T("") ? aspect : currentAspect->name;
CGMEDoc *doc = GetDocument();
CGMEView *view = doc->FindView(model);
CComPtr<IMgaFCO> fakeObj;
@@ -2510,7 +2510,7 @@
CComPtr<IMgaFCO> der;
try {
BeginTransaction(TRANSACTION_READ_ONLY);
- CGMEEventLogger::GMEEventPrintf("CGMEView::FindDerivedFrom(model=%Z,type=%z)\r\n",model,type);
+ CGMEEventLogger::GMEEventPrintf(_T("CGMEView::FindDerivedFrom(model=%Z,type=%z)\r\n"),model,type);
COMTHROW(model->get_DerivedFrom(&der));
if(der != 0)
COMTHROW(der.QueryInterface(&type));
@@ -2518,8 +2518,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to find type model",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to find type model\r\n");
+ AfxMessageBox(_T("Unable to find type model"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to find type model\r\n"));
}
}
@@ -2669,7 +2669,7 @@
void CGMEView::ModeChange()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ModeChange in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ModeChange in ")+path+name+_T("\r\n"));
this->SendUnselEvent4List( &selected);
selected.RemoveAll();
RemoveAllAnnotationFromSelection();
@@ -2699,7 +2699,7 @@
pTI->rect = CRect(point.x - 3, point.y - 3, point.x + 3, point.y + 3);
pTI->uId = 1;
CString str;
- str.Format("%p y=%f (%d,%d,%d,%d) prev=%p next=%p",
+ str.Format(_T("%p y=%f (%d,%d,%d,%d) prev=%p next=%p"),
edge, edge->position_y,
edge->startpoint->x, edge->startpoint->y,
edge->endpoint->x, edge->endpoint->y,
@@ -2716,7 +2716,8 @@
pTI->rect = CRect(point.x - 8, point.y - 8, point.x + 8, point.y + 8);
pTI->uId = 1;
CString str = conn->GetInfoText();
- pTI->lpszText = _strdup(str);
+ // FIXME: does this leak?
+ pTI->lpszText = _tcsdup(str);
return 1;
}
@@ -2726,7 +2727,7 @@
CRect rect = object->GetLocation();
CGuiPort *port = object->FindPort(point);
if(port && port->IsRealPort()) {
- portinfo = " : " + port->GetInfoText();
+ portinfo = _T(" : ") + port->GetInfoText();
rect = port->GetLocation() + rect.TopLeft();
}
if(object != oldObject || port != oldPort) {
@@ -2741,7 +2742,7 @@
pTI->hwnd = m_hWnd;
pTI->rect = rect;
pTI->uId = 1;
- pTI->lpszText = _strdup(object->GetInfoText() + portinfo);
+ pTI->lpszText = _tcsdup(object->GetInfoText() + portinfo);
return 1;
}
oldObject = 0;
@@ -2821,9 +2822,9 @@
if (guiObj || connection) {
if (guiObj)
- CGMEEventLogger::LogGMEEvent("CGMEView::SetCenterFCO("+guiObj->GetName()+" "+guiObj->GetID()+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SetCenterFCO(")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T(") in ")+path+name+_T("\r\n"));
else
- CGMEEventLogger::LogGMEEvent("CGMEView::SetCenterFCO("+connection->GetName()+" "+connection->GetID()+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SetCenterFCO(")+connection->GetName()+_T(" ")+connection->GetID()+_T(") in ")+path+name+_T("\r\n"));
if (guiObj && !guiObj->IsVisible() ||
connection && !connection->IsVisible())
{
@@ -2954,7 +2955,7 @@
ctrl = frame->propBar.GetDlgItem(IDC_TYPENAME);
ASSERT(ctrl);
CComPtr<IMgaFCO> fco;
- CString txt = "N/A";
+ CString txt = _T("N/A");
if(baseType != 0) {
COMTHROW(baseType->get_Name(PutOut(txt)));
}
@@ -3118,9 +3119,9 @@
void CGMEView::DisconnectAll(CGuiObject *end,CGuiPort *endPort,bool onlyVisible)
{
if(endPort)
- CGMEEventLogger::LogGMEEvent("CGMEView::DisconnectAll(end="+end->GetName()+" "+end->GetID()+" endPort="+endPort->GetName()+" "+endPort->GetID()+")\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DisconnectAll(end=")+end->GetName()+_T(" ")+end->GetID()+_T(" endPort=")+endPort->GetName()+_T(" ")+endPort->GetID()+_T(")\r\n"));
else
- CGMEEventLogger::LogGMEEvent("CGMEView::DisconnectAll(end="+end->GetName()+" "+end->GetID()+")\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DisconnectAll(end=")+end->GetName()+_T(" ")+end->GetID()+_T(")\r\n"));
CGuiConnectionList conns;
FindConnections(end,endPort,conns);
POSITION pos = conns.GetHeadPosition();
@@ -3137,8 +3138,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to delete connection",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to delete connection.\r\n");
+ AfxMessageBox(_T("Unable to delete connection"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to delete connection.\r\n"));
}
}
}
@@ -3172,7 +3173,7 @@
bool CGMEView::DeleteConnection(CGuiConnection *guiConn,bool checkAspect)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::DeleteConnection("+guiConn->GetName()+" "+guiConn->GetID()+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DeleteConnection(")+guiConn->GetName()+_T(" ")+guiConn->GetID()+_T(") in ")+path+name+_T("\r\n"));
bool ok = false;
BeginWaitCursor();
try {
@@ -3185,8 +3186,8 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to delete connection",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to delete connection.\r\n");
+ AfxMessageBox(_T("Unable to delete connection"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to delete connection.\r\n"));
}
this->SetFocus();
return ok;
@@ -3202,7 +3203,7 @@
CGuiObject *guiObj = objectList.GetNext(pos);
if(!guiObj->IsPrimary(guiMeta,currentAspect)) {
ok = false;
- txt += "\n " + guiObj->name;
+ txt += _T("\n ") + guiObj->name;
}
}
CommitTransaction();
@@ -3217,11 +3218,11 @@
{
bool brw_refresh_needed = false;
try {
- CGMEEventLogger::LogGMEEvent("CGMEView::DeleteObjects in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DeleteObjects in ")+path+name+_T("\r\n"));
CString msg;
if(!CheckBeforeDeleteObjects(objectList,msg)) {
- AfxMessageBox("The following object(s) cannot be deleted: " + msg);
- CGMEEventLogger::LogGMEEvent(" The following object(s) cannot be deleted: "+msg+"\r\n");
+ AfxMessageBox(_T("The following object(s) cannot be deleted: ") + msg);
+ CGMEEventLogger::LogGMEEvent(_T(" The following object(s) cannot be deleted: ")+msg+_T("\r\n"));
return true;
}
BeginWaitCursor();
@@ -3268,11 +3269,11 @@
catch(hresult_exception &e) {
AbortTransaction(e.hr);
if( e.hr == E_MGA_MUST_ABORT)
- CGMEEventLogger::LogGMEEvent(" Archetype delete cancelled by user.\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" Archetype delete cancelled by user.\r\n"));
else
{
- AfxMessageBox("Unable to delete models",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to delete models.\r\n");
+ AfxMessageBox(_T("Unable to delete models"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to delete models.\r\n"));
}
EndWaitCursor();
return false;
@@ -3287,7 +3288,7 @@
void CGMEView::DeleteAnnotations(CGuiAnnotatorList &annotatorList)
{
try {
- CGMEEventLogger::LogGMEEvent("CGMEView::DeleteAnnotations() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DeleteAnnotations() in ")+path+name+_T("\r\n"));
GMEEVENTLOG_GUIANNOTATORS(annotatorList);
BeginWaitCursor();
BeginTransaction();
@@ -3303,8 +3304,8 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to delete annotations",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to delete annotations.\r\n");
+ AfxMessageBox(_T("Unable to delete annotations"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to delete annotations.\r\n"));
EndWaitCursor();
return;
}
@@ -3315,22 +3316,22 @@
bool CGMEView::DoPasteItem(COleDataObject* pDataObject,bool drag,bool move,bool reference,bool derive,bool instance,bool closure,bool merge, CGuiObject *ref,CPoint pt)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::DoPasteItem");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DoPasteItem"));
if(drag)
- CGMEEventLogger::LogGMEEvent(" DRAG");
+ CGMEEventLogger::LogGMEEvent(_T(" DRAG"));
if(move)
- CGMEEventLogger::LogGMEEvent(" MOVE");
+ CGMEEventLogger::LogGMEEvent(_T(" MOVE"));
if(reference)
- CGMEEventLogger::LogGMEEvent(" REFERENCE");
+ CGMEEventLogger::LogGMEEvent(_T(" REFERENCE"));
if(derive)
- CGMEEventLogger::LogGMEEvent(" DERIVE");
+ CGMEEventLogger::LogGMEEvent(_T(" DERIVE"));
if(instance)
- CGMEEventLogger::LogGMEEvent(" INSTANCE");
+ CGMEEventLogger::LogGMEEvent(_T(" INSTANCE"));
if(closure)
- CGMEEventLogger::LogGMEEvent(" CLOSURE");
+ CGMEEventLogger::LogGMEEvent(_T(" CLOSURE"));
if(merge)
- CGMEEventLogger::LogGMEEvent(" SMART");
- CGMEEventLogger::LogGMEEvent(" in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" SMART"));
+ CGMEEventLogger::LogGMEEvent(_T(" in ")+path+name+_T("\r\n"));
if(ref)
VERIFY(reference);
ASSERT(pDataObject != NULL);
@@ -3357,7 +3358,7 @@
catch(hresult_exception &)
{
// general cleanup
- TRACE0("failed to embed/link an OLE object\n");
+ TRACE(_T("failed to embed/link an OLE object\n"));
return false;
}
this->SetFocus();
@@ -3369,8 +3370,8 @@
// this method prevents cloned objects having the same guid
// as their original ones
CComBSTR bstr;
- COMTHROW( fco->get_RegistryValue( CComBSTR( "guid"), &bstr));
- if( bstr == 0 || bstr == "") return; // no guid present, no need to replace it
+ COMTHROW( fco->get_RegistryValue( CComBSTR( L"guid"), &bstr));
+ if( bstr == 0 || bstr == L"") return; // no guid present, no need to replace it
GUID t_guid = GUID_NULL;
::CoCreateGuid(&t_guid);
@@ -3378,33 +3379,33 @@
if (t_guid != GUID_NULL)
{
CString str_guid;
- str_guid.Format("{%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ str_guid.Format(_T("{%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}"),
t_guid.Data1, t_guid.Data2, t_guid.Data3,
t_guid.Data4[0], t_guid.Data4[1], t_guid.Data4[2], t_guid.Data4[3],
t_guid.Data4[4], t_guid.Data4[5], t_guid.Data4[6], t_guid.Data4[7]);
// thus replace the old guid with a new one
- COMTHROW( fco->put_RegistryValue( CComBSTR( "guid"), CComBSTR(str_guid)));
+ COMTHROW( fco->put_RegistryValue( CComBSTR( L"guid"), CComBSTR(str_guid)));
}
// store the previous guid in prev subnode
- COMTHROW( fco->put_RegistryValue( CComBSTR( "guid/prev"), bstr));
+ COMTHROW( fco->put_RegistryValue( CComBSTR( L"guid/prev"), bstr));
}
bool CGMEView::DoPasteNative(COleDataObject *pDataObject,bool drag,bool move,bool reference,bool derive,bool instance,CGuiObject *ref,CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::DoPasteNative");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::DoPasteNative"));
if(drag)
- CGMEEventLogger::LogGMEEvent(" DRAG");
+ CGMEEventLogger::LogGMEEvent(_T(" DRAG"));
if(move)
- CGMEEventLogger::LogGMEEvent(" MOVE");
+ CGMEEventLogger::LogGMEEvent(_T(" MOVE"));
if(reference)
- CGMEEventLogger::LogGMEEvent(" REFERENCE");
+ CGMEEventLogger::LogGMEEvent(_T(" REFERENCE"));
if(derive)
- CGMEEventLogger::LogGMEEvent(" DERIVE");
+ CGMEEventLogger::LogGMEEvent(_T(" DERIVE"));
if(instance)
- CGMEEventLogger::LogGMEEvent(" INSTANCE");
- CGMEEventLogger::LogGMEEvent(" in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" INSTANCE"));
+ CGMEEventLogger::LogGMEEvent(_T(" in ")+path+name+_T("\r\n"));
CComPtr<IDataObject> p = pDataObject->GetIDataObject(FALSE);
CComPtr<IMgaDataSource> pt;
COMTHROW(p.QueryInterface(&pt));
@@ -3530,8 +3531,8 @@
COMTHROW(doc->resolver->get_RoleByMeta(currentModel,kind,OBJTYPE_NULL,role,aspect,&newRole));
if(newRole == 0)
{
- AfxMessageBox("Cannot insert object derived from " + fcoName);
- CGMEEventLogger::LogGMEEvent(" Cannot insert object derived from "+fcoName+"\r\n");
+ AfxMessageBox(_T("Cannot insert object derived from ") + fcoName);
+ CGMEEventLogger::LogGMEEvent(_T(" Cannot insert object derived from ")+fcoName+_T("\r\n"));
}
else {
CComPtr<IMgaFCO> obj;
@@ -3539,15 +3540,15 @@
VARIANT_BOOL inst = instance ? VARIANT_TRUE : VARIANT_FALSE;
#pragma warning(default: 4310) // cast truncates constant value
if((hr = currentModel->DeriveChildObject(fco,newRole,inst,&obj)) != S_OK) {
- CString msg( (LPCTSTR) fcoName); msg += " cannot be derived! Some of its ancestors or descendants may be already derived!";
+ CString msg( (LPCTSTR) fcoName); msg += _T(" cannot be derived! Some of its ancestors or descendants may be already derived!");
if( hr == E_MGA_NOT_DERIVABLE)
{
- if( !CGMEConsole::theInstance) AfxMessageBox( msg + " [Error code E_MGA_NOT_DERIVABLE]");
- else CGMEConsole::theInstance->Message( msg + " [Error code E_MGA_NOT_DERIVABLE]", MSG_ERROR);
+ if( !CGMEConsole::theInstance) AfxMessageBox( msg + _T(" [Error code E_MGA_NOT_DERIVABLE]"));
+ else CGMEConsole::theInstance->Message( msg + _T(" [Error code E_MGA_NOT_DERIVABLE]"), MSG_ERROR);
}
else
AfxMessageBox( msg);
- CGMEEventLogger::LogGMEEvent(" " + msg + " \r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ") + msg + _T(" \r\n"));
normalExit = false;
break;
}
@@ -3568,18 +3569,18 @@
}
else if(reference) {
if(ref) {
- CGMEEventLogger::LogGMEEvent(" ref="+ref->GetName()+" "+ref->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ref=")+ref->GetName()+_T(" ")+ref->GetID()+_T("\r\n"));
CComPtr<IMgaReference> mgaRef;
COMTHROW(ref->mgaFco.QueryInterface(&mgaRef));
long count;
COMTHROW(fcos->get_Count(&count));
/* if(count != 1) {
- AfxMessageBox("Only a single object can be dropped on a reference for redirection!");
+ AfxMessageBox(_T("Only a single object can be dropped on a reference for redirection!"));
throw hresult_exception(E_FAIL);
} */
if(count < 1) {
- AfxMessageBox("Cannot redirect reference to specified object!");
- CGMEEventLogger::LogGMEEvent(" Cannot redirect reference to specified object.\r\n");
+ AfxMessageBox(_T("Cannot redirect reference to specified object!"));
+ CGMEEventLogger::LogGMEEvent(_T(" Cannot redirect reference to specified object.\r\n"));
throw hresult_exception(E_FAIL);
}
CComPtr<IMgaFCO> fco;
@@ -3595,9 +3596,9 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- CGMEEventLogger::LogGMEEvent( " Cannot redirect reference to specified object.\r\n");
- const char* t1 = "Cannot redirect reference to specified object because of active connections!";
- const char* t2 = "Cannot redirect reference to specified object.";
+ CGMEEventLogger::LogGMEEvent( _T(" Cannot redirect reference to specified object.\r\n"));
+ const TCHAR* t1 = _T("Cannot redirect reference to specified object because of active connections!");
+ const TCHAR* t2 = _T("Cannot redirect reference to specified object.");
if( e.hr == E_MGA_REFPORTS_USED)
{
if( !CGMEConsole::theInstance) AfxMessageBox( t1);
@@ -3629,8 +3630,8 @@
COMTHROW(doc->resolver->get_RefRoleByMeta(currentModel,aspect,fco,&role));
if(role == 0)
{
- AfxMessageBox("Cannot create reference");
- CGMEEventLogger::LogGMEEvent(" Cannot create reference.\r\n");
+ AfxMessageBox(_T("Cannot create reference"));
+ CGMEEventLogger::LogGMEEvent(_T(" Cannot create reference.\r\n"));
}
else {
CComPtr<IMgaFCO> ref;
@@ -3646,7 +3647,7 @@
// After Larry's wishes
/* CString nm;
CopyTo(nmb,nm);
- nm += "Ref";
+ nm += _T("Ref");
CopyTo(nm,nmb); */
COMTHROW(ref->put_Name(nmb));
}
@@ -3742,7 +3743,7 @@
AbortTransaction(e.hr);
_bstr_t err;
GetErrorInfo(e.hr, err.GetAddress());
- AfxMessageBox((std::string("Unable to insert objects: ") + static_cast<const char*>(err)).c_str(), MB_ICONSTOP | MB_OK); // in most cases there was an error msg already...
+ AfxMessageBox((std::wstring(L"Unable to insert objects: ") + static_cast<const wchar_t*>(err)).c_str(), MB_ICONSTOP | MB_OK); // in most cases there was an error msg already...
newObjectIDs.RemoveAll();
}
return false;
@@ -3783,8 +3784,8 @@
}
else {
CommitTransaction();
- AfxMessageBox("Paradigm violation: cannot insert new part!");
- CGMEEventLogger::LogGMEEvent(" Paradigm violation: cannot insert new part.\r\n");
+ AfxMessageBox(_T("Paradigm violation: cannot insert new part!"));
+ CGMEEventLogger::LogGMEEvent(_T(" Paradigm violation: cannot insert new part.\r\n"));
return false;
}
}
@@ -3792,8 +3793,8 @@
AbortTransaction(e.hr);
_bstr_t err;
GetErrorInfo(e.hr, err.GetAddress());
- AfxMessageBox((std::string("Unable to insert objects: ") + static_cast<const char*>(err)).c_str(), MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to insert objects.\r\n");
+ AfxMessageBox((std::wstring(L"Unable to insert objects: ") + static_cast<const wchar_t*>(err)).c_str(), MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to insert objects.\r\n"));
newObjectIDs.RemoveAll();
Reset(true); //BGY
return false;
@@ -3824,7 +3825,7 @@
collision = false;
}
else {
- nodePath.Append("Copy");
+ nodePath.Append(_T("Copy"));
}
}
@@ -3896,7 +3897,7 @@
CPoint pt = obj->GetLocation().CenterPoint();
if(!modelGrid.IsAvailable(obj)) {
if(!modelGrid.GetClosestAvailable(obj,pt)) {
- AfxMessageBox("Too Many Models! Internal Program Error!",MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Too Many Models! Internal Program Error!"),MB_OK | MB_ICONSTOP);
EndWaitCursor();
return;
}
@@ -3929,7 +3930,7 @@
// CPoint npt = loc.CenterPoint();
// if(!modelGrid.IsAvailable(loc)) {
// if(!modelGrid.GetClosestAvailable(loc.Size(),npt)) {
- // AfxMessageBox("Too Many Models! Internal Program Error!",MB_OK | MB_ICONSTOP);
+ // AfxMessageBox(_T("Too Many Models! Internal Program Error!"),MB_OK | MB_ICONSTOP);
// EndWaitCursor();
// return;
// }
@@ -3979,7 +3980,7 @@
bool CGMEView::Connect(CGuiObject *src,CGuiPort *srcPort, int srcHotSide, CGuiObject *dst,CGuiPort *dstPort, int dstHotSide, bool nosticky)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::Connect src="+src->GetName()+" "+src->GetID()+",dst="+dst->GetName()+" "+dst->GetID()+" in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::Connect src=")+src->GetName()+_T(" ")+src->GetID()+_T(",dst=")+dst->GetName()+_T(" ")+dst->GetID()+_T(" in ")+path+name+_T("\r\n"));
bool ret = false;
CGMEDoc *doc = GetDocument();
try {
@@ -3991,11 +3992,11 @@
if (srcPort) {
srcPort = srcPort->IsRealPort() ? srcPort : NULL;
- if (srcPort) CGMEEventLogger::LogGMEEvent(" srcPort="+srcPort->GetName()+" "+srcPort->GetID()+"\r\n");
+ if (srcPort) CGMEEventLogger::LogGMEEvent(_T(" srcPort=")+srcPort->GetName()+_T(" ")+srcPort->GetID()+_T("\r\n"));
}
if (dstPort) {
dstPort = dstPort->IsRealPort() ? dstPort : NULL;
- if (dstPort) CGMEEventLogger::LogGMEEvent(" dstPort="+dstPort->GetName()+" "+dstPort->GetID()+"\r\n");
+ if (dstPort) CGMEEventLogger::LogGMEEvent(_T(" dstPort=")+dstPort->GetName()+_T(" ")+dstPort->GetID()+_T("\r\n"));
}
#pragma warning(disable: 4310) // cast truncates constant value
COMTHROW(doc->resolver->put_IsStickyEnabled(nosticky ? VARIANT_FALSE :VARIANT_TRUE));
@@ -4048,30 +4049,30 @@
CString routerPrefStr;
switch (srcHotSide) {
case GME_NORTH:
- routerPrefStr = "N";
+ routerPrefStr = _T("N");
break;
case GME_SOUTH:
- routerPrefStr = "S";
+ routerPrefStr = _T("S");
break;
case GME_WEST:
- routerPrefStr = "W";
+ routerPrefStr = _T("W");
break;
case GME_EAST:
- routerPrefStr = "E";
+ routerPrefStr = _T("E");
break;
}
switch (dstHotSide) {
case GME_NORTH:
- routerPrefStr += "n";
+ routerPrefStr += _T("n");
break;
case GME_SOUTH:
- routerPrefStr += "s";
+ routerPrefStr += _T("s");
break;
case GME_WEST:
- routerPrefStr += "w";
+ routerPrefStr += _T("w");
break;
case GME_EAST:
- routerPrefStr += "e";
+ routerPrefStr += _T("e");
break;
}
if (!routerPrefStr.IsEmpty()) {
@@ -4085,14 +4086,14 @@
}
else {
CommitTransaction();
- CGMEEventLogger::LogGMEEvent(" Paradigm violation: cannot connect selected objects!\r\n");
- AfxMessageBox("Paradigm violation: cannot connect selected objects!",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Paradigm violation: cannot connect selected objects!\r\n"));
+ AfxMessageBox(_T("Paradigm violation: cannot connect selected objects!"),MB_ICONSTOP | MB_OK);
}
}
catch(hresult_exception &e) {
- CGMEEventLogger::LogGMEEvent(" Cannot Connect, hresult_exception in CGMEView::Connect\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" Cannot Connect, hresult_exception in CGMEView::Connect\r\n"));
AbortTransaction(e.hr);
-// AfxMessageBox("Unable to connect specified parts!",MB_ICONSTOP | MB_OK);
+// AfxMessageBox(_T("Unable to connect specified parts!"),MB_ICONSTOP | MB_OK);
Reset(true); // BGY: something similar needed, otherwise the created conenction not
// deleted form the gui if the committransaction failed
ret = false;
@@ -4139,14 +4140,14 @@
void CGMEView::InsertNewPart(const CString& roleName, const CPoint& pt)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::InsertNewPart("+roleName+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::InsertNewPart(")+roleName+_T(") in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> child;
CComPtr<IMgaMetaRole> role;
try {
BeginTransaction();
if(!currentAspect->GetRoleByName(roleName, role, true)) {
- AfxMessageBox("Internal Program Error in CGMEView::InsertNewPart");
- CGMEEventLogger::LogGMEEvent(" Internal Program Error in CGMEView::InsertNewPart.\r\n");
+ AfxMessageBox(_T("Internal Program Error in CGMEView::InsertNewPart"));
+ CGMEEventLogger::LogGMEEvent(_T(" Internal Program Error in CGMEView::InsertNewPart.\r\n"));
AbortTransaction(E_FAIL);
return;
}
@@ -4176,8 +4177,8 @@
catch(hresult_exception &e) {
AbortTransaction(e.hr);
newObjectIDs.RemoveAll();
- AfxMessageBox("Unable to insert new part",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to insert new part.\r\n");
+ AfxMessageBox(_T("Unable to insert new part"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to insert new part.\r\n"));
return;
}
ChangeAttrPrefObjs(selected);
@@ -4189,15 +4190,15 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to update parent",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to update parent.\r\n");
+ AfxMessageBox(_T("Unable to update parent"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to update parent.\r\n"));
}
Invalidate(true);
}
void CGMEView::ChangeAspect(CString aspName, bool p_eraseStack /*=true*/)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ChangeAspect("+aspName+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ChangeAspect(")+aspName+_T(") in ")+path+name+_T("\r\n"));
if(currentAspect->name != aspName) {
CGuiMetaAspect *newAsp = guiMeta->FindAspect(aspName);
if(newAsp) {
@@ -4209,7 +4210,7 @@
{
if( m_isActive) // only the active view's changeaspect event is recorded
{
- GetDocument()->tellHistorian( currentModel, currentAspect?currentAspect->name:"");
+ GetDocument()->tellHistorian( currentModel, currentAspect?currentAspect->name:_T(""));
}
if( p_eraseStack)
@@ -4239,7 +4240,7 @@
// if (gmeviewA)
if (m_isActive)
{
- TRACE("CGMEView::ChangeAspect activeView\n");
+ TRACE(_T("CGMEView::ChangeAspect activeView\n"));
/*gmeviewA->*/m_refreshpannwin = true;
}
Invalidate();
@@ -4347,7 +4348,7 @@
void CGMEView::OnDropFiles(HDROP p_hDropInfo)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDropFiles in " + path + name + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDropFiles in ") + path + name + _T("\r\n"));
if (GetDocument()->GetEditMode() == GME_EDIT_MODE) {
CPoint point;
DragQueryPoint(p_hDropInfo, &point);
@@ -4376,8 +4377,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -4452,7 +4453,7 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to set model name");
+ AfxMessageBox(_T("Unable to set model name"));
SetNameProperty();
}
}
@@ -4474,7 +4475,7 @@
ResolveConnections();
if( theApp.isHistoryEnabled())
{
- GetDocument()->tellHistorian( currentModel, currentAspect?currentAspect->name:"");
+ GetDocument()->tellHistorian( currentModel, currentAspect?currentAspect->name:_T(""));
GetDocument()->clearForwHistory();
}
@@ -4493,7 +4494,7 @@
RemoveAllAnnotationFromSelection();
ClearConnectionSelection();
- TRACE("CGMEView::OnSelChangeAspectProp\n");
+ TRACE(_T("CGMEView::OnSelChangeAspectProp\n"));
m_refreshpannwin = true;
Invalidate();
}
@@ -4501,7 +4502,7 @@
bool CGMEView::ChangePrnAspect(CString aspName)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ChangePrnAspect("+aspName+") in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ChangePrnAspect(")+aspName+_T(") in ")+path+name+_T("\r\n"));
if(currentAspect->name == aspName)
return true;
CGuiMetaAspect *newAsp = guiMeta->FindAspect(aspName);
@@ -4527,7 +4528,7 @@
{
isLeftMouseButtonDown = false;
isConnectionJustSelected = false;
- CGMEEventLogger::LogGMEEvent("CGMEView::OnLButtonUp in " + path + name + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnLButtonUp in ") + path + name + _T("\r\n"));
CPoint ppoint = point;
if (!tmpConnectMode) {
@@ -4538,7 +4539,7 @@
switch(doc->GetEditMode()) {
case GME_EDIT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_EDIT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_EDIT_MODE\r\n"));
CGMEView* self = const_cast<CGMEView*> (this);
CGuiObject* object = self ? self->FindObject(point, true) : 0;
@@ -4575,8 +4576,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -4670,8 +4671,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -4720,7 +4721,7 @@
void CGMEView::OnLButtonDown(UINT nFlags, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnLButtonDown in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnLButtonDown in ")+path+name+_T("\r\n"));
isLeftMouseButtonDown = true;
if (!(nFlags & MK_LBUTTON)) {
// PETER: this was needed to discard "got focus" situations: eg.: add-on dialog appears during attribute editing
@@ -4745,7 +4746,7 @@
switch(doc->GetEditMode()) {
case GME_EDIT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_EDIT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_EDIT_MODE\r\n"));
CGMEView* self = const_cast<CGMEView*> (this);
CGuiObject* object = self ? self->FindObject(point, true) : 0;
@@ -4782,8 +4783,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -4836,7 +4837,7 @@
customizeConnectionEdgeYMinLimit,
customizeConnectionEdgeYMaxLimit);
if (customizeConnectionEdgeIndex >= 0 && !isPartFixed) {
- TRACE("Starting edge customize operation of %ld.: (%ld, %ld)-(%ld, %ld)-(%ld, %ld) min/max: X(%ld, %ld) Y(%ld, %ld) h/v: %d\n",
+ TRACE(_T("Starting edge customize operation of %ld.: (%ld, %ld)-(%ld, %ld)-(%ld, %ld) min/max: X(%ld, %ld) Y(%ld, %ld) h/v: %d\n"),
customizeConnectionEdgeIndex,
customizeConnectionEdgeStartPoint.x, customizeConnectionEdgeStartPoint.y,
customizeConnectionEdgeEndPoint.x, customizeConnectionEdgeEndPoint.y,
@@ -4867,8 +4868,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -4932,7 +4933,7 @@
POSITION alreadySelected = 0;
if((selection != 0) || (annotation != 0)) {
if (selection) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+selection->GetName()+" "+selection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+selection->GetName()+_T(" ")+selection->GetID()+_T("\r\n"));
alreadySelected = selected.Find(selection);
if(alreadySelected)
{
@@ -4950,7 +4951,7 @@
selected.AddHead(selection);
}
if (annotation) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+annotation->GetName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+annotation->GetName()+_T("\r\n"));
alreadySelected = selectedAnnotations.Find(annotation);
if (alreadySelected) {
RemoveAnnotationFromSelection(alreadySelected);
@@ -5047,12 +5048,12 @@
int num;
if((num = currentModel->CheckForReferences(selected)) > 0) {
char txt[128];
- sprintf(txt,"Selected model(s) cannot be deleted due to %ld reference(s)",num);
+ sprintf(txt,_T("Selected model(s) cannot be deleted due to %ld reference(s)"),num);
AfxMessageBox(txt,MB_OK | MB_ICONSTOP);
}
else if((num = currentModel->CheckForInherited(selected)) > 0) {
char txt[128];
- sprintf(txt,"Selected model(s) cannot be deleted due to %ld inherited part(s)",num);
+ sprintf(txt,_T("Selected model(s) cannot be deleted due to %ld inherited part(s)"),num);
AfxMessageBox(txt,MB_OK | MB_ICONSTOP);
}
else {
@@ -5105,7 +5106,7 @@
case GME_AUTOCONNECT_MODE:
case GME_SHORTAUTOCONNECT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_AUTOCONNECT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_AUTOCONNECT_MODE\r\n"));
if(connTmp) {
if(connSrc == 0) {
connSrc = connTmp;
@@ -5126,7 +5127,7 @@
case GME_DISCONNECT_MODE:
case GME_SHORTDISCONNECT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_DISCONNECT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_DISCONNECT_MODE\r\n"));
CGuiObject *selection = FindObject(point);
if(selection) {
CGuiPort *port = 0;
@@ -5140,18 +5141,18 @@
if(conns.GetCount() < 2) {
if(conns.GetCount() == 1) {
if(!DeleteConnection(conns.GetHead())) {
- AfxMessageBox("Connection cannot be deleted!");
+ AfxMessageBox(_T("Connection cannot be deleted!"));
}
}
else if(conns.GetCount() == 0) {
- AfxMessageBox("Selected object is not connected!");
+ AfxMessageBox(_T("Selected object is not connected!"));
}
ClearConnSpecs();
if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
}
} else {
- AfxMessageBox("Cannot find port to connection!");
+ AfxMessageBox(_T("Cannot find port to connection!"));
}
}
else {
@@ -5159,10 +5160,10 @@
FindConnections(connSrc,connSrcPort,selection,port,conns);
if(conns.GetCount()) {
if(!DeleteConnection(conns.GetHead()))
- AfxMessageBox("Connection cannot be deleted!");
+ AfxMessageBox(_T("Connection cannot be deleted!"));
}
else
- AfxMessageBox("Selected objects are not connected!");
+ AfxMessageBox(_T("Selected objects are not connected!"));
ClearConnSpecs();
if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
@@ -5172,7 +5173,7 @@
CGuiConnection *conn = router.FindConnection(point);
if(conn) {
if(!DeleteConnection(conn))
- AfxMessageBox("Connection cannot be deleted!");
+ AfxMessageBox(_T("Connection cannot be deleted!"));
ClearConnSpecs();
if( doc->GetEditMode() == GME_SHORTDISCONNECT_MODE)
GetDocument()->SetMode(0); // switch back to GME_EDIT_MODE
@@ -5183,7 +5184,7 @@
break;
case GME_SET_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_SET_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_SET_MODE\r\n"));
if(!currentSet)
break;
CGuiFco *fco = 0;
@@ -5191,7 +5192,7 @@
BeginTransaction(TRANSACTION_READ_ONLY);
CGuiObject *object = FindObject(point);
if(object) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+object->GetName()+" "+object->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+object->GetName()+_T(" ")+object->GetID()+_T("\r\n"));
if(currentSet->CheckMember(object))
fco = object;
}
@@ -5221,7 +5222,7 @@
break;
case GME_ZOOM_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_ZOOM_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_ZOOM_MODE\r\n"));
CRectTracker tracker;
tracker.m_rect = CRect(0,0,0,0);
if(tracker.TrackRubberBand(this, trackPoint,TRUE))
@@ -5241,10 +5242,10 @@
break;
case GME_VISUAL_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_VISUAL_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_VISUAL_MODE\r\n"));
CGuiObject *obj = FindObject(point);
if(obj) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+obj->GetName()+" "+obj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+obj->GetName()+_T(" ")+obj->GetID()+_T("\r\n"));
obj->ToggleGrayOut();
CGuiFco::GrayOutNonInternalConnections(connections);
Invalidate();
@@ -5252,7 +5253,7 @@
else {
CGuiConnection *conn = router.FindConnection(point);
if(conn) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+conn->GetName()+" "+conn->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+conn->GetName()+_T(" ")+conn->GetID()+_T("\r\n"));
conn->ToggleGrayOut();
conn->GrayOutEndPoints();
Invalidate();
@@ -5260,7 +5261,7 @@
else {
CGuiAnnotator *ann = FindAnnotation(point);
if (ann) {
- CGMEEventLogger::LogGMEEvent(" LButton over "+ann->GetName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" LButton over ")+ann->GetName()+_T("\r\n"));
ann->ToggleGrayOut();
Invalidate();
}
@@ -5278,7 +5279,7 @@
void CGMEView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnLButtonDblClk in " + path + name + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnLButtonDblClk in ") + path + name + _T("\r\n"));
CPoint ppoint = point;
if (GetDocument()->GetEditMode() == GME_EDIT_MODE) {
CoordinateTransfer(point); // DPtoLP
@@ -5316,8 +5317,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -5376,7 +5377,7 @@
CGuiObject *selection = FindObject(point);
if(selection) {
- CGMEEventLogger::LogGMEEvent( "LButton double clicked on "+selection->GetName()+" "+selection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent( _T("LButton double clicked on ")+selection->GetName()+_T(" ")+selection->GetID()+_T("\r\n"));
CString aspectName = currentAspect->name;
CComPtr<IMgaFCO> mgaFco = selection->mgaFco;
CComPtr<IMgaModel> model;
@@ -5428,10 +5429,10 @@
}
}
}
-// AfxMessageBox("Referenced model is a root model. Opening model."); // instead show target selected
+// AfxMessageBox(_T("Referenced model is a root model. Opening model.")); // instead show target selected
else // obj is not a model, referred is also not a model
{
- CGMEConsole::theInstance->Message( "Reference target is child of a folder, thus it is shown in the TreeBrowser only.", MSG_INFO);
+ CGMEConsole::theInstance->Message( _T("Reference target is child of a folder, thus it is shown in the TreeBrowser only."), MSG_INFO);
CGMEBrowser::theInstance->FocusItem( referred_id);//CComBSTR( mgaObjectId));//FireLocateMgaObject( (LPCTSTR) (CString) referred_id);
//CGMEBrowser::theInstance->FocusItem( CComBSTR( (LPCTSTR) CString( referred_id)));
CScrollZoomView::OnLButtonDblClk(nFlags, ppoint);
@@ -5468,8 +5469,8 @@
}
else
{
- AfxMessageBox("Unable to show referred object of null reference!");
- CGMEEventLogger::LogGMEEvent(" Unable to show referred object of null reference.\r\n");
+ AfxMessageBox(_T("Unable to show referred object of null reference!"));
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to show referred object of null reference.\r\n"));
}
}
}
@@ -5496,7 +5497,7 @@
}
}
else if (annotation) {
- CGMEEventLogger::LogGMEEvent( "LButton double clicked on "+annotation->GetName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent( _T("LButton double clicked on ")+annotation->GetName()+_T("\r\n"));
CComPtr<IMgaFCO> fcoToShow;
currentModel.QueryInterface(&fcoToShow);
ShowAnnotationBrowser(fcoToShow, annotation->rootNode);
@@ -5507,7 +5508,7 @@
struct _timeb measuerementStartTime;
_ftime(&measuerementStartTime);
CString structSizeStr;
- structSizeStr.Format("sizeof(CAutoRouterEdge) = %ld\n", sizeof(CAutoRouterEdge));
+ structSizeStr.Format(_T("sizeof(CAutoRouterEdge) = %ld\n"), sizeof(CAutoRouterEdge));
OutputDebugString(structSizeStr);
for (long i = 0; i < 10; i++)
AutoRoute();
@@ -5516,11 +5517,11 @@
unsigned long elapsedSeconds = (unsigned long)(measuerementEndTime.time - measuerementStartTime.time);
long elapsedMilliSeconds = ((long)measuerementEndTime.millitm - measuerementStartTime.millitm);
CString elapsedTimeStr;
- elapsedTimeStr.Format("Ellapsed: %lu s + %d ms\n", elapsedSeconds, elapsedMilliSeconds);
+ elapsedTimeStr.Format(_T("Ellapsed: %lu s + %d ms\n"), elapsedSeconds, elapsedMilliSeconds);
OutputDebugString(elapsedTimeStr);
Reset();*/
// XML dump test
-// HRESULT hr = DumpModelGeometryXML("C:\\XMLDump.xml");
+// HRESULT hr = DumpModelGeometryXML(_T("C:\\XMLDump.xml"));
//#else
OnViewParent(); // double click on model background brings up the parent model
// user requested standard behavior
@@ -5533,7 +5534,7 @@
void CGMEView::OnRButtonDown(UINT nFlags, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnRButtonDown in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnRButtonDown in ")+path+name+_T("\r\n"));
CPoint local = point;
CPoint ppoint = point;
CoordinateTransfer(local); // DPtoLP
@@ -5563,14 +5564,14 @@
contextAnnotation = NULL;
}
if (contextSelection)
- CGMEEventLogger::LogGMEEvent(" RButton over "+contextSelection->GetName()+" "+contextSelection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" RButton over ")+contextSelection->GetName()+_T(" ")+contextSelection->GetID()+_T("\r\n"));
else if (contextAnnotation)
- CGMEEventLogger::LogGMEEvent(" RButton over "+contextAnnotation->GetName()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" RButton over ")+contextAnnotation->GetName()+_T("\r\n"));
switch(doc->GetEditMode()) {
case GME_SET_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_SET_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_SET_MODE\r\n"));
selected.RemoveAll();
RemoveAllAnnotationFromSelection();
ClearConnectionSelection();
@@ -5606,14 +5607,14 @@
break;
case GME_ZOOM_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_ZOOM_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_ZOOM_MODE\r\n"));
ZoomOut(ppoint);
Invalidate();
}
break;
case GME_VISUAL_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_VISUAL_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_VISUAL_MODE\r\n"));
CGuiObject* obj = NULL;
if (contextSelection)
obj = contextSelection->dynamic_cast_CGuiObject();
@@ -5642,7 +5643,7 @@
break;
case GME_EDIT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_EDIT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_EDIT_MODE\r\n"));
CPoint global = point;
ClientToScreen(&global);
@@ -5689,7 +5690,7 @@
}
if (contextPort != NULL) {
- CString itemname = CString( "[") + (contextSelection?(contextSelection->GetInfoText() + CString(" : ")): CString("")) + contextPort->GetInfoText() + CString( "]");
+ CString itemname = CString( _T("[")) + (contextSelection?(contextSelection->GetInfoText() + CString(_T(" : "))): CString(_T(""))) + contextPort->GetInfoText() + CString( _T("]"));
CMenu menu;
menu.LoadMenu(IDR_PORTCONTEXT_MENU);
@@ -5726,8 +5727,8 @@
menu.LoadMenu(selectedContextConnection != NULL ? IDR_CONNCONTEXT_MENU : IDR_CONTEXT_MENU);
CMenu* subMenu = menu.GetSubMenu(0);
if (::GetMenuItemCount(decoratorAdditionalMenu) > 0) {
- subMenu->InsertMenu(0, MF_BYPOSITION | MF_SEPARATOR, 0, "");
- subMenu->InsertMenu(0, MF_BYPOSITION | MF_POPUP | MF_ENABLED, (UINT_PTR)(decoratorAdditionalMenu), "Decorator Edit");
+ subMenu->InsertMenu(0, MF_BYPOSITION | MF_SEPARATOR, 0, _T(""));
+ subMenu->InsertMenu(0, MF_BYPOSITION | MF_POPUP | MF_ENABLED, (UINT_PTR)(decoratorAdditionalMenu), _T("Decorator Edit"));
}
UINT cmdId = (UINT)subMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
global.x,global.y,GetParent());
@@ -5751,8 +5752,8 @@
menu.LoadMenu(IDR_ANNCONTEXT_MENU);
CMenu* subMenu = menu.GetSubMenu(0);
if (::GetMenuItemCount(decoratorAdditionalMenu) > 0) {
- subMenu->InsertMenu(0, MF_BYPOSITION | MF_SEPARATOR, 0, "");
- subMenu->InsertMenu(0, MF_BYPOSITION | MF_POPUP | MF_ENABLED, (UINT_PTR)(decoratorAdditionalMenu), "Decorator Edit");
+ subMenu->InsertMenu(0, MF_BYPOSITION | MF_SEPARATOR, 0, _T(""));
+ subMenu->InsertMenu(0, MF_BYPOSITION | MF_POPUP | MF_ENABLED, (UINT_PTR)(decoratorAdditionalMenu), _T("Decorator Edit"));
}
UINT cmdId = (UINT)subMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
global.x,global.y,GetParent());
@@ -5771,7 +5772,7 @@
#if defined(ADDCRASHTESTMENU)
CMenu crashTestMenu;
crashTestMenu.LoadMenu(IDR_CRASH_TEST_MENU);
- submenu->AppendMenu(MF_POPUP, (UINT_PTR)((HMENU)crashTestMenu), "Debug");
+ submenu->AppendMenu(MF_POPUP, (UINT_PTR)((HMENU)crashTestMenu), _T("Debug"));
#endif
submenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
global.x,global.y,GetParent());
@@ -5782,11 +5783,11 @@
case GME_AUTOCONNECT_MODE:
case GME_SHORTAUTOCONNECT_MODE:
- CGMEEventLogger::LogGMEEvent(" mode=GME_AUTOCONNECT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_AUTOCONNECT_MODE\r\n"));
case GME_DISCONNECT_MODE:
case GME_SHORTDISCONNECT_MODE:
{
- CGMEEventLogger::LogGMEEvent(" mode=GME_DISCONNECT_MODE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" mode=GME_DISCONNECT_MODE\r\n"));
CPoint global = point;
ClientToScreen(&global);
if (contextSelection) {
@@ -5885,7 +5886,7 @@
DROPEFFECT CGMEView::OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDragEnter in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDragEnter in ")+path+name+_T("\r\n"));
ASSERT(prevDropEffect == DROPEFFECT_NONE);
if(isType && CGMEDataSource::IsGmeNativeDataAvailable(pDataObject,theApp.mgaProject)) {
@@ -5939,7 +5940,7 @@
void CGMEView::OnDragLeave()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDragLeave from "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDragLeave from ")+path+name+_T("\r\n"));
CClientDC dc(this);
OnPrepareDC(&dc);
if(prevDropEffect != DROPEFFECT_NONE) {
@@ -5951,7 +5952,7 @@
DROPEFFECT CGMEView::OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDragOver in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDragOver in ")+path+name+_T("\r\n"));
//this event happens too much, logfile size could explode...
if(!CGMEDataSource::IsGmeNativeDataAvailable(pDataObject,theApp.mgaProject))
// if(!pDataObject->IsDataAvailable(CGMEDataSource::cfGMEDesc))
@@ -5967,7 +5968,7 @@
HRESULT retVal = S_OK;
DROPEFFECT dropEffect = DROPEFFECT_NONE;
if(obj) {
- CGMEEventLogger::LogGMEEvent(" Dragging over: "+obj->GetName()+" "+obj->GetID()+" in "+path+name+"\r\n");//better this way, not logging dragging over empty space
+ CGMEEventLogger::LogGMEEvent(_T(" Dragging over: ")+obj->GetName()+_T(" ")+obj->GetID()+_T(" in ")+path+name+_T("\r\n"));//better this way, not logging dragging over empty space
CGuiAspect* pAspect = obj->GetCurrentAspect();
if (pAspect != NULL) {
@@ -6037,15 +6038,15 @@
BOOL CGMEView::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDrop in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDrop in ")+path+name+_T("\r\n"));
if(dropEffect & DROPEFFECT_MOVE)
- CGMEEventLogger::LogGMEEvent(" DROPEFFECT_MOVE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" DROPEFFECT_MOVE\r\n"));
if(dropEffect & DROPEFFECT_LINK)
- CGMEEventLogger::LogGMEEvent(" DROPEFFECT_LINK\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" DROPEFFECT_LINK\r\n"));
if(dropEffect & DROPEFFECT_COPY)
- CGMEEventLogger::LogGMEEvent(" DROPEFFECT_COPY\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" DROPEFFECT_COPY\r\n"));
if(dropEffect == DROPEFFECT_NONE) //DROPEFFECT_NONE==0
- CGMEEventLogger::LogGMEEvent(" DROPEFFECT_NONE\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" DROPEFFECT_NONE\r\n"));
ASSERT_VALID(this);
CGMEDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
@@ -6064,7 +6065,7 @@
if ((dropEffect & DROPEFFECT_MOVE) && inDrag)
{
ASSERT((selected.GetCount() + selectedAnnotations.GetCount()) > 0);
- CGMEEventLogger::LogGMEEvent(" Dropping:\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" Dropping:\r\n"));
GMEEVENTLOG_GUIOBJS(selected);
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
Invalidate();
@@ -6100,8 +6101,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- CGMEEventLogger::LogGMEEvent(" Unable to complete drop operation.\r\n");
- AfxMessageBox("Unable to complete drop operation",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to complete drop operation.\r\n"));
+ AfxMessageBox(_T("Unable to complete drop operation"),MB_ICONSTOP | MB_OK);
Reset(true);
return FALSE;
}
@@ -6161,13 +6162,13 @@
// GetDocument()->InvalidateAllViews(true);
return TRUE;
}
- CGMEEventLogger::LogGMEEvent(" Nothing Dropped\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" Nothing Dropped\r\n"));
return FALSE;
}
void CGMEView::OnViewParent()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnViewParent from "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnViewParent from ")+path+name+_T("\r\n"));
ShowModel(parent);
}
@@ -6197,7 +6198,7 @@
void CGMEView::OnEditNudgedown()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditNudgedown in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditNudgedown in ")+path+name+_T("\r\n"));
try {
BeginTransaction();
@@ -6210,8 +6211,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to nudge objects.\r\n");
+ AfxMessageBox(_T("Unable to nudge objects"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to nudge objects.\r\n"));
return;
}
ResetParent();
@@ -6221,7 +6222,7 @@
void CGMEView::OnEditNudgeleft()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditNudgeleft in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditNudgeleft in ")+path+name+_T("\r\n"));
try {
BeginTransaction();
@@ -6233,8 +6234,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to nudge objects.\r\n");
+ AfxMessageBox(_T("Unable to nudge objects"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to nudge objects.\r\n"));
return;
}
ResetParent();
@@ -6244,7 +6245,7 @@
void CGMEView::OnEditNudgeright()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditNudgeright in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditNudgeright in ")+path+name+_T("\r\n"));
try {
BeginTransaction();
@@ -6256,8 +6257,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to nudge objects.\r\n");
+ AfxMessageBox(_T("Unable to nudge objects"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to nudge objects.\r\n"));
return;
}
ResetParent();
@@ -6267,7 +6268,7 @@
void CGMEView::OnEditNudgeup()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditNudgeup in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditNudgeup in ")+path+name+_T("\r\n"));
try {
BeginTransaction();
@@ -6279,8 +6280,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to nudge objects",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to nudge objects.\r\n");
+ AfxMessageBox(_T("Unable to nudge objects"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to nudge objects.\r\n"));
return;
}
ResetParent();
@@ -6356,8 +6357,8 @@
// GME-292: the commit may fail
AbortTransaction(e.hr);
if (e.hr != E_MGA_CONSTRAINT_VIOLATION) {
- CGMEEventLogger::LogGMEEvent(" Couldn't commit transaction.\r\n");
- AfxMessageBox("Couldn't commit transaction.",MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Couldn't commit transaction.\r\n"));
+ AfxMessageBox(_T("Couldn't commit transaction."),MB_ICONSTOP | MB_OK);
}
}
SetShouldCommitOperation(false);
@@ -6386,11 +6387,11 @@
void CGMEView::OnEditDelete()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditDelete in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditDelete in ")+path+name+_T("\r\n"));
if (selectedConnection && selected.IsEmpty() && selectedAnnotations.IsEmpty()) {
if(!DeleteConnection(selectedConnection))
- AfxMessageBox("Connection cannot be deleted!");
+ AfxMessageBox(_T("Connection cannot be deleted!"));
} else {
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
DeleteAnnotations(selectedAnnotations);
@@ -6417,7 +6418,7 @@
void CGMEView::OnContextProperties()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnContextProperties in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnContextProperties in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if (guiObj)
@@ -6474,7 +6475,7 @@
void CGMEView::OnCntxPreferences()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPreferences in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPreferences in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if(guiObj)
@@ -6496,7 +6497,7 @@
void CGMEView::OnCntxDisconnectall()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDisconnectall in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDisconnectall in ")+path+name+_T("\r\n"));
if (!isType)
return;
if (contextSelection) {
@@ -6514,8 +6515,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- AfxMessageBox("Could not complete disconnect operation",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent(" Could not complete disconnect operation.\r\n");
+ AfxMessageBox(_T("Could not complete disconnect operation"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T(" Could not complete disconnect operation.\r\n"));
}
}
}
@@ -6529,7 +6530,7 @@
void CGMEView::OnCntxAttributes()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxAttributes in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxAttributes in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if (guiObj)
@@ -6559,15 +6560,15 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to get model attributes",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent(" Unable to get model attributes.\r\n");
+ AfxMessageBox(_T("Unable to get model attributes"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to get model attributes.\r\n"));
}
pCmdUI->Enable(enable);
}
void CGMEView::OnEditUndo()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditUndo\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditUndo\r\n"));
if (IsInElementDecoratorOperation())
return;
theApp.mgaProject->Undo();
@@ -6576,7 +6577,7 @@
void CGMEView::OnEditRedo()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditRedo\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditRedo\r\n"));
if (IsInElementDecoratorOperation())
return;
theApp.mgaProject->Redo();
@@ -6585,7 +6586,7 @@
void CGMEView::OnEditCopy()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCopy in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditCopy in ")+path+name+_T("\r\n"));
if(selected.GetCount() + selectedAnnotations.GetCount() > 0) {
GMEEVENTLOG_GUIOBJS(selected);
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
@@ -6602,7 +6603,7 @@
void CGMEView::OnEditCopyClosure()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCopyClosure in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditCopyClosure in ")+path+name+_T("\r\n"));
if(selected.GetCount() > 0) {
GMEEVENTLOG_GUIOBJS(selected);
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
@@ -6619,7 +6620,7 @@
void CGMEView::OnEditCopySmart()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCopySmart in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditCopySmart in ")+path+name+_T("\r\n"));
if(selected.GetCount() > 0) {
GMEEVENTLOG_GUIOBJS(selected);
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
@@ -6655,7 +6656,7 @@
void CGMEView::OnEditCut()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCut in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditCut in ")+path+name+_T("\r\n"));
if(selected.GetCount() + selectedAnnotations.GetCount() > 0) {
if(isType) GMEEVENTLOG_GUIOBJS(selected);
GMEEVENTLOG_GUIANNOTATORS(selectedAnnotations);
@@ -6685,7 +6686,7 @@
void CGMEView::OnEditPaste()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPaste in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPaste in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -6707,11 +6708,11 @@
void CGMEView::OnCntxCopy()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCopy in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxCopy in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if(guiObj) {
- CGMEEventLogger::LogGMEEvent(" "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T("\r\n"));
CGuiObjectList list;
CGuiAnnotatorList dummyList;
list.AddTail(guiObj);
@@ -6727,7 +6728,7 @@
contextPort = 0;
}
else if (contextAnnotation) {
- CGMEEventLogger::LogGMEEvent(" "+contextAnnotation->GetName()+"/r/n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextAnnotation->GetName()+_T("/r/n"));
CGuiObjectList dummyList;
CGuiAnnotatorList list;
list.AddTail(contextAnnotation);
@@ -6744,11 +6745,11 @@
void CGMEView::OnCntxCopyClosure()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCopyClosure in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxCopyClosure in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if (guiObj) {
- CGMEEventLogger::LogGMEEvent(" "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T("\r\n"));
CGuiObjectList list;
CGuiAnnotatorList dummyList;
list.AddTail(guiObj);
@@ -6764,7 +6765,7 @@
contextPort = 0;
}
else if (contextAnnotation) {
- CGMEEventLogger::LogGMEEvent(" "+contextAnnotation->GetName()+"/r/n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextAnnotation->GetName()+_T("/r/n"));
CGuiObjectList dummyList;
CGuiAnnotatorList list;
list.AddTail(contextAnnotation);
@@ -6781,11 +6782,11 @@
void CGMEView::OnCntxCopySmart()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCopySmart in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxCopySmart in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if (guiObj) {
- CGMEEventLogger::LogGMEEvent(" "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T("\r\n"));
CGuiObjectList list;
CGuiAnnotatorList dummyList;
list.AddTail(guiObj);
@@ -6807,7 +6808,7 @@
CGuiConnection* guiConn = contextSelection->dynamic_cast_CGuiConnection();
if( guiConn) // a valid connection
{
- CGMEEventLogger::LogGMEEvent(" "+guiConn->GetName()+" "+guiConn->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiConn->GetName()+_T(" ")+guiConn->GetID()+_T("\r\n"));
CGuiFcoList list;
CGuiAnnotatorList dummyList;
list.AddTail(guiConn);
@@ -6822,7 +6823,7 @@
contextPort = 0;
}
else if (contextAnnotation) {
- CGMEEventLogger::LogGMEEvent(" "+contextAnnotation->GetName()+"/r/n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextAnnotation->GetName()+_T("/r/n"));
CGuiFcoList dummyList;
CGuiAnnotatorList list;
list.AddTail(contextAnnotation);
@@ -6840,11 +6841,11 @@
void CGMEView::OnCntxCut()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCut in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxCut in ")+path+name+_T("\r\n"));
if(isType && contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if(guiObj) {
- CGMEEventLogger::LogGMEEvent(" "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T("\r\n"));
CGuiObjectList list;
CGuiAnnotatorList dummyList;
list.AddTail(guiObj);
@@ -6861,7 +6862,7 @@
contextPort = 0;
}
else if (contextAnnotation) {
- CGMEEventLogger::LogGMEEvent(" "+contextAnnotation->GetName()+"/r/n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextAnnotation->GetName()+_T("/r/n"));
CGuiObjectList dummyList;
CGuiAnnotatorList list;
list.AddTail(contextAnnotation);
@@ -6887,11 +6888,11 @@
void CGMEView::OnCntxDelete()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDelete in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDelete in ")+path+name+_T("\r\n"));
if(isType && contextSelection) {
CGuiObject* guiObj = contextSelection->dynamic_cast_CGuiObject();
if(guiObj) {
- CGMEEventLogger::LogGMEEvent(" "+guiObj->GetName()+" "+guiObj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+guiObj->GetName()+_T(" ")+guiObj->GetID()+_T("\r\n"));
CGuiObjectList list;
list.AddTail(guiObj);
DeleteObjects(list);
@@ -6900,7 +6901,7 @@
contextPort = 0;
}
if( contextAnnotation) {
- CGMEEventLogger::LogGMEEvent(" "+contextAnnotation->GetName()+"/r/n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextAnnotation->GetName()+_T("/r/n"));
CGuiAnnotatorList list;
list.AddTail(contextAnnotation);
DeleteAnnotations(list);
@@ -6918,7 +6919,7 @@
void CGMEView::OnSelfcntxCopy()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnSelfcntxCopy in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnSelfcntxCopy in ")+path+name+_T("\r\n"));
OnEditCopy();
}
@@ -6929,13 +6930,13 @@
void CGMEView::OnSelfcntxCopyClosure()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnSelfcntxCopyClosure in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnSelfcntxCopyClosure in ")+path+name+_T("\r\n"));
OnEditCopyClosure();
}
void CGMEView::OnSelfcntxCopySmart()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnSelfcntxCopySmart in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnSelfcntxCopySmart in ")+path+name+_T("\r\n"));
OnEditCopySmart();
}
@@ -6971,7 +6972,7 @@
void CGMEView::OnSelfcntxPaste()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnSelfcntxPaste in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnSelfcntxPaste in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -6992,7 +6993,7 @@
// if (gmeviewA)
if (m_isActive)
{
- TRACE("CGMEView::OnActivateFrame\n");
+ TRACE(_T("CGMEView::OnActivateFrame\n"));
/*gmeviewA->*/m_refreshpannwin = true;
}
CScrollZoomView::OnActivateFrame(nState, pFrameWnd);
@@ -7001,8 +7002,8 @@
void CGMEView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
- CString s = bActivate ? "ACTIVATE ":"DEACTIVATE ";
- CGMEEventLogger::LogGMEEvent("CGMEView::OnActivateView "+s+path+name+"\r\n");
+ CString s = bActivate ? _T("ACTIVATE "):_T("DEACTIVATE ");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnActivateView ")+s+path+name+_T("\r\n"));
//I tried logging pActivateView and pDeactiveView, but they always seemed to be "this"
//anyways, OnActivateView is called on both views, so you would know if going from
//one to another by the ACTIVATE/DEACTIVATE - Brian
@@ -7014,7 +7015,7 @@
) {
if( theApp.isHistoryEnabled())
{
- GetDocument()->tellHistorian( currentModId, currentAspect?currentAspect->name:"");
+ GetDocument()->tellHistorian( currentModId, currentAspect?currentAspect->name:_T(""));
}
modelGrid.Clear();
@@ -7045,11 +7046,11 @@
{
// if (gmeviewA && guiMeta)
{
- TRACE("CGMEView::OnActivateView DoPannWinRefresh\n");
+ TRACE(_T("CGMEView::OnActivateView DoPannWinRefresh\n"));
DoPannWinRefresh();
}
}
- TRACE("CGMEView::OnActivateView final false\n");
+ TRACE(_T("CGMEView::OnActivateView final false\n"));
m_refreshpannwin = false;
if (bActivate)
theApp.UpdateMainTitle();
@@ -7059,7 +7060,7 @@
void CGMEView::OnEditCancel()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditCancel in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditCancel in ")+path+name+_T("\r\n"));
if(tmpConnectMode) {
tmpConnectMode = false;
ClearConnSpecs();
@@ -7102,29 +7103,29 @@
void CGMEView::OnFileClose()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnFileClose() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnFileClose() in ")+path+name+_T("\r\n"));
frame->SetSendEvent(true);
frame->PostMessage(WM_CLOSE);
}
void CGMEView::OnFileInterpret()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnFileInterpret in "+path+name+"\r\n");
- RunComponent("");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnFileInterpret in ")+path+name+_T("\r\n"));
+ RunComponent(_T(""));
}
void CGMEView::RunComponent(CString compname)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnRunComponent "+compname+" in "+path+name+"\r\n");
- CGMEEventLogger::LogGMEEvent(" Selected FCOs:");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnRunComponent ")+compname+_T(" in ")+path+name+_T("\r\n"));
+ CGMEEventLogger::LogGMEEvent(_T(" Selected FCOs:"));
GMEEVENTLOG_GUIFCOS(selected);
MSGTRY
{
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
if(!launcher) {
- AfxMessageBox("Cannot start up component launcher");
- CGMEEventLogger::LogGMEEvent(" Cannot start up component launcher.\r\n");
+ AfxMessageBox(_T("Cannot start up component launcher"));
+ CGMEEventLogger::LogGMEEvent(_T(" Cannot start up component launcher.\r\n"));
}
else {
CComPtr<IMgaFCO> focus;
@@ -7139,12 +7140,12 @@
if(theApp.bNoProtect) COMTHROW( launcher->put_Parameter(CComVariant(true)));
if(launcher->RunComponent(NULL, theApp.mgaProject, focus, selfcos, GME_MAIN_START) != S_OK) {
- AfxMessageBox("Component execution failed");
- CGMEEventLogger::LogGMEEvent(" Component execution failed.\r\n");
+ AfxMessageBox(_T("Component execution failed"));
+ CGMEEventLogger::LogGMEEvent(_T(" Component execution failed.\r\n"));
}
}
}
- MSGCATCH("Error while trying to run the interpreter",;)
+ MSGCATCH(_T("Error while trying to run the interpreter"),;)
}
void CGMEView::SetEditCursor(void)
@@ -7317,6 +7318,10 @@
fUnicodeForm = XMLString::transcode(toTranscode);
}
+ XStr(const wchar_t* const toTranscode)
+ {
+ XMLString::copyString(fUnicodeForm, toTranscode);
+ }
~XStr()
{
XMLString::release(&fUnicodeForm);
@@ -7376,7 +7381,7 @@
DOMElement* aspectElem = doc->createElement(X("aspect"));
aspectsElem->appendChild(aspectElem);
CString intValStr;
- intValStr.Format("%ld", asp->index);
+ intValStr.Format(_T("%ld"), asp->index);
aspectElem->setAttribute(X("index"), X(intValStr));
aspectElem->setAttribute(X("name"), X(asp->name));
@@ -7402,25 +7407,25 @@
CRect loc = obj->GetLocation();
DOMElement* locElem = doc->createElement(X("location"));
objElem->appendChild(locElem);
- intValStr.Format("%ld", loc.left);
+ intValStr.Format(_T("%ld"), loc.left);
locElem->setAttribute(X("left"), X(intValStr));
- intValStr.Format("%ld", loc.top);
+ intValStr.Format(_T("%ld"), loc.top);
locElem->setAttribute(X("top"), X(intValStr));
- intValStr.Format("%ld", loc.right);
+ intValStr.Format(_T("%ld"), loc.right);
locElem->setAttribute(X("right"), X(intValStr));
- intValStr.Format("%ld", loc.bottom);
+ intValStr.Format(_T("%ld"), loc.bottom);
locElem->setAttribute(X("bottom"), X(intValStr));
CRect nameLoc = obj->GetNameLocation();
DOMElement* nameLocElem = doc->createElement(X("namelocation"));
objElem->appendChild(nameLocElem);
- intValStr.Format("%ld", nameLoc.left);
+ intValStr.Format(_T("%ld"), nameLoc.left);
nameLocElem->setAttribute(X("left"), X(intValStr));
- intValStr.Format("%ld", nameLoc.top);
+ intValStr.Format(_T("%ld"), nameLoc.top);
nameLocElem->setAttribute(X("top"), X(intValStr));
- intValStr.Format("%ld", nameLoc.right);
+ intValStr.Format(_T("%ld"), nameLoc.right);
nameLocElem->setAttribute(X("right"), X(intValStr));
- intValStr.Format("%ld", nameLoc.bottom);
+ intValStr.Format(_T("%ld"), nameLoc.bottom);
nameLocElem->setAttribute(X("bottom"), X(intValStr));
}
CGuiConnection* conn = fco->dynamic_cast_CGuiConnection();
@@ -7441,9 +7446,9 @@
CPoint pt = points.GetNext(pos);
DOMElement* ptElem = doc->createElement(X("pt"));
pointsElem->appendChild(ptElem);
- intValStr.Format("%ld", pt.x);
+ intValStr.Format(_T("%ld"), pt.x);
ptElem->setAttribute(X("x"), X(intValStr));
- intValStr.Format("%ld", pt.y);
+ intValStr.Format(_T("%ld"), pt.y);
ptElem->setAttribute(X("y"), X(intValStr));
}
@@ -7464,11 +7469,11 @@
}
labelsElem->appendChild(labelElem);
CPoint pt = labelset.GetLocation(i);
- intValStr.Format("%ld", pt.x);
+ intValStr.Format(_T("%ld"), pt.x);
labelElem->setAttribute(X("x"), X(intValStr));
- intValStr.Format("%ld", pt.y);
+ intValStr.Format(_T("%ld"), pt.y);
labelElem->setAttribute(X("y"), X(intValStr));
- intValStr.Format("%ld", labelset.GetAlignment(i));
+ intValStr.Format(_T("%ld"), labelset.GetAlignment(i));
labelElem->setAttribute(X("alignment"), X(intValStr));
labelElem->setAttribute(X("label"), X(label));
}
@@ -7598,13 +7603,13 @@
void CGMEView::OnConncntxDelete()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnConncntxDelete in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnConncntxDelete in ")+path+name+_T("\r\n"));
if(isType) {
CGuiConnection* conn = NULL;
if (contextSelection)
conn = contextSelection->dynamic_cast_CGuiConnection();
if(!conn || !DeleteConnection(conn))
- AfxMessageBox("Connection cannot be deleted!");
+ AfxMessageBox(_T("Connection cannot be deleted!"));
contextSelection = 0;
contextPort = 0;
}
@@ -7617,7 +7622,7 @@
void CGMEView::OnShowContextMenu() // called from Accelerators like SHIFT+F10 or Property (VK_APPS)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnShowContextMenu in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnShowContextMenu in ")+path+name+_T("\r\n"));
CGMEDoc *doc = GetDocument();
if( doc && doc->GetEditMode() == GME_EDIT_MODE)
@@ -7670,7 +7675,7 @@
void CGMEView::OnJumpToFirstObject()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnJumpToFirstObject in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnJumpToFirstObject in ")+path+name+_T("\r\n"));
CGuiObject* first = FindFirstObject();
@@ -7682,7 +7687,7 @@
void CGMEView::OnJumpToNextObject()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnJumpToNextObject in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnJumpToNextObject in ")+path+name+_T("\r\n"));
CGuiObject* next = FindNextObject();
@@ -7694,7 +7699,7 @@
void CGMEView::OnConnCntxFollow() // 'Go to Dst' context command of a connection
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnConnCntxFollow in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnConnCntxFollow in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiConnection* conn = contextSelection->dynamic_cast_CGuiConnection();
FollowLine( conn, false, ::GetKeyState( VK_CONTROL) < 0);
@@ -7705,7 +7710,7 @@
void CGMEView::OnConnCntxRevfollow() // 'Go to Src' context command of a connection
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnConnCntxRevfollow in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnConnCntxRevfollow in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiConnection* conn = contextSelection->dynamic_cast_CGuiConnection();
FollowLine( conn, true, ::GetKeyState( VK_CONTROL) < 0);
@@ -7716,7 +7721,7 @@
void CGMEView::OnPortCntxFollowConnection() // 'Follow Connection' context command of a port
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnPortCntxFollowConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnPortCntxFollowConnection in ")+path+name+_T("\r\n"));
if( contextPort)
{
FollowLine( contextPort, false, ::GetKeyState( VK_CONTROL) < 0);
@@ -7727,7 +7732,7 @@
void CGMEView::OnPortCntxRevfollowConnection() // 'Follow Reverse Connection' context command of a port
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxRevfollowConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxRevfollowConnection in ")+path+name+_T("\r\n"));
if( contextPort)
{
FollowLine( contextPort, true, ::GetKeyState( VK_CONTROL) < 0);
@@ -7738,14 +7743,14 @@
void CGMEView::OnCntxFollowConnection() // 'Follow Connection' context command of an fco
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxFollowConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxFollowConnection in ")+path+name+_T("\r\n"));
if( selected.GetCount() > 0)
FollowLine( selected.GetHead(), false, ::GetKeyState( VK_CONTROL) < 0);
}
void CGMEView::OnCntxRevfollowConnection() // 'Follow Reverse Connection' context command of an fco
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxRevfollowConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxRevfollowConnection in ")+path+name+_T("\r\n"));
if( selected.GetCount() > 0)
FollowLine( selected.GetHead(), true, ::GetKeyState( VK_CONTROL) < 0);
}
@@ -7768,14 +7773,14 @@
void CGMEView::OnJumpAlongConnection() // 'Jump Along Conn' command on the Navigation toolbar
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnJumpAlongConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnJumpAlongConnection in ")+path+name+_T("\r\n"));
if( selected.GetCount() > 0)
FollowLine( selected.GetHead(), false, ::GetKeyState( VK_CONTROL) < 0);
}
void CGMEView::OnBackAlongConnection() // 'Jump back Along Conn' on Navigation toolbar
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnBackAlongConnection in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnBackAlongConnection in ")+path+name+_T("\r\n"));
if( selected.GetCount() > 0)
FollowLine( selected.GetHead(), true, ::GetKeyState( VK_CONTROL) < 0);
}
@@ -7788,7 +7793,7 @@
void CGMEView::OnDeleteConnEdgeCustomData()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDeleteConnEdgeCustomData in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDeleteConnEdgeCustomData in ")+path+name+_T("\r\n"));
if (selectedContextConnection != NULL && contextConnectionEdgeIndex >= 0) {
if (contextConnectionCustomizationType == SimpleEdgeDisplacement) {
if (contextConnectionPartMoveMethod == HorizontalEdgeMove ||
@@ -7822,7 +7827,7 @@
void CGMEView::OnDeleteConnRouteCustomDataThisAspect()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDeleteConnRouteCustomDataThisAspect in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDeleteConnRouteCustomDataThisAspect in ")+path+name+_T("\r\n"));
if (selectedContextConnection != NULL) {
selectedContextConnection->DeleteAllPathCustomizationsForCurrentAspect();
selectedContextConnection->WriteCustomPathData();
@@ -7832,7 +7837,7 @@
void CGMEView::OnDeleteConnRouteCustomDataAllAspects()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDeleteConnRouteCustomDataAllAspects in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDeleteConnRouteCustomDataAllAspects in ")+path+name+_T("\r\n"));
if (selectedContextConnection != NULL) {
selectedContextConnection->DeleteAllPathCustomizationsForAllAspects();
selectedContextConnection->WriteCustomPathData();
@@ -8060,7 +8065,7 @@
void CGMEView::OnCntxClear() // set refs to null, delete all members from set
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxClear in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxClear in ")+path+name+_T("\r\n"));
if (!isType)
return;
CGuiObject* obj = NULL;
@@ -8070,7 +8075,7 @@
obj = contextSelection->dynamic_cast_CGuiCompoundReference();
if (obj) {
try {
- CGMEEventLogger::LogGMEEvent(" "+obj->GetName()+" "+obj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+obj->GetName()+_T(" ")+obj->GetID()+_T("\r\n"));
BeginTransaction();
CComPtr<IMgaReference> mgaRef;
COMTHROW(obj->mgaFco.QueryInterface(&mgaRef));
@@ -8080,8 +8085,8 @@
}
catch(hresult_exception e) {
AbortTransaction(e.hr);
- const char* t1 = "Cannot clear reference because of active connections!";
- const char* t2 = "Cannot clear reference.";
+ const TCHAR* t1 = _T("Cannot clear reference because of active connections!");
+ const TCHAR* t2 = _T("Cannot clear reference.");
if( e.hr == E_MGA_REFPORTS_USED)
{
if( !CGMEConsole::theInstance) AfxMessageBox( t1);
@@ -8098,7 +8103,7 @@
set = contextSelection->dynamic_cast_CGuiSet();
if (set) {
try {
- CGMEEventLogger::LogGMEEvent(" "+set->GetName()+" "+set->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+set->GetName()+_T(" ")+set->GetID()+_T("\r\n"));
BeginTransaction();
CComPtr<IMgaSet> mgaSet;
COMTHROW(set->mgaFco.QueryInterface(&mgaSet));
@@ -8126,7 +8131,7 @@
void CGMEView::OnCntxReset() // revert to base i.e. reestablish dependency chain for refs and sets
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxReset in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxReset in ")+path+name+_T("\r\n"));
CGuiObject* obj = NULL;
if (contextSelection)
obj = contextSelection->dynamic_cast_CGuiReference();
@@ -8134,7 +8139,7 @@
obj = contextSelection->dynamic_cast_CGuiCompoundReference();
if (obj) {
try {
- CGMEEventLogger::LogGMEEvent(" "+obj->GetName()+" "+obj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+obj->GetName()+_T(" ")+obj->GetID()+_T("\r\n"));
BeginTransaction();
CComPtr<IMgaReference> mgaRef;
COMTHROW(obj->mgaFco.QueryInterface(&mgaRef));
@@ -8151,7 +8156,7 @@
set = contextSelection->dynamic_cast_CGuiSet();
if (set) {
try {
- CGMEEventLogger::LogGMEEvent(" "+set->GetName()+" "+set->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+set->GetName()+_T(" ")+set->GetID()+_T("\r\n"));
BeginTransaction();
CComPtr<IMgaSet> mgaSet;
COMTHROW(set->mgaFco.QueryInterface(&mgaSet));
@@ -8179,19 +8184,19 @@
void CGMEView::OnEditPreferences()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPreferences in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPreferences in ")+path+name+_T("\r\n"));
ShowPreferences();
}
void CGMEView::OnHelpHelp()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnHelpHelp in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnHelpHelp in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
POSITION pos = selected.GetHeadPosition();
if( pos) // if any object selected
{
CGuiObject *obj = selected.GetAt( pos);
- CGMEEventLogger::LogGMEEvent("CGMEView::OnHelpHelp for selected: "+obj->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnHelpHelp for selected: ")+obj->GetID()+_T("\r\n"));
fco = obj->mgaFco;
}
else
@@ -8202,11 +8207,11 @@
void CGMEView::OnCntxHelp()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxHelp in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxHelp in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
if (contextSelection)
{
- CGMEEventLogger::LogGMEEvent(" "+contextSelection->GetName()+" "+contextSelection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextSelection->GetName()+_T(" ")+contextSelection->GetID()+_T("\r\n"));
fco = contextSelection->mgaFco;
}
else
@@ -8222,7 +8227,7 @@
void CGMEView::OnEditShowtype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditShowtype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditShowtype in ")+path+name+_T("\r\n"));
contextSelection = 0; // just to be on the safe side
contextPort = 0;
CComPtr<IMgaModel> type;
@@ -8238,7 +8243,7 @@
void CGMEView::OnEditShowbasetype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnShowbasetype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnShowbasetype in ")+path+name+_T("\r\n"));
CComPtr<IMgaModel> type;
FindDerivedFrom(currentModel,type);
ShowModel(type);
@@ -8253,7 +8258,7 @@
void CGMEView::OnCntxShowtype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxShowtype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxShowtype in ")+path+name+_T("\r\n"));
CComPtr<IMgaModel> model;
GetModelInContext(model);
CComPtr<IMgaModel> type;
@@ -8272,7 +8277,7 @@
void CGMEView::OnCntxShowbasetype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxShowbasetype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxShowbasetype in ")+path+name+_T("\r\n"));
CComPtr<IMgaModel> model;
GetModelInContext(model);
CComPtr<IMgaModel> type;
@@ -8310,7 +8315,7 @@
void CGMEView::OnFileCheck()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnFileCheck in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnFileCheck in ")+path+name+_T("\r\n"));
ASSERT(theApp.mgaConstMgr);
if (!theApp.mgaConstMgr)
return;
@@ -8320,13 +8325,13 @@
theApp.mgaConstMgr->ObjectsInvokeEx(theApp.mgaProject, currentModel, NULL, NULL);
}
else
- AfxMessageBox("No context selection for CM.");
+ AfxMessageBox(_T("No context selection for CM."));
}
void CGMEView::OnFileCheckSelected()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnFileCheckSelected in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnFileCheckSelected in ")+path+name+_T("\r\n"));
ASSERT(theApp.mgaConstMgr);
if (!theApp.mgaConstMgr)
return;
@@ -8355,13 +8360,13 @@
#endif
}
else
- AfxMessageBox("No context selection for CM.");
+ AfxMessageBox(_T("No context selection for CM."));
}
void CGMEView::OnCntxCheck()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxCheck\r\n");
- CGMEEventLogger::LogGMEEvent(" Selected FCOs:");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxCheck\r\n"));
+ CGMEEventLogger::LogGMEEvent(_T(" Selected FCOs:"));
GMEEVENTLOG_GUIFCOS(selected);
ASSERT(theApp.mgaConstMgr);
@@ -8381,20 +8386,20 @@
}
theApp.mgaConstMgr->ObjectsInvokeEx(theApp.mgaProject, selfco, NULL, NULL);
}
- MSGCATCH("Error while trying to check the selected or current model",;)
+ MSGCATCH(_T("Error while trying to check the selected or current model"),;)
}
void CGMEView::OnCntxInterpret()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxInterpret in "+path+name+"\r\n");
- CGMEEventLogger::LogGMEEvent(" Selected FCOs:");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxInterpret in ")+path+name+_T("\r\n"));
+ CGMEEventLogger::LogGMEEvent(_T(" Selected FCOs:"));
GMEEVENTLOG_GUIFCOS(selected);
MSGTRY
{
CComObjPtr<IMgaLauncher> launcher;
COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
if(!launcher) {
- AfxMessageBox("Cannot start up component launcher");
+ AfxMessageBox(_T("Cannot start up component launcher"));
}
else {
CComPtr<IMgaFCO> focus;
@@ -8413,19 +8418,19 @@
if(theApp.bNoProtect) COMTHROW( launcher->put_Parameter(CComVariant(true)));
if(launcher->RunComponent(NULL, theApp.mgaProject, focus, selfcos, contextSelection ? GME_CONTEXT_START : GME_BGCONTEXT_START) != S_OK) {
- AfxMessageBox("Component execution failed");
+ AfxMessageBox(_T("Component execution failed"));
}
}
}
- MSGCATCH("Error while trying to run the interpreter",;)
+ MSGCATCH(_T("Error while trying to run the interpreter"),;)
}
void CGMEView::OnCntxLocate()
{
// ??
// position the Object Browser to the selected or current object
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxLocate\r\n");
- CGMEEventLogger::LogGMEEvent(" Selected FCO:");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxLocate\r\n"));
+ CGMEEventLogger::LogGMEEvent(_T(" Selected FCO:"));
GMEEVENTLOG_GUIFCOS(selected);
MSGTRY
@@ -8445,7 +8450,7 @@
CommitTransaction();
CGMEBrowser::theInstance->FocusItem(IDObj);
}
- MSGCATCH("Error while trying to check the selected or current model",;)
+ MSGCATCH(_T("Error while trying to check the selected or current model"),;)
}
void CGMEView::OnUpdateCntxCheck(CCmdUI* pCmdUI)
@@ -8465,11 +8470,11 @@
void CGMEView::OnCntxRegistry()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxRegistry in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxRegistry in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
if (contextSelection)
{
- CGMEEventLogger::LogGMEEvent(" "+contextSelection->GetName()+" "+contextSelection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextSelection->GetName()+_T(" ")+contextSelection->GetID()+_T("\r\n"));
fco = contextSelection->mgaFco;
}
else
@@ -8484,7 +8489,7 @@
void CGMEView::OnEditRegistry()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditRegistry in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditRegistry in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
COMTHROW(currentModel.QueryInterface(&fco));
ShowRegistryBrowser(fco);
@@ -8492,7 +8497,7 @@
void CGMEView::OnEditAnnotations()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditAnnotations in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditAnnotations in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
COMTHROW(currentModel.QueryInterface(&fco));
ShowAnnotationBrowser(fco, NULL);
@@ -8501,7 +8506,7 @@
void CGMEView::ShowRegistryBrowser(CComPtr<IMgaFCO> fco)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowRegistryBrowser in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowRegistryBrowser in ")+path+name+_T("\r\n"));
try {
BeginTransaction();
@@ -8512,14 +8517,14 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to access object registry",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent(" Unable to access object registry.\r\n");
+ AfxMessageBox(_T("Unable to access object registry"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to access object registry.\r\n"));
}
}
bool CGMEView::ShowAnnotationBrowser(CComPtr<IMgaFCO> fco, CComPtr<IMgaRegNode> focus)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ShowAnnotationBrowser in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ShowAnnotationBrowser in ")+path+name+_T("\r\n"));
bool success = true;
try {
BeginTransaction();
@@ -8529,7 +8534,7 @@
if (hr == E_MGA_MUST_ABORT) { // JIRA GME-236 special ret code, indicating that the dialog was cancelled
throw hresult_exception(S_OK);
} if (FAILED(hr)) {
- ASSERT(("COMTHROW: Throwing HRESULT exception. Press IGNORE", false));
+ ASSERT((_T("COMTHROW: Throwing HRESULT exception. Press IGNORE"), false));
throw hresult_exception(hr);
} else {
CommitTransaction();
@@ -8539,8 +8544,8 @@
success = false;
AbortTransaction(e.hr);
if (e.hr != S_OK) {
- AfxMessageBox("Unable to access annotations",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent(" Unable to access annotations.\r\n");
+ AfxMessageBox(_T("Unable to access annotations"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to access annotations.\r\n"));
}
}
return success;
@@ -8548,7 +8553,7 @@
void CGMEView::OnEditSync()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditSync in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditSync in ")+path+name+_T("\r\n"));
CAspectSyncDlg dlg;
POSITION apos = guiMeta->aspects.GetHeadPosition();
@@ -8614,14 +8619,14 @@
void CGMEView::SyncAspects(CGuiMetaAspect *srcAspect, CGuiMetaAspectList &dstAspects, CGuiObjectList &movingObjects, CGuiObjectList &sedentaryObjects, bool priorityForSrcVisible, bool priorityForSelected)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::SyncAspects in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SyncAspects in ")+path+name+_T("\r\n"));
if(srcAspect)
- CGMEEventLogger::LogGMEEvent(" srcAspect="+srcAspect->name+"\r\n");
- CGMEEventLogger::LogGMEEvent(" moving objects:");
+ CGMEEventLogger::LogGMEEvent(_T(" srcAspect=")+srcAspect->name+_T("\r\n"));
+ CGMEEventLogger::LogGMEEvent(_T(" moving objects:"));
GMEEVENTLOG_GUIOBJS(movingObjects);
- CGMEEventLogger::LogGMEEvent(" sedentary objects:");
+ CGMEEventLogger::LogGMEEvent(_T(" sedentary objects:"));
GMEEVENTLOG_GUIOBJS(sedentaryObjects);
- CGMEEventLogger::LogGMEEvent(" dstAspects:\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" dstAspects:\r\n"));
try {
BeginTransaction(TRANSACTION_GENERAL);
BeginWaitCursor();
@@ -8633,7 +8638,7 @@
CGuiMetaAspect *dstAspect = dstAspects.GetNext(apos);
if (dstAspect == srcAspect)
continue;
- CGMEEventLogger::LogGMEEvent(" "+dstAspect->name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+dstAspect->name+_T("\r\n"));
modelGrid.Clear();
@@ -8702,8 +8707,8 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- AfxMessageBox("Unable to synchronize aspects",MB_OK | MB_ICONSTOP);
- CGMEEventLogger::LogGMEEvent(" Unable to synchronize aspects.\r\n");
+ AfxMessageBox(_T("Unable to synchronize aspects"),MB_OK | MB_ICONSTOP);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to synchronize aspects.\r\n"));
EndWaitCursor();
return;
}
@@ -8717,7 +8722,7 @@
if (!modelGrid.IsAvailable(obj, aspectIndexFrom)) {//is enough space to occupy the pos taken from the aspFrom aspect?
if (!modelGrid.GetClosestAvailable(obj, center, aspectIndexTo)) { // if cannot get any position close to the position got above
- AfxMessageBox("Too Many Models! Internal Program Error!",MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Too Many Models! Internal Program Error!"),MB_OK | MB_ICONSTOP);
throw hresult_exception();
}
}
@@ -8728,7 +8733,7 @@
void CGMEView::OnEditSelectall()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditSelectall in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditSelectall in ")+path+name+_T("\r\n"));
if (IsInElementDecoratorOperation())
return;
this->SendUnselEvent4List( &selected);
@@ -8793,7 +8798,7 @@
void CGMEView::OnEditPastespecialAssubtype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialAssubtype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialAssubtype in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8804,7 +8809,7 @@
void CGMEView::OnEditPastespecialAsinstance()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialAsinstance in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialAsinstance in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8815,7 +8820,7 @@
void CGMEView::OnEditPastespecialAsreference()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialAsreference in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialAsreference in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8826,7 +8831,7 @@
void CGMEView::OnEditPastespecialAsclosure()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialAsclosure in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialAsclosure in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8837,7 +8842,7 @@
void CGMEView::OnEditPastespecialAdditive()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialAdditive in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialAdditive in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8848,7 +8853,7 @@
void CGMEView::OnEditPastespecialMerge()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnEditPastespecialMerge in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditPastespecialMerge in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8889,7 +8894,7 @@
void CGMEView::OnCntxPastespecialAsinstance()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialAsinstance in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialAsinstance in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8905,7 +8910,7 @@
void CGMEView::OnCntxPastespecialAsreference()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialAsreference in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialAsreference in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8921,7 +8926,7 @@
void CGMEView::OnCntxPastespecialAssubtype()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialAssubtype in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialAssubtype in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8938,7 +8943,7 @@
void CGMEView::OnCntxPastespecialAsclosure()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialAsclosure in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialAsclosure in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8955,7 +8960,7 @@
void CGMEView::OnCntxPastespecialAdditive()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialAdditive in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialAdditive in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8972,7 +8977,7 @@
void CGMEView::OnCntxPastespecialMerge()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxPastespecialMerge in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxPastespecialMerge in ")+path+name+_T("\r\n"));
if(isType) {
COleDataObject clipboardData;
clipboardData.AttachClipboard();
@@ -8989,7 +8994,7 @@
void CGMEView::OnCntxRedirectionpaste()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxRedirectionpaste in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxRedirectionpaste in ")+path+name+_T("\r\n"));
if(isType && contextSelection) {
CGuiObject* ref = contextSelection->dynamic_cast_CGuiReference();
if (!ref)
@@ -9021,7 +9026,7 @@
void CGMEView::OnCntxConnect()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxConnect in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxConnect in ")+path+name+_T("\r\n"));
if (contextSelection) {
CGuiObject* obj = contextSelection->dynamic_cast_CGuiObject();
if (obj) {
@@ -9273,7 +9278,7 @@
void CGMEView::OnCntxInsertannotation()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxInsertannotation in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxInsertannotation in ")+path+name+_T("\r\n"));
CComPtr<IMgaRegNode> rootReg;
try {
BeginTransaction();
@@ -9283,7 +9288,7 @@
while (!found) {
rootReg = NULL;
CString path;
- path.Format("%s/%s%d", AN_ROOT, AN_DEFANNOTATION_NAME, annID++);
+ path.Format(_T("%s/%s%d"), AN_ROOT, AN_DEFANNOTATION_NAME, annID++);
CComBSTR bstr(path);
COMTHROW(currentModel->get_RegistryNode(bstr, &rootReg));
long status;
@@ -9300,7 +9305,7 @@
CComBSTR aspName(AN_ASPECTS);
COMTHROW(rootReg->get_SubNodeByName(aspName, &aspRoot));
CString pos;
- pos.Format("%d,%d", contextMenuLocation.x, contextMenuLocation.y);
+ pos.Format(_T("%d,%d"), contextMenuLocation.x, contextMenuLocation.y);
CComBSTR posval(pos);
COMTHROW(aspRoot->put_Value(posval));
@@ -9323,8 +9328,8 @@
catch(hresult_exception &e) {
AbortTransaction(e.hr);
if (e.hr != S_OK) {
- AfxMessageBox("Unable to insert annotation",MB_ICONSTOP | MB_OK);
- CGMEEventLogger::LogGMEEvent(" Unable to insert annotation.\r\n");
+ AfxMessageBox(_T("Unable to insert annotation"),MB_ICONSTOP | MB_OK);
+ CGMEEventLogger::LogGMEEvent(_T(" Unable to insert annotation.\r\n"));
return;
}
}
@@ -9333,7 +9338,7 @@
void CGMEView::OnCntxAnnotations()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxAnnotations in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxAnnotations in ")+path+name+_T("\r\n"));
CComPtr<IMgaFCO> fco;
currentModel.QueryInterface(&fco);
ShowAnnotationBrowser(fco, contextAnnotation ? contextAnnotation->rootNode : NULL);
@@ -9353,18 +9358,18 @@
CommitTransaction();
CString strPref( bstrPref );
switch ( pCmdUI->m_nID ) {
- case ID_CNTX_SRCAR_NORTH : pCmdUI->SetCheck( ( strPref.Find( "N" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_SRCAR_SOUTH : pCmdUI->SetCheck( ( strPref.Find( "S" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_SRCAR_WEST : pCmdUI->SetCheck( ( strPref.Find( "W" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_SRCAR_EAST : pCmdUI->SetCheck( ( strPref.Find( "E" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_DSTAR_NORTH : pCmdUI->SetCheck( ( strPref.Find( "n" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_DSTAR_SOUTH : pCmdUI->SetCheck( ( strPref.Find( "s" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_DSTAR_WEST : pCmdUI->SetCheck( ( strPref.Find( "w" ) != -1 ) ? 1 : 0 ); return;
- case ID_CNTX_DSTAR_EAST : pCmdUI->SetCheck( ( strPref.Find( "e" ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_SRCAR_NORTH : pCmdUI->SetCheck( ( strPref.Find( _T("N") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_SRCAR_SOUTH : pCmdUI->SetCheck( ( strPref.Find( _T("S") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_SRCAR_WEST : pCmdUI->SetCheck( ( strPref.Find( _T("W") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_SRCAR_EAST : pCmdUI->SetCheck( ( strPref.Find( _T("E") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_DSTAR_NORTH : pCmdUI->SetCheck( ( strPref.Find( _T("n") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_DSTAR_SOUTH : pCmdUI->SetCheck( ( strPref.Find( _T("s") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_DSTAR_WEST : pCmdUI->SetCheck( ( strPref.Find( _T("w") ) != -1 ) ? 1 : 0 ); return;
+ case ID_CNTX_DSTAR_EAST : pCmdUI->SetCheck( ( strPref.Find( _T("e") ) != -1 ) ? 1 : 0 ); return;
}
int iCnt = 0;
bool bSet = pCmdUI->m_nID == ID_CNTX_SRCAR_SET || pCmdUI->m_nID == ID_CNTX_DSTAR_SET;
- CString str = ( pCmdUI->m_nID == ID_CNTX_SRCAR_SET || pCmdUI->m_nID == ID_CNTX_SRCAR_CLEAR ) ? "NEWS" : "news";
+ CString str = ( pCmdUI->m_nID == ID_CNTX_SRCAR_SET || pCmdUI->m_nID == ID_CNTX_SRCAR_CLEAR ) ? _T("NEWS") : _T("news");
for ( int i = 0 ; i < 4 ; i++ )
if ( strPref.Find( str.Mid( i, 1 ) ) != -1 ) iCnt++;
if ( iCnt == 4 && bSet || iCnt == 0 && ! bSet )
@@ -9375,81 +9380,81 @@
void CGMEView::OnCntxSrcarSouth()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarSouth in "+path+name+"\r\n");
- SwapAutoRouterPref( "S" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarSouth in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("S") );
}
void CGMEView::OnCntxSrcarNorth()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarNorth in "+path+name+"\r\n");
- SwapAutoRouterPref( "N" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarNorth in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("N") );
}
void CGMEView::OnCntxSrcarEast()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarEast in "+path+name+"\r\n");
- SwapAutoRouterPref( "E" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarEast in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("E") );
}
void CGMEView::OnCntxSrcarWest()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarWest in "+path+name+"\r\n");
- SwapAutoRouterPref( "W" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarWest in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("W") );
}
void CGMEView::OnCntxDstarEast()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarEast in "+path+name+"\r\n");
- SwapAutoRouterPref( "e" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarEast in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("e") );
}
void CGMEView::OnCntxDstarNorth()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarNorth in "+path+name+"\r\n");
- SwapAutoRouterPref( "n" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarNorth in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("n") );
}
void CGMEView::OnCntxDstarSouth()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarSouth in "+path+name+"\r\n");
- SwapAutoRouterPref( "s" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarSouth in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("s") );
}
void CGMEView::OnCntxDstarWest()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarWest in "+path+name+"\r\n");
- SwapAutoRouterPref( "w" );
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarWest in ")+path+name+_T("\r\n"));
+ SwapAutoRouterPref( _T("w") );
}
void CGMEView::OnCntxDstarClear()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarClear in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarClear in ")+path+name+_T("\r\n"));
SetAllAutoRouterPref( false, true );
}
void CGMEView::OnCntxSrcarClear()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarClear in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarClear in ")+path+name+_T("\r\n"));
SetAllAutoRouterPref( true, true );
}
void CGMEView::OnCntxDstarSet()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxDstarSet in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxDstarSet in ")+path+name+_T("\r\n"));
SetAllAutoRouterPref( false, false );
}
void CGMEView::OnCntxSrcarSet()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnCntxSrcarSet in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnCntxSrcarSet in ")+path+name+_T("\r\n"));
SetAllAutoRouterPref( true, false );
}
void CGMEView::SwapAutoRouterPref( const CString& strP )
{
- CGMEEventLogger::LogGMEEvent("CGMEView::SwapAutoRouterPref in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SwapAutoRouterPref in ")+path+name+_T("\r\n"));
if( contextSelection ) {
- CGMEEventLogger::LogGMEEvent(" "+contextSelection->GetName()+" "+contextSelection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextSelection->GetName()+_T(" ")+contextSelection->GetID()+_T("\r\n"));
CComPtr<IMgaFCO> spFCO = contextSelection->mgaFco;
if ( spFCO ) {
BeginTransaction(TRANSACTION_GENERAL);
@@ -9458,12 +9463,12 @@
CString strPref( bstrPref );
int iPos = strPref.Find( strP );
if ( iPos == -1 )
- if ( strP == "n" || strP == "s" || strP == "w" || strP == "e" )
+ if ( strP == _T("n") || strP == _T("s") || strP == _T("w") || strP == _T("e") )
strPref = strP + strPref;
else
strPref += strP;
else
- strPref.Replace( strP, "" );
+ strPref.Replace( strP, _T("") );
COMTHROW( spFCO->put_RegistryValue( CComBSTR( AUTOROUTER_PREF ), CComBSTR( strPref ) ) );
CommitTransaction();
}
@@ -9472,19 +9477,19 @@
void CGMEView::SetAllAutoRouterPref( bool bSrc, bool bClear )
{
- CGMEEventLogger::LogGMEEvent("CGMEView::SetAllAutoRouterPref in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SetAllAutoRouterPref in ")+path+name+_T("\r\n"));
if( contextSelection ) {
- CGMEEventLogger::LogGMEEvent(" "+contextSelection->GetName()+" "+contextSelection->GetID()+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T(" ")+contextSelection->GetName()+_T(" ")+contextSelection->GetID()+_T("\r\n"));
CComPtr<IMgaFCO> spFCO = contextSelection->mgaFco;
if ( spFCO ) {
BeginTransaction(TRANSACTION_GENERAL);
CComBSTR bstrPref;
COMTHROW( spFCO->get_RegistryValue( CComBSTR( AUTOROUTER_PREF ), &bstrPref ) );
CString strPref( bstrPref );
- CString src = "NEWS";
- CString dst = "news";
+ CString src = _T("NEWS");
+ CString dst = _T("news");
for ( int i = 0 ; i < 4 ; i++ )
- strPref.Replace( ( bSrc ) ? src.Mid( i, 1 ) : dst.Mid( i, 1 ), "" );
+ strPref.Replace( ( bSrc ) ? src.Mid( i, 1 ) : dst.Mid( i, 1 ), _T("") );
if ( ! bClear )
if ( bSrc )
strPref = src + strPref;
@@ -9498,10 +9503,10 @@
void CGMEView::OnPrintMetafile()
{
- CString filePath = ""; // "c:\\tmp\\meta.emf";
+ CString filePath = _T(""); // "c:\\tmp\\meta.emf";
// call FileOpenDialog
- CFileDialog filedlg(FALSE, "emf", NULL, OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY,
- "Enhanced Metafile Files (*.emf)|*.emf|All Files (*.*)|*.*||");
+ CFileDialog filedlg(FALSE, _T("emf"), NULL, OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY,
+ _T("Enhanced Metafile Files (*.emf)|*.emf|All Files (*.*)|*.*||"));
if (filedlg.DoModal() != IDOK)
return;
filePath = filedlg.GetPathName();
@@ -9510,7 +9515,7 @@
BOOL ret = cDC.CreateEnhanced(pDC,filePath,NULL,_T("GME Model"));
ReleaseDC(pDC);
if (ret == FALSE) {
- AfxMessageBox("Unable to create metafile.", MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Unable to create metafile."), MB_OK | MB_ICONSTOP);
return;
}
@@ -9631,7 +9636,7 @@
LRESULT CGMEView::OnZoom(WPARAM, LPARAM lParam)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnZoom() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnZoom() in ")+path+name+_T("\r\n"));
// BOOL userdef = (BOOL)wParam;
int zoom = (int)lParam;
@@ -9718,7 +9723,7 @@
LRESULT CGMEView::OnPannScroll(WPARAM wParam, LPARAM lParam)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnPannScroll() in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnPannScroll() in ")+path+name+_T("\r\n"));
int relx = (DWORD)wParam;
int rely = (DWORD)lParam;
CPoint current = GetScrollPosition(); // upper corner of scrolling
@@ -9731,7 +9736,7 @@
LRESULT CGMEView::OnDecoratorViewRefreshRequest(WPARAM wParam, LPARAM lParam)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnDecoratorViewRefreshRequest() in " + path + name + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnDecoratorViewRefreshRequest() in ") + path + name + _T("\r\n"));
refresh_mode_enum refreshMode = (refresh_mode_enum) lParam;
switch(refreshMode) {
case RM_REGENERATE_PARENT_ALSO:
@@ -9756,7 +9761,7 @@
LRESULT CGMEView::OnExecutePendingRequests(WPARAM wParam, LPARAM lParam)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnExecutePendingRequests() in " + path + name + "\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnExecutePendingRequests() in ") + path + name + _T("\r\n"));
executingPendingRequests = true;
try {
@@ -9815,7 +9820,7 @@
void CGMEView::UpdateNamePositionMenuItem( CCmdUI* pCmdUI, int p_this_value)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::UpdateNamePositionMenuItem\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::UpdateNamePositionMenuItem\r\n"));
ASSERT(p_this_value == 0 || p_this_value == 2 || p_this_value == 4 || p_this_value == 6);
@@ -9852,7 +9857,7 @@
catch(hresult_exception &e) {
all_equal = false;
AbortTransaction(e.hr);
- CGMEEventLogger::LogGMEEvent("CGMEView::UpdateNamePositionMenuItem - Unable to get NamePosition preference value.\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::UpdateNamePositionMenuItem - Unable to get NamePosition preference value.\r\n"));
}
// set the radiobutton like icon on/off based on the all_equal
@@ -9861,7 +9866,7 @@
void CGMEView::ChangeNamePosition( int p_val)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::ChangeNamePosition\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ChangeNamePosition\r\n"));
try {
BeginTransaction();
@@ -9876,7 +9881,7 @@
}
catch(hresult_exception &e) {
AbortTransaction(e.hr);
- CGMEEventLogger::LogGMEEvent("CGMEView::ChangeNamePosition - Unable to change NamePosition preference value.\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::ChangeNamePosition - Unable to change NamePosition preference value.\r\n"));
}
}
@@ -9885,14 +9890,14 @@
//
void CGMEView::SetNamePositionVal(CComPtr<IMgaFCO>& p_ccpMgaFCO, int val)
{
- CGMEEventLogger::LogGMEEvent("CGMEView::SetNamePositionVal\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::SetNamePositionVal\r\n"));
ASSERT( p_ccpMgaFCO);
if( !p_ccpMgaFCO) return;
- static const CComBSTR bstrRegPath("namePosition");
+ static const CComBSTR bstrRegPath(L"namePosition");
CString valString;
- valString.Format("%d", val);
+ valString.Format(_T("%d"), val);
CComBSTR bstrValue( valString);
// For a specific object we modify the registry value
@@ -9905,7 +9910,7 @@
ASSERT( p_valRet);
if( !p_ccpMgaFCO) return false;
- static const CComBSTR bstrRegPath("namePosition");
+ static const CComBSTR bstrRegPath(L"namePosition");
CString strRegValue;
// Getting regnode
@@ -9958,13 +9963,13 @@
}
else if(lRegNodeStatus==-2) // ATTRSTATUS_INVALID - It does happen.
{
- strRegValue="";
+ strRegValue=_T("");
}
else
{
ASSERT(("Undocumented(and undesired) MGA feature",false));
- CGMEEventLogger::LogGMEEvent("CGMEView::GetNamePositionVal: Undocumented(and undesired) MGA feature\r\n");
- strRegValue="";
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::GetNamePositionVal: Undocumented(and undesired) MGA feature\r\n"));
+ strRegValue=_T("");
}
int val = -1;
@@ -10000,10 +10005,10 @@
{
CComBSTR nm;
COMTHROW( mgaFco->get_Name( &nm));
- CString msg = "There are objects primary derived from: \"";
+ CString msg = _T("There are objects primary derived from: \"");
msg += nm;
- msg += "\". Would you like to delete them as well?\n";
- msg += "If you answer 'No' the derived objects will be detached, thus preserved.";
+ msg += _T("\". Would you like to delete them as well?\n");
+ msg += _T("If you answer 'No' the derived objects will be detached, thus preserved.");
// this answer will be applied to all deriveds of this fco
int resp = AfxMessageBox( msg, MB_YESNOCANCEL);
@@ -10098,7 +10103,7 @@
if( special_case_id_of_next_fco.Length() > 0)
{
- CGMEConsole::theInstance->Message( "Reference target is child of a folder, thus it is shown in the TreeBrowser only.", MSG_INFO);
+ CGMEConsole::theInstance->Message( _T("Reference target is child of a folder, thus it is shown in the TreeBrowser only."), MSG_INFO);
CGMEBrowser::theInstance->FocusItem( special_case_id_of_next_fco);
}
else if( next_fco && next_mod) ShowModel( next_mod);
@@ -10159,7 +10164,7 @@
void CGMEView::OnKeyConnect()
{
- CGMEEventLogger::LogGMEEvent("CGMEView::OnKeyConnect in "+path+name+"\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnKeyConnect in ")+path+name+_T("\r\n"));
if( lastObject) {
CGuiObject *obj = lastObject;
if(obj) {
Modified: trunk/GME/Gme/GUIObject.cpp
==============================================================================
--- trunk/GME/Gme/GUIObject.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GUIObject.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -248,14 +248,14 @@
{
CString val;
if (GetPreference(val, AUTOROUTER_PREF)) {
- autorouterPrefs[GME_START_NORTH] = (val.Find("N") != -1);
- autorouterPrefs[GME_START_EAST] = (val.Find("E") != -1);
- autorouterPrefs[GME_START_SOUTH] = (val.Find("S") != -1);
- autorouterPrefs[GME_START_WEST] = (val.Find("W") != -1);
- autorouterPrefs[GME_END_NORTH] = (val.Find("n") != -1);
- autorouterPrefs[GME_END_EAST] = (val.Find("e") != -1);
- autorouterPrefs[GME_END_SOUTH] = (val.Find("s") != -1);
- autorouterPrefs[GME_END_WEST] = (val.Find("w") != -1);
+ autorouterPrefs[GME_START_NORTH] = (val.Find(_T("N")) != -1);
+ autorouterPrefs[GME_START_EAST] = (val.Find(_T("E")) != -1);
+ autorouterPrefs[GME_START_SOUTH] = (val.Find(_T("S")) != -1);
+ autorouterPrefs[GME_START_WEST] = (val.Find(_T("W")) != -1);
+ autorouterPrefs[GME_END_NORTH] = (val.Find(_T("n")) != -1);
+ autorouterPrefs[GME_END_EAST] = (val.Find(_T("e")) != -1);
+ autorouterPrefs[GME_END_SOUTH] = (val.Find(_T("s")) != -1);
+ autorouterPrefs[GME_END_WEST] = (val.Find(_T("w")) != -1);
}
else {
if (parent->GetParent()->dynamic_cast_CGuiCompound() != NULL) {
@@ -315,7 +315,7 @@
VERIFY(parent);
VERIFY(parent->parent);
CComPtr<IMgaFCO> fco = parent->parent->mgaFco;
- CComBSTR bstr = "GME/ports";
+ CComBSTR bstr = L"GME/ports";
CComPtr<IMgaRegNode> root;
COMTHROW(fco->get_RegistryNode(bstr,&root));
CComPtr<IMgaRegNodes> nodes;
@@ -331,7 +331,7 @@
COMTHROW(reg->get_FCOValue(&portFco));
if(IsEqualObject(portFco,mgaFco)) {
CComPtr<IMgaRegNode> subreg;
- CComBSTR path = "visible";
+ CComBSTR path = L"visible";
COMTHROW(reg->get_SubNodeByName(path,&subreg));
if(subreg != 0) {
CComBSTR val;
@@ -355,16 +355,16 @@
VERIFY(parent->parent);
CComPtr<IMgaFCO> fco = parent->parent->mgaFco;
CComBSTR id;
- CComBSTR bstr = "GME/ports/";
+ CComBSTR bstr = L"GME/ports/";
COMTHROW(mgaFco->get_ID(&id));
bstr += id;
CComPtr<IMgaRegNode> reg;
COMTHROW(fco->get_RegistryNode(bstr,®));
COMTHROW(reg->put_FCOValue(mgaFco));
- CComBSTR path = "visible";
+ CComBSTR path = L"visible";
CComPtr<IMgaRegNode> subreg;
COMTHROW(reg->get_SubNodeByName(path,&subreg));
- CComBSTR bstrval = v ? "1" : "0";
+ CComBSTR bstrval = v ? L"1" : L"0";
COMTHROW(subreg->put_Value(bstrval));
}
@@ -455,7 +455,7 @@
if( st > ATTSTATUS_HERE)
special = true;
- id = view->name + ":" + name; // Fake id
+ id = view->name + _T(":") + name; // Fake id
CComPtr<IMgaRegNode> aspRootNode;
CComBSTR aspRootName(AN_ASPECTS);
@@ -565,7 +565,7 @@
decoratorData[asp]->location.right, decoratorData[asp]->location.bottom));
}
catch (hresult_exception &) {
- AfxMessageBox("Cannot initialize annotator for annotation: " + name, MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Cannot initialize annotator for annotation: ") + name, MB_OK | MB_ICONSTOP);
decoratorData[asp]->decorator = NULL;
}
}
@@ -587,7 +587,7 @@
return ((fc & F_RESIZABLE) != 0);
}
catch (hresult_exception &) {
- AfxMessageBox("Error in annotator [method IsResizable()]");
+ AfxMessageBox(_T("Error in annotator [method IsResizable()]"));
}
}
@@ -602,7 +602,7 @@
COMTHROW(decoratorData[parentAspect]->decorator->DrawEx((ULONG)pDC, (ULONGLONG)gdip));
}
catch (hresult_exception &) {
- AfxMessageBox("Error in annotator [method Draw()]");
+ AfxMessageBox(_T("Error in annotator [method Draw()]"));
}
}
}
@@ -650,7 +650,7 @@
COMTHROW(decoratorData[aspect]->decorator->SetLocation(loc.left, loc.top, loc.right, loc.bottom));
}
catch (hresult_exception &) {
- AfxMessageBox("Cannot set location of annotation " + name);
+ AfxMessageBox(_T("Cannot set location of annotation ") + name);
}
if (doMga) {
@@ -738,7 +738,7 @@
void CGuiAnnotator::NudgeAnnotations(CGuiAnnotatorList& annotatorList, int right, int down)
{
- CGMEEventLogger::LogGMEEvent("CGuiAnnotator::NudgeAnnotations ");
+ CGMEEventLogger::LogGMEEvent(_T("CGuiAnnotator::NudgeAnnotations "));
GMEEVENTLOG_GUIANNOTATORS(annotatorList);
ASSERT(right == 0 || down == 0); // cannot nudge diagonally for now
POSITION pos = annotatorList.GetHeadPosition();
@@ -807,7 +807,7 @@
void CGuiAnnotator::ShiftAnnotations(CGuiAnnotatorList& annList, CPoint& shiftBy)
{
- CGMEEventLogger::LogGMEEvent("CGuiAnnotator::ShiftAnnotations ");
+ CGMEEventLogger::LogGMEEvent(_T("CGuiAnnotator::ShiftAnnotations "));
GMEEVENTLOG_GUIANNOTATORS(annList);
POSITION pos = annList.GetHeadPosition();
while(pos) {
@@ -828,7 +828,7 @@
// thus we made the value of the annotator defined 'HERE'
// which will decide whether an annotation regnode is virtual (inherited) or not
- CComBSTR bstr("1");
+ CComBSTR bstr(L"1");
// inheritance broken node inserted
CComPtr<IMgaRegNode> brokNode;
@@ -872,7 +872,7 @@
{
CComBSTR bstr;
COMTHROW( hideNode->get_Value( &bstr));
- if( bstr == "1")
+ if( bstr == L"1")
hidden_set = true;
}
}
@@ -888,7 +888,7 @@
if (inheritNode) {
CComBSTR bstr;
COMTHROW(inheritNode->get_Value( &bstr));
- if (bstr == "1") // if "inheritable" is 1 show it
+ if (bstr == L"1") // if "inheritable" is 1 show it
return true;
}
}
@@ -1225,7 +1225,7 @@
CStringList values;
if (!decorStr.IsEmpty()) { // no decorator progId and no paarmeters => use default box decorator later
- if (decorStr.FindOneOf("\n\t ,=") == -1) { // just a progId, no parameters
+ if (decorStr.FindOneOf(_T("\n\t ,=")) == -1) { // just a progId, no parameters
progId = decorStr;
} else { // there is some parameter
LPTSTR lpsz = new TCHAR[decorStr.GetLength()+1];
@@ -1304,7 +1304,7 @@
hres = decor.CoCreateInstance(PutInBstr(progId));
}
if (FAILED(hres)) { // fall back to default decorator
- CMainFrame::theInstance->m_console.Message("Cannot create " + progId + " decorator! Trying default (" + GME_DEFAULT_DECORATOR + ") decorator.", 3);
+ CMainFrame::theInstance->m_console.Message(_T("Cannot create ") + progId + _T(" decorator! Trying default (") + GME_DEFAULT_DECORATOR + _T(") decorator."), 3);
progId = GME_DEFAULT_DECORATOR;
COMTHROW(newDecor.CoCreateInstance(PutInBstr(progId)));
}
@@ -1334,7 +1334,7 @@
COMTHROW(decor->Initialize(theApp.mgaProject, metaPart, mgaFco));
}
catch (hresult_exception&) {
- CMainFrame::theInstance->m_console.Message("Cannot create " + progId + " decorator.", 3);
+ CMainFrame::theInstance->m_console.Message(_T("Cannot create ") + progId + _T(" decorator."), 3);
}
guiAspects[asp] = new CGuiAspect(metaAspect, this, metaAspect->index, asp, decor, newDecor, decoratorEventSink);
parentAspect = 0;
@@ -1765,7 +1765,7 @@
void CGuiObject::ShiftModels(CGuiObjectList& objList, CPoint& shiftBy)
{
- CGMEEventLogger::LogGMEEvent("CGuiObject::ShiftModels ");
+ CGMEEventLogger::LogGMEEvent(_T("CGuiObject::ShiftModels "));
GMEEVENTLOG_GUIOBJS(objList);
CGuiObject* first_obj = objList.IsEmpty() ? 0 : objList.GetHead();
@@ -1793,7 +1793,7 @@
VERIFY(obj->IsVisible());
CPoint point = obj->GetCenter() + shiftBy;
if(!modelGrid.GetClosestAvailable(obj, point)) {
- AfxMessageBox("Too Many Models! Internal Program Error!",MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Too Many Models! Internal Program Error!"),MB_OK | MB_ICONSTOP);
return;
}
obj->SetCenter(point);
@@ -1803,7 +1803,7 @@
void CGuiObject::ResizeObject(const CRect& newLocation/*, bool doMga*/)
{
- CGMEEventLogger::LogGMEEvent("CGuiObject::ResizeObject\n");
+ CGMEEventLogger::LogGMEEvent(_T("CGuiObject::ResizeObject\n"));
VERIFY(IsVisible());
SetLocation((CRect)newLocation, -1, false/*doMga, true*/);
@@ -1813,7 +1813,7 @@
bool CGuiObject::NudgeObjects(CGuiObjectList& modelList, int right, int down)
{
- CGMEEventLogger::LogGMEEvent("CGuiObject::NudgeObjects ");
+ CGMEEventLogger::LogGMEEvent(_T("CGuiObject::NudgeObjects "));
GMEEVENTLOG_GUIOBJS(modelList);
ASSERT(right == 0 || down == 0); // cannot nudge diagonally for now
@@ -1892,7 +1892,7 @@
return ((fc & F_RESIZABLE) != 0);
}
catch (hresult_exception &) {
- AfxMessageBox("Error in CGuiObject [method IsResizable()]");
+ AfxMessageBox(_T("Error in CGuiObject [method IsResizable()]"));
}
return false;
@@ -1915,7 +1915,7 @@
COMTHROW(GetCurrentAspect()->GetDecorator()->Draw((ULONG)pDC));
}
catch (hresult_exception &) {
- AfxMessageBox("Error in decorator [method Draw()]");
+ AfxMessageBox(_T("Error in decorator [method Draw()]"));
}
// #define _ARDEBUG
@@ -2025,8 +2025,8 @@
COMTHROW(metaRole->get_Name(&bstr));
CString roleName;
CopyTo(bstr,roleName);
- AfxMessageBox("Missing aspect mapping specification for model " + name + " aspect " + kindAspect +
- " role " + roleName + "!\nFirst aspect " + metaAspect->name + " is used!");
+ AfxMessageBox(_T("Missing aspect mapping specification for model ") + name + _T(" aspect ") + kindAspect +
+ _T(" role ") + roleName + _T("!\nFirst aspect ") + metaAspect->name + _T(" is used!"));
*/
}
}
@@ -2065,9 +2065,9 @@
{
CString txt;
if(IsNull())
- txt = name + " -> null ";
+ txt = name + _T(" -> null ");
else
- txt.Format("%s -> %s (%s) ", name, targetName, targetKindDisplayedName);
+ txt.Format(_T("%s -> %s (%s) "), name, targetName, targetKindDisplayedName);
return CString(txt);
}
///////////////////////////////////////
@@ -2137,8 +2137,8 @@
COMTHROW(metaRole->get_Name(&bstr));
CString roleName;
CopyTo(bstr,roleName);
- AfxMessageBox("Missing aspect mapping specification for model " + name + " aspect " + kindAspect +
- " role " + roleName + "!\nFirst aspect " + metaAspect->name + " is used!");
+ AfxMessageBox(_T("Missing aspect mapping specification for model ") + name + _T(" aspect ") + kindAspect +
+ _T(" role ") + roleName + _T("!\nFirst aspect ") + metaAspect->name + _T(" is used!"));
*/
}
}
@@ -2184,7 +2184,7 @@
metaref_type mr = fco->GetRoleMetaRef();
CString path;
- path.Format("%d", mr);
+ path.Format(_T("%d"), mr);
CComBSTR bstr;
CopyTo(path, bstr);
@@ -2320,18 +2320,18 @@
if (label.IsEmpty())
return;
- label.Replace("%name%", conn->name);
- label.Replace("%kind%", conn->kindDisplayedName);
- label.Replace("%role%", conn->roleDisplayedName);
+ label.Replace(_T("%name%"), conn->name);
+ label.Replace(_T("%kind%"), conn->kindDisplayedName);
+ label.Replace(_T("%role%"), conn->roleDisplayedName);
CGuiMetaAttributeList *metaAttrs = conn->GetMetaAttributes();
POSITION pos = metaAttrs->GetHeadPosition();
while (pos) {
CGuiMetaAttribute *metaAttr = metaAttrs->GetNext(pos);
CString attrName;
- attrName += "%";
+ attrName += _T("%");
attrName += metaAttr->name;
- attrName += "%";
+ attrName += _T("%");
label.Replace(attrName, conn->attributeCache[metaAttr->name]);
}
@@ -2441,28 +2441,28 @@
{
CString pref;
GetPreference(pref, CONN_LINE_TYPE_PREF);
- lineType = (pref == "dash") ? GME_LINE_DASH : GME_LINE_SOLID;
+ lineType = (pref == _T("dash")) ? GME_LINE_DASH : GME_LINE_SOLID;
}
{
CString pref;
GetPreference(pref, CONN_SRC_END_STYLE_PREF);
- if ( pref == "arrow" )
+ if ( pref == _T("arrow") )
srcStyle = GME_ARROW_END;
- else if ( pref == "diamond" )
+ else if ( pref == _T("diamond") )
srcStyle = GME_DIAMOND_END;
- else if ( pref == "empty diamond" )
+ else if ( pref == _T("empty diamond") )
srcStyle = GME_EMPTYDIAMOND_END;
- else if ( pref == "apex" )
+ else if ( pref == _T("apex") )
srcStyle = GME_APEX_END;
- else if ( pref == "empty apex" )
+ else if ( pref == _T("empty apex") )
srcStyle = GME_EMPTYAPEX_END;
- else if ( pref == "bullet" )
+ else if ( pref == _T("bullet") )
srcStyle = GME_BULLET_END;
- else if ( pref == "empty bullet" )
+ else if ( pref == _T("empty bullet") )
srcStyle = GME_EMPTYBULLET_END;
- else if ( pref == "left half arrow" )
+ else if ( pref == _T("left half arrow") )
srcStyle = GME_HALFARROWLEFT_END;
- else if ( pref == "right half arrow" )
+ else if ( pref == _T("right half arrow") )
srcStyle = GME_HALFARROWRIGHT_END;
else
srcStyle = GME_BUTT_END;
@@ -2470,23 +2470,23 @@
{
CString pref;
GetPreference(pref, CONN_DST_END_STYLE_PREF);
- if ( pref == "arrow" )
+ if ( pref == _T("arrow") )
dstStyle = GME_ARROW_END;
- else if ( pref == "diamond" )
+ else if ( pref == _T("diamond") )
dstStyle = GME_DIAMOND_END;
- else if ( pref == "empty diamond" )
+ else if ( pref == _T("empty diamond") )
dstStyle = GME_EMPTYDIAMOND_END;
- else if ( pref == "apex" )
+ else if ( pref == _T("apex") )
dstStyle = GME_APEX_END;
- else if ( pref == "empty apex" )
+ else if ( pref == _T("empty apex") )
dstStyle = GME_EMPTYAPEX_END;
- else if ( pref == "bullet" )
+ else if ( pref == _T("bullet") )
dstStyle = GME_BULLET_END;
- else if ( pref == "empty bullet" )
+ else if ( pref == _T("empty bullet") )
dstStyle = GME_EMPTYBULLET_END;
- else if ( pref == "left half arrow" )
+ else if ( pref == _T("left half arrow") )
dstStyle = GME_HALFARROWLEFT_END;
- else if ( pref == "right half arrow" )
+ else if ( pref == _T("right half arrow") )
dstStyle = GME_HALFARROWRIGHT_END;
else
dstStyle = GME_BUTT_END;
@@ -2524,26 +2524,26 @@
{
if (!view->ShouldSupressConnectionCheckAlert()) {
CString msgEx;
- msgEx.Append("Connection properties:\n");
- msgEx.Append("\nName: ");
+ msgEx.Append(_T("Connection properties:\n"));
+ msgEx.Append(_T("\nName: "));
msgEx.Append(name);
- msgEx.Append("\nKind Name: ");
+ msgEx.Append(_T("\nKind Name: "));
msgEx.Append(kindDisplayedName);
- msgEx.Append("\nRole Name: ");
+ msgEx.Append(_T("\nRole Name: "));
msgEx.Append(roleDisplayedName);
- msgEx.Append("\nID: ");
+ msgEx.Append(_T("\nID: "));
msgEx.Append(id);
- msgEx.Append("\nEndpoint properties:");
+ msgEx.Append(_T("\nEndpoint properties:"));
if (otherPort) {
- msgEx.Append("\n\tName: ");
+ msgEx.Append(_T("\n\tName: "));
msgEx.Append(otherPort->name);
- msgEx.Append("\n\tID: ");
+ msgEx.Append(_T("\n\tID: "));
msgEx.Append(otherPort->id);
} else {
- msgEx.Append("\n\tOther Endpoint is also null.");
+ msgEx.Append(_T("\n\tOther Endpoint is also null."));
}
- msgEx.Append("\nMissing endpoints sometimes can be generated by UDM based interpreters.");
- msgEx.Append("\nCancel button supress further connection error messages like this.");
+ msgEx.Append(_T("\nMissing endpoints sometimes can be generated by UDM based interpreters."));
+ msgEx.Append(_T("\nCancel button supress further connection error messages like this."));
int retVal = view->MessageBox(msgEx, mainMsg, MB_OKCANCEL | MB_ICONERROR);
if (retVal == IDCANCEL)
view->SupressConnectionCheckAlert();
@@ -2699,9 +2699,9 @@
}
if (src_err || dst_err) {
if (src_err) {
- GiveConnectionEndErroMessage("Source endpoint error", dstPort);
+ GiveConnectionEndErroMessage(_T("Source endpoint error"), dstPort);
} else if (dst_err) {
- GiveConnectionEndErroMessage("Destination endpoint error", srcPort);
+ GiveConnectionEndErroMessage(_T("Destination endpoint error"), srcPort);
}
} else
@@ -2821,10 +2821,10 @@
if (tp == ATTVAL_BOOLEAN) {
VERIFY(attrValue.vt == VT_BOOL);
- aval = attrValue.boolVal ? "True" : "False";
+ aval = attrValue.boolVal ? _T("True") : _T("False");
}
else if (tp == ATTVAL_REFERENCE) {
- aval = "Reference attr. label not supported"; // Sorry, maybe later
+ aval = _T("Reference attr. label not supported"); // Sorry, maybe later
}
else if (tp == ATTVAL_ENUM) {
VERIFY(attrValue.vt == VT_BSTR);
@@ -2836,12 +2836,12 @@
if (idx != -1)
aval = (guiMenuCtrl->items[idx]).label;
else
- aval = "N/A";
+ aval = _T("N/A");
}
else {
- aval = "N/A";
+ aval = _T("N/A");
} */
- aval = "N/A";
+ aval = _T("N/A");
CComPtr<IMgaMetaEnumItems> metaEnumItems;
COMTHROW(metaAttr->get_EnumItems(&metaEnumItems));
@@ -2873,14 +2873,14 @@
{
CString val;
if (GetPreference(val, AUTOROUTER_PREF)) {
- autorouterPrefs[GME_START_NORTH] = (val.Find("N") != -1);
- autorouterPrefs[GME_START_EAST] = (val.Find("E") != -1);
- autorouterPrefs[GME_START_SOUTH] = (val.Find("S") != -1);
- autorouterPrefs[GME_START_WEST] = (val.Find("W") != -1);
- autorouterPrefs[GME_END_NORTH] = (val.Find("n") != -1);
- autorouterPrefs[GME_END_EAST] = (val.Find("e") != -1);
- autorouterPrefs[GME_END_SOUTH] = (val.Find("s") != -1);
- autorouterPrefs[GME_END_WEST] = (val.Find("w") != -1);
+ autorouterPrefs[GME_START_NORTH] = (val.Find(_T("N")) != -1);
+ autorouterPrefs[GME_START_EAST] = (val.Find(_T("E")) != -1);
+ autorouterPrefs[GME_START_SOUTH] = (val.Find(_T("S")) != -1);
+ autorouterPrefs[GME_START_WEST] = (val.Find(_T("W")) != -1);
+ autorouterPrefs[GME_END_NORTH] = (val.Find(_T("n")) != -1);
+ autorouterPrefs[GME_END_EAST] = (val.Find(_T("e")) != -1);
+ autorouterPrefs[GME_END_SOUTH] = (val.Find(_T("s")) != -1);
+ autorouterPrefs[GME_END_WEST] = (val.Find(_T("w")) != -1);
} else {
autorouterPrefs[GME_START_NORTH] = false;
autorouterPrefs[GME_START_EAST] = false;
@@ -3302,12 +3302,12 @@
if (pref != EMPTYCONNECTIONCUSTOMIZATIONDATAMAGIC) { // -1 is a magic number for deleted data
CString subStr;
int curPos = 0;
- subStr = pref.Tokenize(";", curPos);
- while (subStr != "") {
+ subStr = pref.Tokenize(_T(";"), curPos);
+ while (subStr != _T("")) {
CustomPathData pathData;
if (pathData.Deserialize(subStr))
customPathData.push_back(pathData);
- subStr = pref.Tokenize(";", curPos);
+ subStr = pref.Tokenize(_T(";"), curPos);
}
}
}
@@ -3319,14 +3319,14 @@
for (std::vector<CustomPathData>::iterator ii = customPathData.begin(); ii != customPathData.end(); ++ii) {
CString edgeStr;
(*ii).Serialize(edgeStr);
- if (valStr != "")
- valStr.Append(";");
+ if (valStr != _T(""))
+ valStr.Append(_T(";"));
valStr.Append(edgeStr);
}
VERIFY(mgaFco);
CComBSTR pathBstr = CUSTOMCONNECTIONDATA;
CComBSTR bstrVal;
- if (valStr == "")
+ if (valStr == _T(""))
bstrVal = EMPTYCONNECTIONCUSTOMIZATIONDATAMAGIC;
else
CopyTo(valStr, bstrVal);
@@ -3334,7 +3334,7 @@
if (handleTransaction)
view->BeginTransaction();
- if (valStr == "") {
+ if (valStr == _T("")) {
CComPtr<IMgaRegNode> ccpMgaRegNode;
COMTHROW(mgaFco->get_RegistryNode(pathBstr, &ccpMgaRegNode));
COMTHROW(ccpMgaRegNode->RemoveTree());
@@ -3507,7 +3507,7 @@
modify = true;
} else if (last.x != pt.x) {
double alpha = atan2(-((double)pt.y - last.y), (double)pt.x - last.x);
- TRACE2("Horizontal alpha %lf %lf\n", alpha / M_PI * 180.0, alpha);
+ TRACE(_T("Horizontal alpha %lf %lf\n"), alpha / M_PI * 180.0, alpha);
if (abs(alpha + M_PI) < radEps || abs(alpha) < radEps || abs(alpha - M_PI) < radEps)
modify = true;
}
@@ -3518,7 +3518,7 @@
modify = true;
} else if (last.y != pt.y) {
double alpha = atan2((double)pt.x - last.x, -((double)pt.y - last.y));
- TRACE2("Vertical alpha %lf %lf\n", alpha / M_PI * 180.0, alpha);
+ TRACE(_T("Vertical alpha %lf %lf\n"), alpha / M_PI * 180.0, alpha);
if (abs(alpha + M_PI) < radEps || abs(alpha) < radEps || abs(alpha - M_PI) < radEps)
modify = true;
}
@@ -3581,7 +3581,7 @@
bool CGuiConnection::NeedsRouterPathConversion(bool expectedAutoRouterState)
{
- TRACE3("NeedsRouterPathConversion %d %d %d\n", connRegAutoRouteNotSet, isAutoRouted,
+ TRACE(_T("NeedsRouterPathConversion %d %d %d\n"), connRegAutoRouteNotSet, isAutoRouted,
!HasPathCustomizationForTypeAndCurrentAspect(CustomPointCustomization));
return (connRegAutoRouteNotSet && isAutoRouted == expectedAutoRouterState &&
!HasPathCustomizationForTypeAndCurrentAspect(CustomPointCustomization));
@@ -3623,7 +3623,7 @@
bool connRegAutoRoute = view->isModelAutoRouted;
// The connection setting overrides the global or model settings
if (GetPreference(autoRoutingStateStr, CONNECTIONAUTOROUTING)) {
- if (autoRoutingStateStr == "false")
+ if (autoRoutingStateStr == _T("false"))
connRegAutoRoute = false;
else
connRegAutoRoute = true;
@@ -3638,7 +3638,7 @@
{
VERIFY(mgaFco);
CComBSTR pathBstr = CONNECTIONAUTOROUTING;
- CString valStr = isAutoRouted ? "true" : "false";
+ CString valStr = isAutoRouted ? _T("true") : _T("false");
CComBSTR bstrVal;
CopyTo(valStr, bstrVal);
if (handleTransaction)
Modified: trunk/GME/Gme/GraphicsUtil.cpp
==============================================================================
--- trunk/GME/Gme/GraphicsUtil.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/GraphicsUtil.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -216,7 +216,7 @@
font[i] = new CFont();
font[i]->CreateFont(fontSizes[i],0,0,0,boldness,0,0,0,ANSI_CHARSET,
OUT_DEVICE_PRECIS,CLIP_DEFAULT_PRECIS,
- PROOF_QUALITY,FF_SWISS,"Arial");
+ PROOF_QUALITY,FF_SWISS,_T("Arial"));
CDC dc;
dc.CreateCompatibleDC(NULL);
@@ -250,7 +250,7 @@
bool isViewMagnified, int width)
{
CString chBuffer;
- chBuffer.Format("%x-%d-%d-%d-%ld", color, isPrinting, lineType, isViewMagnified, width);
+ chBuffer.Format(_T("%x-%d-%d-%d-%ld"), color, isPrinting, lineType, isViewMagnified, width);
std::map<CString,Gdiplus::Pen*>::iterator it = m_mapGdipPens.find(chBuffer);
if (it != m_mapGdipPens.end())
return it->second;
@@ -480,9 +480,8 @@
Gdiplus::PointF pointF(static_cast<float> (pt.x),
static_cast<float> (pt.y));
- CA2W wcTxt(txt);
Gdiplus::RectF rectF;
- gdip->MeasureString(wcTxt, txt.GetLength(), font, pointF, &rectF);
+ gdip->MeasureString(txt, txt.GetLength(), font, pointF, &rectF);
Gdiplus::SizeF size;
rectF.GetSize(&size);
float xOffset = 0;
@@ -502,7 +501,7 @@
// nothing
}
rectF.Offset(xOffset, yOffset);
- gdip->DrawString(wcTxt, txt.GetLength(), font, rectF, &format, &textBrush);
+ gdip->DrawString(txt, txt.GetLength(), font, rectF, &format, &textBrush);
}
Gdiplus::RectF CGraphics::MeasureText2(Gdiplus::Graphics* gdip, const CString& txt, const CPoint& pt, Gdiplus::Font* font)
@@ -510,9 +509,8 @@
Gdiplus::PointF pointF(static_cast<float> (pt.x),
static_cast<float> (pt.y));
- CA2W wcTxt(txt);
Gdiplus::RectF rectF;
- gdip->MeasureString(wcTxt, txt.GetLength(), font, pointF, &rectF);
+ gdip->MeasureString(txt, txt.GetLength(), font, pointF, &rectF);
return rectF;
}
Modified: trunk/GME/Gme/MainFrm.cpp
==============================================================================
--- trunk/GME/Gme/MainFrm.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/MainFrm.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -29,13 +29,13 @@
if(nIndex == 1)
{
- strncpy(pTTT->szText, "Check constraints", 79);
+ _tcsncpy(pTTT->szText, _T("Check constraints"), 79);
return FALSE;
}
if(nIndex == 2)
{
- strncpy(pTTT->szText, "Interpret the current model", 79);
+ _tcsncpy(pTTT->szText, _T("Interpret the current model"), 79);
return FALSE;
}
@@ -46,11 +46,11 @@
UINT nID = pButton->m_nID;
if(nID >= ID_FILE_RUNPLUGIN1 && nID <= ID_FILE_RUNPLUGIN8) {
- strncpy(pTTT->szText, theApp.pluginTooltips[nID-ID_FILE_RUNPLUGIN1], 79);
+ _tcsncpy(pTTT->szText, theApp.pluginTooltips[nID-ID_FILE_RUNPLUGIN1], 79);
return FALSE;
}
if(nID >= ID_FILE_INTERPRET1 && nID <= ID_FILE_INTERPRET18) {
- strncpy(pTTT->szText, theApp.interpreterTooltips[nID-ID_FILE_INTERPRET1], 79);
+ _tcsncpy(pTTT->szText, theApp.interpreterTooltips[nID-ID_FILE_INTERPRET1], 79);
return FALSE;
}
}
@@ -254,7 +254,7 @@
!m_wndToolBarMain.LoadToolBar(IDR_TOOLBAR_MAIN, 0, 0, FALSE, 0, 0, bHiColorIcons ? IDB_MAIN_TOOLBAR24 : 0)
)
{
- TRACE0("Failed to create main toolbar\n");
+ TRACE(_T("Failed to create main toolbar\n"));
return -1; // fail to create
}
@@ -277,7 +277,7 @@
!m_wndToolBarModeling.LoadToolBar(IDR_TOOLBAR_MODELING, 0, 0, FALSE, 0, 0, bHiColorIcons ? IDB_MODELING_TOOLBAR24 : 0)
)
{
- TRACE0("Failed to create modeling toolbar\n");
+ TRACE(_T("Failed to create modeling toolbar\n"));
return -1; // fail to create
}
@@ -648,7 +648,7 @@
CFrameWnd *pFrame = docTemplate->CreateNewFrame(pDocument, NULL);
if(pFrame == NULL) {
- AfxMessageBox("Failed to create window",MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Failed to create window"),MB_OK | MB_ICONSTOP);
return;
}
docTemplate->InitialUpdateFrame(pFrame,pDocument);
@@ -722,7 +722,7 @@
void CMainFrame::WriteStatusZoom(int zoomPct)
{
CString txt;
- txt.Format("%d%%", zoomPct);
+ txt.Format(_T("%d%%"), zoomPct);
WriteStatusText(zoomPaneNo,txt);
}
@@ -1185,14 +1185,14 @@
void CMainFrame::OnDropFiles(HDROP p_hDropInfo)
{
- CGMEEventLogger::LogGMEEvent("MainFrame:OnDropFiles\r\n");
+ CGMEEventLogger::LogGMEEvent(_T("MainFrame:OnDropFiles\r\n"));
// get the number of files dropped
UINT nFiles = DragQueryFile( p_hDropInfo, 0xFFFFFFFF, NULL, 0);
if( nFiles < 1)
{
- CGMEEventLogger::LogGMEEvent("Can't inquire file information!\r\n");
- m_console.Message( "No file dropped or can't inquire file information!", 3);
+ CGMEEventLogger::LogGMEEvent(_T("Can't inquire file information!\r\n"));
+ m_console.Message( _T("No file dropped or can't inquire file information!"), 3);
}
bool one_just_opened = false; // we opened/imported one project just now -> disables opening of more .mga files
@@ -1208,52 +1208,52 @@
is_dir = (fstatus.st_mode & _S_IFDIR) == _S_IFDIR;
CString conn( szFileName);
- if( is_dir || conn.Right(4).CompareNoCase(".mga") == 0 || conn.Right(4).CompareNoCase(".mgx") == 0)
+ if( is_dir || conn.Right(4).CompareNoCase(_T(".mga")) == 0 || conn.Right(4).CompareNoCase(_T(".mgx")) == 0)
{
if( one_just_opened)
- m_console.Message( "Project already open. No other MGA file can be dropped!", 3);
+ m_console.Message( _T("Project already open. No other MGA file can be dropped!"), 3);
else if( theApp.guiMetaProject == NULL && theApp.mgaProject == 0)
{
- if( conn.Right(4).CompareNoCase(".mga") == 0) {
- m_console.Message( "Opening " + conn + ".", 1);
- conn = "MGA=" + conn;
+ if( conn.Right(4).CompareNoCase(_T(".mga")) == 0) {
+ m_console.Message( _T("Opening ") + conn + _T("."), 1);
+ conn = _T("MGA=") + conn;
} else {
int pos = conn.ReverseFind( '\\'); // we don't need the file name, only the path
if( is_dir)
- conn = "MGX=\"" + conn + "\""; // directory dropped
+ conn = _T("MGX=\"") + conn + _T(")\""); // directory dropped
else if( pos != -1)
- conn = "MGX=\"" + conn.Left( pos) + "\""; // the .mgx file dropped, cut off the file part
- m_console.Message( "Opening multiuser project " + conn + ".", 1);
+ conn = _T("MGX=\"") + conn.Left( pos) + _T("\""); // the .mgx file dropped, cut off the file part
+ m_console.Message( _T("Opening multiuser project ") + conn + _T("."), 1);
}
theApp.OpenProject(conn);
one_just_opened = true;
}
else
- m_console.Message( "Another MGA file can't be opened while a project is open.", 3);
+ m_console.Message( _T("Another MGA file can't be opened while a project is open."), 3);
}
- else if( conn.Right(4).CompareNoCase(".xme")==0)
+ else if( conn.Right(4).CompareNoCase(_T(".xme"))==0)
{
- m_console.Message( "Importing " + conn + ".", 1);
+ m_console.Message( _T("Importing ") + conn + _T("."), 1);
theApp.ImportDroppedFile(conn);
one_just_opened = true;
}
- else if( conn.Right(4).CompareNoCase(".xmp")==0 || conn.Right(4).CompareNoCase(".mta")==0)
+ else if( conn.Right(4).CompareNoCase(_T(".xmp"))==0 || conn.Right(4).CompareNoCase(_T(".mta"))==0)
{
if( theApp.guiMetaProject == NULL && theApp.mgaProject == 0) // no project opened
{
- m_console.Message( "Registering " + conn + " as a paradigm.", 1);
+ m_console.Message( _T("Registering ") + conn + _T(" as a paradigm."), 1);
- theApp.RegisterDroppedFile( conn.Right(4).CompareNoCase(".xmp")==0?"XML=" + conn:"MGA=" + conn);
+ theApp.RegisterDroppedFile( conn.Right(4).CompareNoCase(_T(".xmp"))==0?_T("XML=") + conn:_T("MGA=") + conn);
one_just_opened = false; // we did not open a file, just registered
}
else
- m_console.Message( "Can't register paradigm file while project is open!", 3);
+ m_console.Message( _T("Can't register paradigm file while project is open!"), 3);
}
else
- m_console.Message( ".MGX, .MGA, .XME, .MTA, .XMP files may be dropped only. Can't open file: " + conn + "!", 3);
+ m_console.Message( _T(".MGX, .MGA, .XME, .MTA, .XMP files may be dropped only. Can't open file: ") + conn + _T("!"), 3);
}
else
- m_console.Message( "Can't inquire file information!", 3);
+ m_console.Message( _T("Can't inquire file information!"), 3);
}
}
@@ -1509,7 +1509,7 @@
CWnd* tabPaneWnd = tabControl->GetTabWndNoWrapper(pInfo->m_nTabIndex);
if (tabPaneWnd->IsKindOf(RUNTIME_CLASS(CChildFrame))) {
CChildFrame* childFrame = STATIC_DOWNCAST(CChildFrame, tabPaneWnd);
- pInfo->m_strText = childFrame->GetTitle() + " - " + childFrame->GetAppTitle();
+ pInfo->m_strText = childFrame->GetTitle() + _T(" - ") + childFrame->GetAppTitle();
}
}
}
Modified: trunk/GME/Gme/MgaOpenDlg.cpp
==============================================================================
--- trunk/GME/Gme/MgaOpenDlg.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/MgaOpenDlg.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -26,54 +26,54 @@
switch (dType){
case OpenDialog:
- title = "Open";
- filemsg = "Open project file";
- xmlfilemsg = "Open multi user project";
+ title = _T("Open");
+ filemsg = _T("Open project file");
+ xmlfilemsg = _T("Open multi user project");
flag_isopen = true;
flag_back = false;
flag_create = false;
flag_meta = false;
break;
case SaveDialog:
- title = "Save";
- filemsg = "Save project file";
- xmlfilemsg = "Save multi user project";
+ title = _T("Save");
+ filemsg = _T("Save project file");
+ xmlfilemsg = _T("Save multi user project");
flag_isopen = false;
flag_back = false;
flag_create = false;
flag_meta = false;
break;
case SaveAsDialog:
- title = "Save As";
- filemsg = "Save project file";
- xmlfilemsg = "Save multi user project";
+ title = _T("Save As");
+ filemsg = _T("Save project file");
+ xmlfilemsg = _T("Save multi user project");
flag_isopen = false;
flag_back = false;
flag_create = false;
flag_meta = false;
break;
case NewDialog:
- title = "New";
- filemsg = "Create project file";
- xmlfilemsg = "Create multi user project";
+ title = _T("New");
+ filemsg = _T("Create project file");
+ xmlfilemsg = _T("Create multi user project");
flag_isopen = true;
flag_back = true;
flag_create = true;
flag_meta = false;
break;
case ImportDialog:
- title = "Import to new project";
- filemsg = "Create project file";
- xmlfilemsg = "Create multi user project";
+ title = _T("Import to new project");
+ filemsg = _T("Create project file");
+ xmlfilemsg = _T("Create multi user project");
flag_isopen = true;
flag_back = false;
flag_create = true;
flag_meta = false;
break;
case ClearLocksDialog:
- title = "Select project";
- filemsg = "Open project file";
- xmlfilemsg = "Open multi user project";
+ title = _T("Select project");
+ filemsg = _T("Open project file");
+ xmlfilemsg = _T("Open multi user project");
flag_isopen = true;
flag_back = false;
flag_create = false;
@@ -84,16 +84,16 @@
}
-static char mgafilter[] = "MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
- "All files (*.*)|*.*||";
+static TCHAR mgafilter[] = _T("MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|")
+ _T("All files (*.*)|*.*||");
-static char xmemgafilter[] = "GME Model Files (*.mga;*.xme;*.mgx)|*.mga; *.xme; *.mgx|MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|"
- "Multi-user files (*.mgx)|*.mgx|All files (*.*)|*.*||";
+static TCHAR xmemgafilter[] = _T("GME Model Files (*.mga;*.xme;*.mgx)|*.mga; *.xme; *.mgx|MGA Files (*.mga)|*.mga|Exported Files (*.xme;*.xml)|*.xme; *.xml|")
+ _T("Multi-user files (*.mgx)|*.mgx|All files (*.*)|*.*||");
-static char mgaonlyfilter[] = "MGA Files (*.mga)|*.mga||";
+static TCHAR mgaonlyfilter[] = _T("MGA Files (*.mga)|*.mga||");
-static char metafilter[] = "MGA Meta Files (*.mta)|*.mta|XML Paradigm Files (*.xmp)|*.xmp|"
- "All files (*.*)|*.*||";
+static TCHAR metafilter[] = _T("MGA Meta Files (*.mta)|*.mta|XML Paradigm Files (*.xmp)|*.xmp|")
+ _T("All files (*.*)|*.*||");
CString CMgaOpenDlg::AskMGAConnectionString(const CString& spec_ext)
@@ -104,18 +104,18 @@
CString SPEC_EXT = spec_ext; SPEC_EXT.MakeUpper();
CString spec_filter;
// as "MGA Files (*.mga)|*.mga|"
- spec_filter.Format( "%s Files (*.%s)|*.%s|", SPEC_EXT, spec_ext, spec_ext);
+ spec_filter.Format( _T("%s Files (*.%s)|*.%s|"), SPEC_EXT, spec_ext, spec_ext);
// insert this filter at the beginning (thus preferred)
filters.Insert( 0, spec_filter);
}
- const char* initialFile = NULL; // NULL or points into currentMgaPath
- char currentMgaPath[MAX_PATH];
+ const TCHAR* initialFile = NULL; // NULL or points into currentMgaPath
+ TCHAR currentMgaPath[MAX_PATH];
if (theApp.isMgaProj()) {
CString conn = theApp.connString();
- const char* zsConn = conn;
+ const TCHAR* zsConn = conn;
zsConn += 4; // skip MGA=
- char* filename;
+ TCHAR* filename;
if (!GetFullPathName(zsConn, MAX_PATH, currentMgaPath, &filename) || filename == 0) {
} else {
initialFile = filename;
@@ -137,14 +137,14 @@
}
if( dlg.DoModal() == IDOK ) {
- conn = CString("MGA=") + dlg.GetPathName();
- if(dlg.GetFileExt() == "") // no extension specified by the user
+ conn = CString(_T("MGA=")) + dlg.GetPathName();
+ if(dlg.GetFileExt() == _T("")) // no extension specified by the user
{
- conn += ".";
+ conn += _T(".");
// if spec_ext is NOT empty then
// filterindex = 1 stands for special extension
// = 2 is the MGA
- conn += dlg.m_ofn.nFilterIndex == 1 && !spec_ext.IsEmpty() ? spec_ext:"mga";
+ conn += dlg.m_ofn.nFilterIndex == 1 && !spec_ext.IsEmpty() ? spec_ext:_T("mga");
}
}
return conn;
@@ -168,9 +168,9 @@
pos = hint.Find('.');
if(pos >= 0) hint = hint.Left(pos);
- if( db.OpenEx("DSN="+hint, CDatabase::forceOdbcDialog) ) {
+ if( db.OpenEx(_T("DSN=")+hint, CDatabase::forceOdbcDialog) ) {
conn.Empty();
- if(m_radio == 2) conn = "ODBC;";
+ if(m_radio == 2) conn = _T("ODBC;");
conn += PruneConnectionString(db.GetConnect());
}
db.Close();
@@ -188,29 +188,29 @@
CString ext = dlg.GetFileExt();
ext.MakeLower();
- if( ext == "mga" || ext == "mta" )
- conn = CString("MGA=") + dlg.GetPathName();
- else if( ext == "mgx" )
- conn = CString("MGX=") + dlg.GetPathName();
- else if( (ext == "xml") || (ext == "xme") || (ext == "xmp") )
- conn = CString("XML=") + dlg.GetPathName();
- else if( ext == "mdb" )
- conn = CString("DBQ=") + dlg.GetPathName();
- else if( ext == "" )
+ if( ext == _T("mga") || ext == _T("mta") )
+ conn = CString(_T("MGA=")) + dlg.GetPathName();
+ else if( ext == _T("mgx") )
+ conn = CString(_T("MGX=")) + dlg.GetPathName();
+ else if( (ext == _T("xml")) || (ext == _T("xme")) || (ext == _T("xmp")) )
+ conn = CString(_T("XML=")) + dlg.GetPathName();
+ else if( ext == _T("mdb") )
+ conn = CString(_T("DBQ=")) + dlg.GetPathName();
+ else if( ext == _T("") )
{
switch( dlg.m_ofn.nFilterIndex )
{
case 4:
case 1:
- conn = CString("MGA=") + dlg.GetPathName() + ".mga";
+ conn = CString(_T("MGA=")) + dlg.GetPathName() + _T(".mga");
break;
case 2:
- conn = CString("XML=") + dlg.GetPathName() + ".xme";
+ conn = CString(_T("XML=")) + dlg.GetPathName() + _T(".xme");
break;
case 3:
- conn = CString("DBQ=") + dlg.GetPathName() + ".mdb";
+ conn = CString(_T("DBQ=")) + dlg.GetPathName() + _T(".mdb");
break;
}
}
@@ -220,15 +220,15 @@
{
case 4:
case 1:
- conn = CString("MGA=") + dlg.GetPathName();
+ conn = CString(_T("MGA=")) + dlg.GetPathName();
break;
case 2:
- conn = CString("XML=") + dlg.GetPathName();
+ conn = CString(_T("XML=")) + dlg.GetPathName();
break;
case 3:
- conn = CString("DBQ=") + dlg.GetPathName();
+ conn = CString(_T("DBQ=")) + dlg.GetPathName();
break;
}
}
@@ -248,12 +248,12 @@
// open existing multiuser project
BROWSEINFO bi;
- char szDisplayName[MAX_PATH];
- char szPath[MAX_PATH];
+ TCHAR szDisplayName[MAX_PATH];
+ TCHAR szPath[MAX_PATH];
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
- bi.lpszTitle = "Select the project location.";
+ bi.lpszTitle = _T("Select the project location.");
bi.pszDisplayName = szDisplayName;
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
@@ -265,9 +265,9 @@
{
if( SHGetPathFromIDList(idlist, szPath) )
{
- conn = "MGX=\"";
+ conn = _T("MGX=\"");
conn += szPath;
- conn += "\"";
+ conn += _T("\"");
}
}
}
@@ -292,21 +292,21 @@
if( q < 0 )
q = conn.GetLength();
- CString part((const char*)conn + p, q-p);
+ CString part((const TCHAR*)conn + p, q-p);
int r = part.Find('=');
if( r < 0 )
r = part.GetLength();
- CString key((const char*)part, r);
+ CString key((const TCHAR*)part, r);
- if( key == "UID" ||
- key == "PWD" ||
- key == "USER" ||
- key == "PASSWORD" )
+ if( key == _T("UID") ||
+ key == _T("PWD") ||
+ key == _T("USER") ||
+ key == _T("PASSWORD") )
{
if( !ret.IsEmpty() )
- ret += ";";
+ ret += _T(";");
ret += part;
}
Modified: trunk/GME/Gme/ModelPropertiesDlgBar.cpp
==============================================================================
--- trunk/GME/Gme/ModelPropertiesDlgBar.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/ModelPropertiesDlgBar.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -30,7 +30,7 @@
GetDlgItem(IDC_TYPEMARK)->MoveWindow(6,8,16,16);
GetDlgItem(IDC_TYPEMARK)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_INSTANCEMARK)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_BASETYPE_LABEL)->SetWindowText("Base:");
+ GetDlgItem(IDC_BASETYPE_LABEL)->SetWindowText(_T("Base:"));
}
void CModelPropertiesDlgBar::ShowInstance()
@@ -38,7 +38,7 @@
GetDlgItem(IDC_TYPEMARK)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_INSTANCEMARK)->MoveWindow(6,8,16,16);
GetDlgItem(IDC_INSTANCEMARK)->ShowWindow(SW_SHOW);
- GetDlgItem(IDC_BASETYPE_LABEL)->SetWindowText("Type:");
+ GetDlgItem(IDC_BASETYPE_LABEL)->SetWindowText(_T("Type:"));
}
/////////////////////////////////////////////////////////////////////////////
@@ -55,7 +55,7 @@
edit->SetSel(0, -1);
_itoa(kk, buff, 10);
CString str = buff;
- str += "%";
+ str += _T("%");
edit->ReplaceSel(str);
}
@@ -73,9 +73,9 @@
return;
if (fwin->m_hWnd == edit->m_hWnd)
{
- char buff[100];
- edit->GetLine(0, buff, sizeof(buff)-1);
- int kk = atoi(buff);
+ TCHAR buff[100];
+ edit->GetLine(0, buff, sizeof(buff)/sizeof(buff[0])-1);
+ int kk = _ttoi(buff);
kk = abs(kk);
if (!kk)
kk = 100;
@@ -118,23 +118,23 @@
CString str;
if (m_zoomlist[k] > 0)
{
- char buff[100];
- _itoa(m_zoomlist[k], buff, 10);
+ TCHAR buff[100];
+ _itot(m_zoomlist[k], buff, 10);
str = buff;
- str += "%";
+ str += _T("%");
}
else
{
switch (m_zoomlist[k])
{
case ZOOM_WIDTH:
- str = "Fit Width";
+ str = _T("Fit Width");
break;
case ZOOM_HEIGHT:
- str = "Fit Height";
+ str = _T("Fit Height");
break;
case ZOOM_ALL:
- str = "Fit All";
+ str = _T("Fit All");
break;
}
}
@@ -159,9 +159,9 @@
CEdit* edit = (CEdit*)(zoom->GetDlgItem(IDC_TYPENAME));
if (!edit)
return;
- char buff[100];
- edit->GetLine(0, buff, sizeof(buff)-1);
- kk = atoi(buff);
+ TCHAR buff[100];
+ edit->GetLine(0, buff, sizeof(buff)/sizeof(buff[0])-1);
+ kk = _ttoi(buff);
if (!kk)
kk = 100;
int i;
@@ -182,9 +182,9 @@
CEdit* edit = (CEdit*)(zoom->GetDlgItem(IDC_TYPENAME));
if (!edit)
return;
- char buff[100];
- edit->GetLine(0, buff, sizeof(buff)-1);
- kk = atoi(buff);
+ TCHAR buff[100];
+ edit->GetLine(0, buff, sizeof(buff)/sizeof(buff[0])-1);
+ kk = _ttoi(buff);
if (!kk)
kk = 100;
int i;
Modified: trunk/GME/Gme/NewXmlbackendProjDlg.cpp
==============================================================================
--- trunk/GME/Gme/NewXmlbackendProjDlg.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/NewXmlbackendProjDlg.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -75,12 +75,12 @@
{
BROWSEINFO bi;
- char szDisplayName[MAX_PATH];
- char szPath[MAX_PATH];
+ TCHAR szDisplayName[MAX_PATH];
+ TCHAR szPath[MAX_PATH];
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
- bi.lpszTitle = "Select the project location.";
+ bi.lpszTitle = _T("Select the project location.");
bi.pszDisplayName = szDisplayName;
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
@@ -108,7 +108,7 @@
UpdateData();
if( m_projectName.Trim().IsEmpty() || m_location.Trim().IsEmpty())
{
- AfxMessageBox( "Project location and name must not be empty!");
+ AfxMessageBox( _T("Project location and name must not be empty!"));
return;
}
@@ -116,31 +116,31 @@
if( GetFileAttributesEx( m_location, GetFileExInfoStandard, &attr ) )
{
if( FILE_ATTRIBUTE_DIRECTORY != ( attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
- if( IDOK != AfxMessageBox( m_location + " does not seem to be a directory. Do you still want to use this location for your project?", MB_YESNO))
+ if( IDOK != AfxMessageBox( m_location + _T(" does not seem to be a directory. Do you still want to use this location for your project?"), MB_YESNO))
return; // if answered NO, return, which means dialog is not closed
}
else
- if( IDOK != AfxMessageBox( m_location + " does not seem to exist, but it might be created during the checkout process. Do you want to continue?", MB_YESNO))
+ if( IDOK != AfxMessageBox( m_location + _T(" does not seem to exist, but it might be created during the checkout process. Do you want to continue?"), MB_YESNO))
return; // if answered NO, return, which means dialog is not closed
if( m_sourceControlType == 0 &&
- (m_svnUrl.Left( 6) != "svn://"
- && m_svnUrl.Left(10) != "svn+ssh://"
- && m_svnUrl.Left(7) != "http://"
- && m_svnUrl.Left(8) != "https://"))
+ (m_svnUrl.Left( 6) != _T("svn://")
+ && m_svnUrl.Left(10) != _T("svn+ssh://")
+ && m_svnUrl.Left(7) != _T("http://")
+ && m_svnUrl.Left(8) != _T("https://")))
{
- AfxMessageBox( "URL must be provided in one of the svn://host[/dir], svn+ssh://[username@]host[/dir] or https://host[/dir] form");
+ AfxMessageBox( _T("URL must be provided in one of the svn://host[/dir], svn+ssh://[username@]host[/dir] or https://host[/dir] form"));
return;
}
- m_connectionString = "MGX=\"";
+ m_connectionString = _T("MGX=\"");
m_connectionString += m_location.Trim();
// http://escher.isis.vanderbilt.edu/JIRA/browse/GME-148 : JIRA entry created
// if m_location contains a tailing '\' then no need for this
if( m_location.TrimRight().Right(1) != '\\')
- m_connectionString += "\\";
+ m_connectionString += _T("\\");
m_connectionString += m_projectName.Trim();
- m_connectionString += "\"";
+ m_connectionString += _T("\"");
if( m_svnUrl.Right(1) == '/') // cut off tailing '/'
m_svnUrl = m_svnUrl.Left( m_svnUrl.GetLength() - 1 );
@@ -148,10 +148,10 @@
if( m_sourceControlType == 0 )
{
//if( !m_svnUrl.IsEmpty())
- m_connectionString += " svn=\"";
+ m_connectionString += _T(" svn=\"");
m_connectionString += m_svnUrl;
- m_connectionString += "\"";
- char gmepath[200];
+ m_connectionString += _T("\"");
+ TCHAR gmepath[200];
if(SHGetSpecialFolderPath( NULL, gmepath, CSIDL_APPDATA, true)) //most likely C:\Documents and Settings\<username>\Application Data
{
WIN32_FILE_ATTRIBUTE_DATA attr;
@@ -159,67 +159,67 @@
CString path;
int nb_errs = 0;
- path = CString( gmepath) + "\\Subversion";
+ path = CString( gmepath) + _T("\\Subversion");
res = GetFileAttributesEx( path, GetFileExInfoStandard, &attr );
if( res && ( FILE_ATTRIBUTE_DIRECTORY == (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) { } else
- nb_errs += _mkdir( (LPCTSTR) path);
+ nb_errs += _tmkdir( (LPCTSTR) path);
- path = CString( gmepath) + "\\Subversion\\auth";
+ path = CString( gmepath) + _T("\\Subversion\\auth");
res = GetFileAttributesEx( path, GetFileExInfoStandard, &attr );
if( res && ( FILE_ATTRIBUTE_DIRECTORY == (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) { } else
- nb_errs += _mkdir( (LPCTSTR) path);
+ nb_errs += _tmkdir( (LPCTSTR) path);
if( nb_errs == 0)
{
- path = CString(gmepath) + "\\Subversion\\auth\\svn.simple";
+ path = CString(gmepath) + _T("\\Subversion\\auth\\svn.simple");
res = GetFileAttributesEx( path, GetFileExInfoStandard, &attr );
if( res && ( FILE_ATTRIBUTE_DIRECTORY == (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) { } else
{
- nb_errs += _mkdir((LPCTSTR) path); //in case dir is not there, make it, if it was there will fail
+ nb_errs += _tmkdir((LPCTSTR) path); //in case dir is not there, make it, if it was there will fail
if( !nb_errs)
- AfxMessageBox( path + " directory created that the credentials could be stored later.");
+ AfxMessageBox( path + _T(" directory created that the credentials could be stored later."));
}
- path = CString(gmepath) + "\\Subversion\\auth\\svn.ssl.server";
+ path = CString(gmepath) + _T("\\Subversion\\auth\\svn.ssl.server");
res = GetFileAttributesEx( path, GetFileExInfoStandard, &attr );
if( res && ( FILE_ATTRIBUTE_DIRECTORY == (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) { } else
{
- int l_errs = _mkdir((LPCTSTR) path); //in case dir is not there, make it, if it was there will fail
+ int l_errs = _tmkdir((LPCTSTR) path); //in case dir is not there, make it, if it was there will fail
if( !l_errs)
- AfxMessageBox( path + " directory created that the certificates could be stored later.");
+ AfxMessageBox( path + _T(" directory created that the certificates could be stored later."));
nb_errs += l_errs;
}
}
if( nb_errs)
- AfxMessageBox( CString( "Could not create the local directories where credentials would be stored: \n") +
- CString( gmepath) + "\\Subversion\\auth\\svn.simple\n" +
- CString( gmepath) + "\\Subversion\\auth\\svn.ssl.server");
+ AfxMessageBox( CString( _T("Could not create the local directories where credentials would be stored: \n")) +
+ CString( gmepath) + _T("\\Subversion\\auth\\svn.simple\n") +
+ CString( gmepath) + _T("\\Subversion\\auth\\svn.ssl.server"));
}
}
if( m_hashedFileStorage == BST_CHECKED)
{
- m_connectionString += " hash=\"true\"";
+ m_connectionString += _T(" hash=\"true\"");
int csel = m_hashAlgoControl.GetCurSel();
if( csel < m_hashAlgoControl.GetCount() && csel >= 0)
{
CString res;
m_hashAlgoControl.GetLBText( csel, res);
- if( res == "4096")
- m_connectionString += " hval=\"4096\"";
- else if( res == "256")
- m_connectionString += " hval=\"256\"";
- else if( res == "3")
- m_connectionString += " hval=\"3\"";
- else if( res == "4")
- m_connectionString += " hval=\"4\"";
+ if( res == _T("4096"))
+ m_connectionString += _T(" hval=\"4096\"");
+ else if( res == _T("256"))
+ m_connectionString += _T(" hval=\"256\"");
+ else if( res == _T("3"))
+ m_connectionString += _T(" hval=\"3\"");
+ else if( res == _T("4"))
+ m_connectionString += _T(" hval=\"4\"");
else
{
- AfxMessageBox( "Invalid hash method selected");
+ AfxMessageBox( _T("Invalid hash method selected"));
return;
}
}
@@ -232,10 +232,10 @@
BOOL CNewXmlbackendProjDlg::OnInitDialog()
{
// init m_svnUrl like this while testing to avoid typing too much
- m_svnUrl = "svn+ssh://zolmol@svn.isis.vanderbilt.edu/export/svn/testrepo/gme/zoli";
- m_svnUrl = "https://svn.isis.vanderbilt.edu/testrepo/gme/zoli";
+ m_svnUrl = _T("svn+ssh://zolmol@svn.isis.vanderbilt.edu/export/svn/testrepo/gme/zoli");
+ m_svnUrl = _T("https://svn.isis.vanderbilt.edu/testrepo/gme/zoli");
// init like this when going live
- m_svnUrl = "svn+ssh://<usernamehere>@<hostnamehere>";
+ m_svnUrl = _T("svn+ssh://<usernamehere>@<hostnamehere>");
CDialog::OnInitDialog();
enableSubversionControls( m_sourceControlType == 0 );
Modified: trunk/GME/Gme/ParadigmPropertiesDlg.cpp
==============================================================================
--- trunk/GME/Gme/ParadigmPropertiesDlg.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/ParadigmPropertiesDlg.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -118,7 +118,7 @@
}
catch(hresult_exception e) {
theApp.mgaProject->AbortTransaction();
- AfxMessageBox("Error reading paradigm properties");
+ AfxMessageBox(_T("Error reading paradigm properties"));
}
return TRUE; // return TRUE unless you set the focus to a control
Modified: trunk/GME/Gme/ProjectPropertiesDlg.cpp
==============================================================================
--- trunk/GME/Gme/ProjectPropertiesDlg.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/ProjectPropertiesDlg.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -81,7 +81,7 @@
CComBSTR bstr;
CString str;
comment.GetWindowText(str);
- str.Replace("\r\n","\n");
+ str.Replace(_T("\r\n"),_T("\n"));
CopyTo(str,bstr);
COMTHROW(theApp.mgaProject->put_Comment(bstr));
}
@@ -96,7 +96,7 @@
}
catch(hresult_exception e) {
theApp.mgaProject->AbortTransaction();
- AfxMessageBox("Error writing project properties");
+ AfxMessageBox(_T("Error writing project properties"));
}
CDialog::OnOK();
}
@@ -156,7 +156,7 @@
COMTHROW(theApp.mgaProject->get_Comment(&bstr));
CString str;
CopyTo(bstr,str);
- str.Replace("\n", "\r\n");
+ str.Replace(_T("\n"), _T("\r\n"));
comment.SetWindowText(str);
}
{
@@ -203,7 +203,7 @@
}
catch(hresult_exception e) {
theApp.mgaProject->AbortTransaction();
- AfxMessageBox("Error reading project properties");
+ AfxMessageBox(_T("Error reading project properties"));
}
return TRUE; // return TRUE unless you set the focus to a control
Modified: trunk/GME/Gme/RecentConnStrList.cpp
==============================================================================
--- trunk/GME/Gme/RecentConnStrList.cpp Thu Mar 31 16:33:39 2011 (r1240)
+++ trunk/GME/Gme/RecentConnStrList.cpp Thu Mar 31 16:33:52 2011 (r1241)
@@ -107,12 +107,12 @@
break;
// double up any '&' characters so they are not underlined
- strName.Replace("&", "&&");
+ strName.Replace(_T("&"), _T("&&"));
// insert mnemonic + the file name
CString buf;
if (iMRU < 10) // Do not overlap mnemonic (in case of more than 10 (actually 9) MRU item)
- buf.Format("&%ld ", (iMRU + 1 + m_nStart) % 10);
+ buf.Format(_T("&%ld "), (iMRU + 1 + m_nStart) % 10);
pCmdUI->m_pMenu->InsertMenu(pCmdUI->m_nIndex,
MF_STRING | MF_BYPOSITION, pCmdUI->m_nID,
buf + strName);
More information about the gme-commit
mailing list