Jestli máte někdo zkušenost s Visual Studio C++ 2010 potřeboval bych poradit.
Dostávám tuto chybu:
K řádku:
GpBitmap* pBitmap;
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
a k dalšímu řádku:
HBITMAP bitmap;
C2380: type(s) preceding 'bitmap' (constructor with return type, or illegal redefinition of current class-name?)
Oba typy by měly být známé, protože v jiném programu kde to používám (ale mimo třídu, v hlavní funkci main) to funguje. Takže gdiplus mám includovaný i windows mám includocaný kvůli HBITMAP.
#include "stdafx.h"
#include "filework.h" // GetEncoderClsid
#include <windows.h> // HBITMAP needs this
#include <gdiplus.h> // GdipSaveImageToFile needs this
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <fstream>
#include <tchar.h>
using namespace std;
class bitmap {
private:
int result;
GpBitmap* pBitmap;
HBITMAP bitmap;
void printError(int Bitmap::result){
cout << "Error:" . result << "\n";
}
public:
bool saveFile(GpBitmap *pBitmap, string *pFilename){
result = Gdiplus::DllExports::GdipSaveImageToFile(bitmap::pBitmap, bitmap::pFilename, &pngClsid, NULL);
if (result != 0)
printError(result);
};
};