Why can't I see printf output?

Hi, I'm devleoping a COM ext. property page for AD. I want to see more detail by using GetLastError(), and more error information using the following code but I don't see even a DOS window opens up and definitely not additional error message written. Can someone tell me how to get this done
Thanks.

if ( FAILED ( hResult ) )

{

DisplayError(hResult, L"Saving new computer failed" );

printf("Saving new computer failed %u\n", GetLastError());

wprintf(L"An error occurred.\n HRESULT: %x\n",hResult);

// If facility is Win32, get the Win32 error

//if (HRESULT_FACILITY(hResult)==FACILITY_WIN32)

//{

DWORD dwLastError;

WCHAR szErrorBuf[MAX_PATH];

WCHAR szNameBuf[MAX_PATH];

// Get extended error value.

HRESULT hr_return =S_OK;

hr_return = ADsGetLastError( &dwLastError,

szErrorBuf,

MAX_PATH,

szNameBuf,

MAX_PATH);

if (SUCCEEDED(hr_return))

{

wprintf(L"Error Code: %d\n Error Text: %ws\n Provider: %ws\n", dwLastError, szErrorBuf, szNameBuf);

}

//}

return hResult;




Answer this question

Why can't I see printf output?

  • Uhh

    AlphaDavis wrote:

    No this is not a console program. This is a COM DLL that I'm developing for AD property sheet dialog. Do you see a way for me to see more of the error information than just the hResult

    Thaks.

    You can use the ATLTRACE2 macro I guess.



  • drk9999

    No this is not a console program. This is a COM DLL that I'm developing for AD property sheet dialog. Do you see a way for me to see more of the error information than just the hResult

    Thaks.



  • Daniel Correia

    Is this a console app If it's not a console app, there will not be a default console window.

  • Why can't I see printf output?