[commit] r1238 - trunk/GME/Mga
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Mar 31 15:16:07 CDT 2011
Author: ksmyth
Date: Thu Mar 31 15:16:07 2011
New Revision: 1238
Log:
Pass wide strings to CComBSTR
Modified:
trunk/GME/Mga/MgaAttribute.cpp
trunk/GME/Mga/MgaLibRefr.cpp
trunk/GME/Mga/MgaLibRefr.h
Modified: trunk/GME/Mga/MgaAttribute.cpp
==============================================================================
--- trunk/GME/Mga/MgaAttribute.cpp Thu Mar 31 15:14:12 2011 (r1237)
+++ trunk/GME/Mga/MgaAttribute.cpp Thu Mar 31 15:16:07 2011 (r1238)
@@ -962,10 +962,10 @@
COMTRY {
fco->CheckRead();
CComBSTR vval;
- if(icon) COMTHROW(get_RegistryValue(CComBSTR("Icon"), icon));
+ if(icon) COMTHROW(get_RegistryValue(CComBSTR(L"Icon"), icon));
if(x || y) {
CComBSTR bb;
- COMTHROW(get_RegistryValue(CComBSTR("Position"), &bb));
+ COMTHROW(get_RegistryValue(CComBSTR(L"Position"), &bb));
long ld, *lx = x?x:&ld, *ly = y?y:&ld;
if(!bb) { *lx = -1; *ly = -1; }
else if(swscanf(bb,OLESTR("%ld,%ld"), lx, ly) != 2) COMTHROW(E_MGA_BAD_POSITIONVALUE);
@@ -977,12 +977,12 @@
COMTRY_IN_TRANSACTION {
fco->CheckWrite();
CComBSTR vval;
- if(icon != NULL) COMTHROW(put_RegistryValue(CComBSTR("Icon"), icon));
+ if(icon != NULL) COMTHROW(put_RegistryValue(CComBSTR(L"Icon"), icon));
if(x >= 0 && y >= 0) {
OLECHAR bbc[40];
swprintf(bbc, 40, OLESTR("%ld,%ld"), x, y);
CComBSTR bb(bbc);
- COMTHROW(put_RegistryValue(CComBSTR("Position"), bb));
+ COMTHROW(put_RegistryValue(CComBSTR(L"Position"), bb));
}
} COMCATCH_IN_TRANSACTION(;)
};
Modified: trunk/GME/Mga/MgaLibRefr.cpp
==============================================================================
--- trunk/GME/Mga/MgaLibRefr.cpp Thu Mar 31 15:14:12 2011 (r1237)
+++ trunk/GME/Mga/MgaLibRefr.cpp Thu Mar 31 15:16:07 2011 (r1238)
@@ -3307,55 +3307,55 @@
void RefreshManager::restoreDependencies()
{
// step 1
- m_reporter.show( CComBSTR("[Step 1] Restoring references to the new library..."), false);
+ m_reporter.show( CComBSTR(L"[Step 1] Restoring references to the new library..."), false);
adaptTopRefs();
adaptDerRefs();
restoreRefsToLib();
// step 2
- m_reporter.show( CComBSTR("[Step 1] Done."), false);
- m_reporter.show( CComBSTR("[Step 2] Restoring connections to the new library..."), false);
+ m_reporter.show( CComBSTR(L"[Step 1] Done."), false);
+ m_reporter.show( CComBSTR(L"[Step 2] Restoring connections to the new library..."), false);
restoreMixedConns( m_newLib);
// step 3
- m_reporter.show( CComBSTR("[Step 2] Done."), false);
- m_reporter.show( CComBSTR("[Step 3] Updating subtypes and instances derived from the library..."), false);
+ m_reporter.show( CComBSTR(L"[Step 2] Done."), false);
+ m_reporter.show( CComBSTR(L"[Step 3] Updating subtypes and instances derived from the library..."), false);
syncStructureFromLib();
// step 4
- m_reporter.show( CComBSTR("[Step 3] Done."), false);
- m_reporter.show( CComBSTR("[Step 4] Updating new connections in subtypes and instances..."), false);
+ m_reporter.show( CComBSTR(L"[Step 3] Done."), false);
+ m_reporter.show( CComBSTR(L"[Step 4] Updating new connections in subtypes and instances..."), false);
syncFreshConns();
// step 5
- m_reporter.show( CComBSTR("[Step 4] Done."), false);
- m_reporter.show( CComBSTR("[Step 5] Reattaching subtypes and instances..."), false);
+ m_reporter.show( CComBSTR(L"[Step 4] Done."), false);
+ m_reporter.show( CComBSTR(L"[Step 5] Reattaching subtypes and instances..."), false);
reattachSubtypesInstances();
// step 6?
reapplyLibFlagToChangedLibs();
- m_reporter.show( CComBSTR("[Step 5] Refresh done."), false);
+ m_reporter.show( CComBSTR(L"[Step 5] Refresh done."), false);
}
int RefreshManager::getNumOfErrors( MyCComBSTR& msg)
{
int k = m_reporter.getErrors();
- char buf[32];
- sprintf( buf, "%d", k);
+ TCHAR buf[32];
+ _stprintf_s( buf, _T("%d"), k);
msg.Append( L"Warnings: ");
msg.Append( buf);
return k;
}
-/*static*/ const CComBSTR Creator::SrcName = "src"; // keep in sync with FCO::SrcName in MgaConnection.cpp
-/*static*/ const CComBSTR Creator::DstName = "dst"; // keep in sync with FCO::DstName
+/*static*/ const CComBSTR Creator::SrcName = L"src"; // keep in sync with FCO::SrcName in MgaConnection.cpp
+/*static*/ const CComBSTR Creator::DstName = L"dst"; // keep in sync with FCO::DstName
/*static*/
HRESULT Creator::SimpleConn( CComPtr<IMgaModel>& p_parent
Modified: trunk/GME/Mga/MgaLibRefr.h
==============================================================================
--- trunk/GME/Mga/MgaLibRefr.h Thu Mar 31 15:14:12 2011 (r1237)
+++ trunk/GME/Mga/MgaLibRefr.h Thu Mar 31 15:16:07 2011 (r1238)
@@ -191,11 +191,11 @@
void appendLink( const CComBSTR& id, const CComBSTR& nm = "NonameObject")
{
- Append("<A HREF=\"mga:");
+ Append(L"<A HREF=\"mga:");
AppendBSTR( id);
- Append("\">");
+ Append(L"\">");
AppendBSTR( nm);
- Append("</A>");
+ Append(L"</A>");
}
void appendLink( FCO* fco)
@@ -208,13 +208,13 @@
appendLink( id, nm);
}
else
- Append( "NullObject");
+ Append(L"NullObject");
}
void appendGuid( const GUID& t_guid)
{
- char buff[39];
- sprintf( buff, "{%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ wchar_t buff[39];
+ wsprintf( buff, L"{%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]);
More information about the gme-commit
mailing list