warning C6273: Non-integer passed as _Param_(2) when an integer is required
<p>I have this method:</p>

<pre><code>void CMeetingScheduleAssistantDlg::RestartProgram()
{
    RESTART_THIS_MFC_APP;
}
</code></pre>

<p>It calls a macro as defined:</p>

<pre><code>#define RESTART_THIS_MFC_APP \
    { \
        HWND _hWndMain = AfxGetApp()-&gt;m_pMainWnd-&gt;GetSafeHwnd(); \
        DWORD _dwProcessID = (DWORD)_getpid(); \
        TCHAR _cFilespec[_MAX_PATH + 1]; \
        if (::GetModuleFileName(AfxGetInstanceHandle(), _cFilespec,_MAX_PATH) == 0) \
            AfxMessageBox(_T("ERROR: Could not obtain full filespec of this application to restart it."), MB_OK|MB_ICONSTOP); \
        else \
        { \
            CString strAppFilespec(_cFilespec); \
; \
            LPTSTR lpszFilename = ::PathFindFileName(_cFilespec); \
            _tcscpy_s(lpszFilename,_MAX_PATH - (lpszFilename - _cFilespec),_T("AppRestarter.exe") ); \
; \
            CString strAppRestarterFilespec(_cFilespec); \
; \
            CString strCmdLine ; \
            strCmdLine.Format(_T("%ld %ld \"%s\""),_hWndMain,_dwProcessID,(LPCTSTR)strAppFilespec); \
; \
            HINSTANCE hProcess = ::ShellExecute(NULL,_T("open"),(LPCTSTR)strAppRestarterFilespec, \
                                                (LPCTSTR)strCmdLine,_T(".\\"), SW_HIDE); \
            if ( (DWORD)(DWORD_PTR)hProcess &lt;= 32) \
                AfxMessageBox(_T("ERROR: Could not run application restarter."), MB_OK|MB_ICONSTOP); \
        } \
    }
</code></pre>

<p>The above is a third party macro that was provided to me that works in conjunction with a application restarter executable. The original author is no longer available.</p>

<p>The application builds and it functions correctly. But I am getting a code analysis error:</p>

<blockquote>
  <p>warning C6273: Non-integer passed as <em>Param</em>(2) when an integer is
  required in call to
  'ATL::CStringT ></p>
  
  <blockquote>
    <p>::Format' Actual type: 'struct HWND__ *':  if a pointer value is being passed, %p should be used.</p>
  </blockquote>
</blockquote>

<p>It is true that <code>_hWndMain</code> is of type <code>HWND</code> but I can't use <code>%p</code> as the format code. If I do that then the application restarter fails and tells me it expects this parameter to be numeric.</p>

<p>So as you can see I reverted to using %ld which I thought would be right.</p>

<p>Can this warning be suppressed by a change to my code? Or is this just a false positive I must live with?</p>