Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Visual C++/MFC/WTL > Ошибка при создании Image


Автор: ShurikA 6.3.2006, 10:57
есть вот такой код:
Код

void CChildView::OnFileOpen()
{
    if(!this->GetFileFromUser())
        return;

    imgSize.cx = imgOriginal.GetWidth();
    imgSize.cy = imgOriginal.GetHeight();

    GdiplusStartupInput gdiplusStartupInput;
    ULONG_PTR gdiplusToken;
    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

    UINT size = 0;
    PropertyItem* propertyItem = NULL;
    WCHAR* name = new WCHAR[fileName.GetLength()*2];
    MultiByteToWideChar(CP_ACP, 0, fileName, -1, name, fileName.GetLength()*2);
    Image* tmpImg = new Image(name);

    size = tmpImg->GetPropertyItemSize(PropertyTagImageDescription);

    propertyItem = (PropertyItem*)malloc(size);

    tmpImg->GetPropertyItem(PropertyTagImageDescription, size, propertyItem);

    imgDescription = (WCHAR*)propertyItem->value;

    
    delete tmpImg;
    free(propertyItem);
    GdiplusShutdown(gdiplusToken);

    Invalidate();
    UpdateWindow();
}


выдаёт ошибку вот тут:
Код

Image* tmpImg = new Image(name);


ошибка:
Код

j:\FibIm\ChildView.cpp(101): error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 arguments


не могу понять в чём дело.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)