|
정성훈.해미 님이 답글(37378번)에서 말씀하신 journal에 보니 자세히 설명되어 있을뿐만 아니라 예제까지 있던데요.
1. gdiplus.h를 #include하고
2. 1을 하면 min과 max 함수부분에서 오류가 나므로 gdiplustypes.h 헤더 파일에서 std::min / std::max로 하든지 Gdiplus namespace 초입에서 using std::min; using std::max로 함. 다시 말해, 이 부분에 있어서 잘못되어 있으므로 헤더 파일을 수정해야 함.
3. STRICT를 정의해주어야 함. 즉, Projects->Options->Directories/Conditionals 탭의 conditional defines 입력상자에 STRICT를 입력. 현재 아래의 E2015 오류는 STRICT가 정의되어 있지 않아서 발생한 것임.
4. using namespace Gdiplus; 또는 Gdiplus namespace의 함수를 사용할 때마다 Gdiplus::를 앞에 붙여줌 또는 필요한 변수나 함수만 using으로 선언해줌.
5. static library를 링크해주어야 함. #pragma link "gdiplus.lib"
6. gdiplus를 사용하려면 GdiplusStartup()을, 사용이 모두 끝나면 GdiplusShutdown()을 해주어야 함.
김태선 님이 쓰신 글 :
: 에러 메시지입니다.
:
: [C++ Error] GdiplusGraphics.h(61): E2015 Ambiguity between 'Gdiplus::Graphics::Graphics(void *)' and 'Gdiplus::Graphics::Graphics(void *,int)'
:
: 에러가 난 곳의 헤더파일 일부분입니다.
:
: class Graphics : public GdiplusBase
: {
: public:
: friend class Region;
: friend class GraphicsPath;
: friend class Image;
: friend class Bitmap;
: friend class Metafile;
: friend class Font;
: friend class FontFamily;
: friend class FontCollection;
: friend class CachedBitmap;
:
: static Graphics* FromHDC(IN HDC hdc)
: {
: return new Graphics(hdc); <<=== 요기가 에러를 일으킨 줄입니다.
: }
:
: static Graphics* FromHDC(IN HDC hdc,
: IN HANDLE hdevice)
: {
: return new Graphics(hdc, hdevice);
: }
:
: static Graphics* FromHWND(IN HWND hwnd,
: IN BOOL icm = FALSE)
: {
: return new Graphics(hwnd, icm);
: }
:
: static Graphics* FromImage(IN Image *image)
: {
: return new Graphics(image);
: }
:
: Graphics(IN HDC hdc)
: {
: GpGraphics *graphics = NULL;
:
: lastResult = DllExports::GdipCreateFromHDC(hdc, &graphics);
:
: SetNativeGraphics(graphics);
: }
:
: Graphics(IN HDC hdc,
: IN HANDLE hdevice)
: {
: GpGraphics *graphics = NULL;
:
: lastResult = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics);
:
: SetNativeGraphics(graphics);
: }
:
:
: 보시는 바 같이 별 이상이 없는 것 같은데...
: 참고로 위 헤더파일은 볼랜드 C++Builder설치시 ../include 폴더에 있던 것입니다.
: 분명한 참조인데.. 함수오버로드에서 이 경우말고도 가끔 제대로 못찾는 경우가 있는것 같습니다.
:
: 어떤 문제일까요?
: 컴파일러를 패치해야 할까? (현재 pacth4 적용된 상태)
: 경험 있으시거나 의견이 있으신분 안계신가요?
|