Thread: load gif into program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    two questions, just to be sure: this will work for win32 correct? because i dont do MFC..
    would i still declare the control as SS_BITMAP? and the pretend that the file is a bitmap, even though its a gif? i.e. would i still send a message to change the image using the IMAGE_BITMAP for the WPARAM, etc.?
    also - i downloaded the platform sdk from M$ from here: http://www.microsoft.com/downloads/d...displaylang=en
    and when i try to compile in Dev-C++ i'm getting a ........TON of errors:
    Code:
    gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"  -I"C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include"   
    
    In file included from main.c:2:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:25: error: syntax error before "Gdiplus"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:26: error: syntax error before '{' token
    
    In file included from main.c:2:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:30: error: syntax error before '}' token
    
    In file included from C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:32,
                     from main.c:2:
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusBase.h:18: error: syntax error before "GdiplusBase"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusBase.h:19: error: syntax error before '{' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusBase.h:25: error: syntax error before "new"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusBase.h:29: error: syntax error before "delete"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusBase.h:33: error: syntax error before "new"
    
    In file included from C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:34,
                     from main.c:2:
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:521: error: syntax error before "type"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h: In function `ObjectTypeIsValid':
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:524: error: `type' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:524: error: (Each undeclared identifier is reported only once
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:524: error: for each function it appears in.)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h: At top level:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:548: error: `EmfPlusRecordType' undeclared here (not in a function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:548: error: enumerator value for `WmfRecordTypeSetBkColor' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:549: error: enumerator value for `WmfRecordTypeSetBkMode' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:550: error: enumerator value for `WmfRecordTypeSetMapMode' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:551: error: enumerator value for `WmfRecordTypeSetROP2' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:552: error: enumerator value for `WmfRecordTypeSetRelAbs' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:553: error: enumerator value for `WmfRecordTypeSetPolyFillMode' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:554: error: enumerator value for `WmfRecordTypeSetStretchBltMode' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:555: error: enumerator value for `WmfRecordTypeSetTextCharExtra' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:556: error: enumerator value for `WmfRecordTypeSetTextColor' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:557: error: enumerator value for `WmfRecordTypeSetTextJustification' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:558: error: enumerator value for `WmfRecordTypeSetWindowOrg' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:559: error: enumerator value for `WmfRecordTypeSetWindowExt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:560: error: enumerator value for `WmfRecordTypeSetViewportOrg' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:561: error: enumerator value for `WmfRecordTypeSetViewportExt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:562: error: enumerator value for `WmfRecordTypeOffsetWindowOrg' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:563: error: enumerator value for `WmfRecordTypeScaleWindowExt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:564: error: enumerator value for `WmfRecordTypeOffsetViewportOrg' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:565: error: enumerator value for `WmfRecordTypeScaleViewportExt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:566: error: enumerator value for `WmfRecordTypeLineTo' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:567: error: enumerator value for `WmfRecordTypeMoveTo' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:568: error: enumerator value for `WmfRecordTypeExcludeClipRect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:569: error: enumerator value for `WmfRecordTypeIntersectClipRect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:570: error: enumerator value for `WmfRecordTypeArc' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:571: error: enumerator value for `WmfRecordTypeEllipse' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:572: error: enumerator value for `WmfRecordTypeFloodFill' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:573: error: enumerator value for `WmfRecordTypePie' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:574: error: enumerator value for `WmfRecordTypeRectangle' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:575: error: enumerator value for `WmfRecordTypeRoundRect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:576: error: enumerator value for `WmfRecordTypePatBlt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:577: error: enumerator value for `WmfRecordTypeSaveDC' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:578: error: enumerator value for `WmfRecordTypeSetPixel' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:579: error: enumerator value for `WmfRecordTypeOffsetClipRgn' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:580: error: enumerator value for `WmfRecordTypeTextOut' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:581: error: enumerator value for `WmfRecordTypeBitBlt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:582: error: enumerator value for `WmfRecordTypeStretchBlt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:583: error: enumerator value for `WmfRecordTypePolygon' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:584: error: enumerator value for `WmfRecordTypePolyline' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:585: error: enumerator value for `WmfRecordTypeEscape' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:586: error: enumerator value for `WmfRecordTypeRestoreDC' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:587: error: enumerator value for `WmfRecordTypeFillRegion' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:588: error: enumerator value for `WmfRecordTypeFrameRegion' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:589: error: enumerator value for `WmfRecordTypeInvertRegion' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:590: error: enumerator value for `WmfRecordTypePaintRegion' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:591: error: enumerator value for `WmfRecordTypeSelectClipRegion' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:592: error: enumerator value for `WmfRecordTypeSelectObject' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:593: error: enumerator value for `WmfRecordTypeSetTextAlign' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:594: error: enumerator value for `WmfRecordTypeDrawText' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:595: error: enumerator value for `WmfRecordTypeChord' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:596: error: enumerator value for `WmfRecordTypeSetMapperFlags' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:597: error: enumerator value for `WmfRecordTypeExtTextOut' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:598: error: enumerator value for `WmfRecordTypeSetDIBToDev' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:599: error: enumerator value for `WmfRecordTypeSelectPalette' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:600: error: enumerator value for `WmfRecordTypeRealizePalette' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:601: error: enumerator value for `WmfRecordTypeAnimatePalette' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:602: error: enumerator value for `WmfRecordTypeSetPalEntries' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:603: error: enumerator value for `WmfRecordTypePolyPolygon' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:604: error: enumerator value for `WmfRecordTypeResizePalette' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:605: error: enumerator value for `WmfRecordTypeDIBBitBlt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:606: error: enumerator value for `WmfRecordTypeDIBStretchBlt' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:607: error: enumerator value for `WmfRecordTypeDIBCreatePatternBrush' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:608: error: enumerator value for `WmfRecordTypeStretchDIB' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:609: error: enumerator value for `WmfRecordTypeExtFloodFill' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:610: error: enumerator value for `WmfRecordTypeSetLayout' not integer constant
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:611: error: enumerator value for `WmfRecordTypeResetDC' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:612: error: enumerator value for `WmfRecordTypeStartDoc' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:613: error: enumerator value for `WmfRecordTypeStartPage' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:614: error: enumerator value for `WmfRecordTypeEndPage' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:615: error: enumerator value for `WmfRecordTypeAbortDoc' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:616: error: enumerator value for `WmfRecordTypeEndDoc' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:617: error: enumerator value for `WmfRecordTypeDeleteObject' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:618: error: enumerator value for `WmfRecordTypeCreatePalette' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:619: error: enumerator value for `WmfRecordTypeCreateBrush' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:620: error: enumerator value for `WmfRecordTypeCreatePatternBrush' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:621: error: enumerator value for `WmfRecordTypeCreatePenIndirect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:622: error: enumerator value for `WmfRecordTypeCreateFontIndirect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:623: error: enumerator value for `WmfRecordTypeCreateBrushIndirect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:624: error: enumerator value for `WmfRecordTypeCreateBitmapIndirect' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:625: error: enumerator value for `WmfRecordTypeCreateBitmap' not integer constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusEnums.h:626: error: enumerator value for `WmfRecordTypeCreateRegion' not integer constant
    In file included from C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/gdiplus.h:35,
                     from main.c:2:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:22: error: syntax error before string constant
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:24: error: syntax error before "DrawImageAbort"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:24: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:25: error: syntax error before "GetThumbnailImageAbort"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:25: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:75: error: syntax error before "Size"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:75: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:76: error: syntax error before "SizeF"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:76: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:77: error: syntax error before "Point"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:77: warning: data definition has no type or storage class
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:78: error: syntax error before "PointF"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:78: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:79: error: syntax error before "Rect"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:79: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:80: error: syntax error before "RectF"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:80: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:81: error: syntax error before "CharacterRange"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:81: warning: data definition has no type or storage class
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:116: error: syntax error before "SizeF"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:117: error: syntax error before '{' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:124: error: syntax error before '&' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:125: error: 'SizeF' redeclared as different kind of symbol
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:76: error: previous declaration of 'SizeF' was here
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h: In function `SizeF':
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:126: error: `Width' undeclared (first use in this function)
    
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:126: error: `size' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:127: error: `Height' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h: At top level:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:132: error: conflicting types for 'SizeF'
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:125: error: previous definition of 'SizeF' was here
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:132: error: conflicting types for 'SizeF'
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:125: error: previous definition of 'SizeF' was here
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h: In function `SizeF':
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:133: error: `Width' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:134: error: `Height' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h: At top level:
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:137: error: syntax error before "operator"
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:149: error: syntax error before '&' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h: In function `Equals':
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:163: error: syntax error before '}' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:215: error: conflicting types for 'Height'
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:162: error: previous definition of 'Height' was here
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:216: error: syntax error before '}' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:270: error: syntax error before '}' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:323: error: conflicting types for 'Y'
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:269: error: previous definition of 'Y' was here
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:324: error: syntax error before '}' token
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:459: error: parameter `bottom' is initialized
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:459: error: `a' undeclared (first use in this function)
    C:/Program Files/Microsoft Visual Studio 8/Microsoft Platform SDK/Include/GdiplusTypes.h:459: confused by earlier errors, bailing out
    
    make.exe: *** [main.o] Error 1
    
    Execution terminated
    so uh... ? whats wrong? lol thanks for your help



    /*------ Edit ------*/
    after including the lib & include paths in VC++ 2005 EE (i HAVE included such paths in Dev-C++ also) it seems to have no problems with the headers / libs / etc. it just doesn't like my code, lol which makes sense b/c i dont know what i'm doing :] but this is the code i'm trying:
    Code:
    #include <windows.h>
    #include <gdiplus.h>
    
    /*  Declare Windows procedure  */
    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
    
    /*  Make the class name into a global variable  */
    char szClassName[ ] = "WindowsApp";
    
    int WINAPI WinMain (HINSTANCE hThisInstance,
                        HINSTANCE hPrevInstance,
                        LPSTR lpszArgument,
                        int nFunsterStil)
    
    {
        HWND hwnd;               /* This is the handle for our window */
        MSG messages;            /* Here messages to the application are saved */
        WNDCLASSEX wincl;        /* Data structure for the windowclass */
    
        /* The Window structure */
        wincl.hInstance = hThisInstance;
        wincl.lpszClassName = szClassName;
        wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
        wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
        wincl.cbSize = sizeof (WNDCLASSEX);
    
        /* Use default icon and mouse-pointer */
        wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wincl.lpszMenuName = NULL;                 /* No menu */
        wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
        wincl.cbWndExtra = 0;                      /* structure or the window instance */
        /* Use Windows's default color as the background of the window */
        wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
    
    
        /* Register the window class, and if it fails quit the program */
        if (!RegisterClassEx (&wincl))
            return 0;
    
        /* The class is registered, let's create the program*/
        hwnd = CreateWindowEx (
               0,                   /* Extended possibilites for variation */
               szClassName,         /* Classname */
               "Windows App",       /* Title Text */
               WS_OVERLAPPEDWINDOW, /* default window */
               CW_USEDEFAULT,       /* Windows decides the position */
               CW_USEDEFAULT,       /* where the window ends up on the screen */
               544,                 /* The programs width */
               375,                 /* and height in pixels */
               HWND_DESKTOP,        /* The window is a child-window to desktop */
               NULL,                /* No menu */
               hThisInstance,       /* Program Instance handler */
               NULL                 /* No Window Creation data */
               );
    
        /* Make the window visible on the screen */
        ShowWindow (hwnd, nFunsterStil);
    
        /* Run the message loop. It will run until GetMessage() returns 0 */
        while (GetMessage (&messages, NULL, 0, 0))
        {
            /* Translate virtual-key messages into character messages */
            TranslateMessage(&messages);
            /* Send message to WindowProcedure */
            DispatchMessage(&messages);
        }
    
        /* The program return-value is 0 - The value that PostQuitMessage() gave */
        return messages.wParam;
    }
    
    
    /*  This function is called by the Windows function DispatchMessage()  */
    
    LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        switch (message)                  /* handle the messages */
        {
            case WM_CREATE:
                 CreateWindowEx(0, TEXT("STATIC"), TEXT(""), WS_VISIBLE | WS_CHILD | SS_BITMAP,
                   15, 15, 71, 96, hwnd, (HMENU)100, GetModuleHandle(NULL), 0);
                 CreateWindowEx(0, TEXT("BUTTON"), TEXT("Load Image"), WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | WS_TABSTOP,
                   15, 150, 70, 25, hwnd, (HMENU)101, GetModuleHandle(NULL), 0);
                 CreateWindowEx(0, TEXT("BUTTON"), TEXT("Exit"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | WS_TABSTOP,
                   15, 185, 70, 25, hwnd, (HMENU)102, GetModuleHandle(NULL), 0);
            break;
            case WM_COMMAND:
                 switch(LOWORD(wParam))
                 {
                     case 101:
                     {
                          Image *img = Image::FromFile("chick.gif");
                          SendMessage(GetDlgItem(hwnd, 100), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)img);
                     }
                     break;
                     case 102:
                          SendMessage(hwnd, WM_CLOSE, 0, 0);
                     break;
                 }
            break;
            case WM_CLOSE: DestroyWindow(hwnd);    
            case WM_DESTROY:
                PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
                break;
            default:                      /* for messages that we don't deal with */
                return DefWindowProc (hwnd, message, wParam, lParam);
        }
    
        return 0;
    }
    and these are the errors:
    .\main.cpp(93) : error C2065: 'Image' : undeclared identifier
    .\main.cpp(93) : error C2065: 'img' : undeclared identifier
    .\main.cpp(93) : error C2064: term does not evaluate to a function taking 1 arguments
    so is there a tutorial somewhere on using the function? MSDN wasn't much help for me here..
    Last edited by willc0de4food; 01-10-2006 at 02:15 AM.
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    That's probably because GDI+ is a C++ only. Why they've done that I don't know, but either way it'll never work in your C file.

    The cheaters' way to do it is:-
    Code:
    LPPICTURE LoadPicture(char *szFilename)
    {
       LPPICTURE lpPicture;
    
       // This is an OLE function, filename must be in Unicode
    #ifndef UNICODE
       unsigned short wzFilename[MAX_PATH];
       MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, szFilename, -1, wzFilename, MAX_PATH);
    #else
       char *wzFilename;
       wzFilename = szFilename;
    #endif
       if (OleLoadPicturePath(wzFilename, NULL, 0, 0, &IID_IPicture, (void **)&lpPicture) != S_OK)
          return NULL;
    
       return lpPicture;
    }
    And when you want to show it on a DC:-
    Code:
    int iHiWidth, iHiHeight; // gives you size in HIMETRICs
    BITMAP bmp; // pixel size in here
    HBITMAP hbmp;
    
    lpPicture->lpVtbl->get_Width(lpPicture, &iHiWidth);
    lpPicture->lpVtbl->get_Height(lpPicture, &iHiHeight);
    lpPicture->lpVtbl->get_Handle(lpPicture, (OLE_HANDLE *)&hbmp);
    GetObject(hbmp, sizeof(BITMAP), &bmp);
    lpPicture->lpVtbl->Render(lpPicture, hdc, 0, 0, bmp.bmWidth, bmp.bmHeight, 0, iHiHeight, iHiWidth, -iHiHeight, NULL);
    When you're finished with it, remember to:-
    Code:
    lpPicture->lpVtbl->Release(lpPicture);
    Depending on which version of Windows is being used, you may also need to call CoInitialize().
    Last edited by SMurf; 01-10-2006 at 07:34 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  2. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  3. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM