int namedArgCount = 0;
int i;
for (i = 0; i < noArgs; i++)
- if (!INVOKEARG(i).GetName().IsNull())
+ if ( !INVOKEARG(i).GetName().empty() )
{
namedArgCount ++;
}
int j = 0;
for (i = 0; i < namedArgCount; i++)
{
- if (!INVOKEARG(i).GetName().IsNull())
+ if ( !INVOKEARG(i).GetName().empty() )
{
argNames[(namedArgCount-j)] = wxConvertStringToOle(INVOKEARG(i).GetName());
j ++;
}
else
{
- wxLogSysError(hr,
- _("Cannot get an active instance of \"%s\""), progId);
+ // Log an error except if we're supposed to fail silently when the
+ // error is that no current instance exists.
+ if ( hr != MK_E_UNAVAILABLE ||
+ !(flags & wxAutomationInstance_SilentIfNone) )
+ {
+ wxLogSysError(hr,
+ _("Cannot get an active instance of \"%s\""),
+ progId);
+ }
}
return false;