Cosmin871 0 Newbie Poster

I have created a win32 application in which you can draw different objects(lines, rectangles, etc.) and now I want to save the drawings as bmp files because I already now how to load bmp files.
These is as far as I got:

void OnSave(HWND hWnd)
{
    OPENFILENAME openFile;
    TCHAR szPath[MAX_PATH];
    TCHAR szFile[MAX_PATH];
    static BOOL bFirstSave = TRUE;

    // Initialize OPENFILENAME structure.
    ZeroMemory( &openFile, sizeof(OPENFILENAME) );
    openFile.lStructSize = sizeof(OPENFILENAME);

    szFile[0] = '\0';
    openFile.hwndOwner = hWnd;
    openFile.lpstrFile = szFile;
    openFile.nMaxFile = sizeof(szFile)/sizeof(*szFile);

    // The first time the user saves a document, default to My Pictures.
    if ( TRUE == bFirstSave )
    {
        if ( SUCCEEDED( SHGetFolderPath( NULL, CSIDL_MYPICTURES, 
            NULL, 0, szPath ) ) )
        {
            // Set lpstrInitialDir to the path that SHGetFolderPath obtains.
            // This causes GetSaveFileName to point to the My Pictures folder.
            openFile.lpstrInitialDir = szPath;
        }
    }
    // Display standard File Save dialog box, defaulting to My Pictures
    // or the user's previously selected location.
    if ( GetSaveFileName( &openFile ) == TRUE )
    {
        // User clicks Save.
        // Save the file.
        bFirstSave = FALSE;
    }
    else
    {
        // User cancels the File Save dialog box.
    }
}

Please help.
(Sorry about my english and that my first post is a request)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.