none
A question for asp(vbscript) on windows 2008. RRS feed

  • Question

  • A question for asp(vbscript) on windows 2008.

    ##the question don't occured on windows 2003.

     

    Question description:
    There is a Dll(Gdi+) file,it is designed to save a picture(bitmap) in a specified directory.

    Use C++ application to call Dll's method, the result is correct
    and a picture is saved in the specified directory.
    But as the same dll and the same parameter, it will be a failure called by asp.

     

    Source section:
    ---------------------------Source1.cpp---------------------
    1-- CSafeObject<HDC> hDC = CreateDC(L"DISPLAY", NULL, NULL, NULL);
          ...
    2-- CSafeObject<HDC> hSrcDc(hDC);
          ..... //Paint bitmap

    3-- return hBitmap;
    -------------------------Source2.cpp-----------------------
    4-- Bitmap image(hBitmap, NULL); //
    5-- Status stat;

    6-- stat = image.save(L"c:\\test.gif", &encoder, NULL); // it will return 2 call by asp.
    7-- if(stat != 0)
         {
             return false;
         }

     

    We try to modify the source code and find the cause.


    Modify line 2 as:
    2--CSafeObject<HDC> hSrcDc = CreateCompatibleDC(hDC);

     

    Then retry the asp page. At line 6, it return 0,
    but the picture is monochrome.

    Tuesday, May 27, 2008 6:00 AM

Answers