CustomStatusCursor::CustomStatusCursor()
: m_ended(false)
{
-};
+}
CustomStatusCursor::CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...)
: m_ended(false)
{
va_list argp;
va_start(argp, fmt);
- Create(hinst, lpCursorName, fmt, argp);
+ CString msg;
+ msg.FormatV(fmt, argp);
+ Create(hinst, lpCursorName, msg);
va_end(argp);
}
-void CustomStatusCursor::Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...)
+CustomStatusCursor::CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, UINT fmtid, ...)
+: m_ended(false)
+{
+ va_list argp;
+ va_start(argp, fmtid);
+ CString msg;
+ msg.FormatV(theApp.LoadString(fmtid).c_str(), argp);
+ Create(hinst, lpCursorName, msg);
+ va_end(argp);
+}
+
+void CustomStatusCursor::Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR m_msg)
{
- CString m_msg;
CString m_oldmsg;
HCURSOR m_prevCursor = NULL;
HCURSOR m_myCursor = NULL;
- // update status text
- va_list args;
- va_start(args, fmt);
- m_msg.FormatV(fmt, args);
- va_end(args);
-
if (c_piStatusDisplay)
m_oldmsg = c_piStatusDisplay->BeginStatus(m_msg);
{
va_list argp;
va_start(argp, fmt);
- Create(NULL, IDC_WAIT, fmt, argp);
+ CString msg;
+ msg.FormatV(fmt, argp);
+ Create(NULL, IDC_WAIT, fmt);
va_end(argp);
}
{
va_list argp;
va_start(argp, fmtid);
- Create(NULL, IDC_WAIT, theApp.LoadString(fmtid).c_str(), argp);
+ CString msg;
+ msg.FormatV(theApp.LoadString(fmtid).c_str(), argp);
+ Create(NULL, IDC_WAIT, msg);
va_end(argp);
}
// public interface
public:
CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...);
+ CustomStatusCursor(HINSTANCE hinst, LPCTSTR lpCursorName, UINT fmtid, ...);
void ChangeMsg(LPCTSTR fmt, ...);
void End();
~CustomStatusCursor();
protected:
// default constructor for derivation, in two steps 'cause of variable argument list
CustomStatusCursor();
- void Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR fmt, ...);
+ void Create(HINSTANCE hinst, LPCTSTR lpCursorName, LPCTSTR m_msg);
private:
int posInStack;