Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > C/C++ программирование > Общие вопросы C/C++
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 11.07.2009, 17:12   #1
Ivan_32
somewhere else
Участник клуба
 
Аватар для Ivan_32
 
Регистрация: 17.07.2008
Сообщений: 1,409
По умолчанию Минимальное GDI+ приложение для MSVS2008

Использую MSVS2008. Мои попытки подключить GDI+ инклуд не увенчались успехом.
Вот такой код:
Код:
#include "stdafx.h"
#include "BaseProject.h"
#include <Windows.h>
#include <WinGDI.h>
#include <GdiPlus.h>
#define MAX_LOADSTRING 100
HINSTANCE hInst;								
INT_PTR CALLBACK DialogProc(HWND,UINT,WPARAM,LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	DialogBox(hInst,MAKEINTRESOURCE(IDD_MAINDLG),0,DialogProc);
	return 0;
}

INT_PTR CALLBACK DialogProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
	switch(wMsg)
	{
	case WM_INITDIALOG:
		return (INT_PTR)TRUE;
	case WM_CLOSE:
		PostQuitMessage(0);
		return (INT_PTR)TRUE;
	}
	return (INT_PTR)FALSE;
}
При попытке компиляции выдает 100+ ошибок о чем сигнализирует:
fatal error C1003: error count exceeds 100
Вопрос в том что я делаю не так? Будет очень интересно посмотреть на компилируемый пример использования GDI+.
"Тяжело в учении, легко в бою" - А.В. Суворов
Ivan_32 вне форума Ответить с цитированием
Старый 11.07.2009, 19:32   #2
counter
Участник клуба
 
Регистрация: 18.10.2008
Сообщений: 1,409
По умолчанию

тык а на что ругается?

я подключал ГДИ так

Код:
#include<GdiPlus.h>
#pragma comment(lib,"Gdiplus.lib")
counter вне форума Ответить с цитированием
Старый 11.07.2009, 20:20   #3
Ivan_32
somewhere else
Участник клуба
 
Аватар для Ivan_32
 
Регистрация: 17.07.2008
Сообщений: 1,409
По умолчанию

Код:
started: Project: BaseProject, Configuration: Release Win32 ------
1>Compiling...
1>BaseProject.cpp
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(74) : error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'
1>        There is no context in which this conversion is possible
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(74) : error C2146: syntax error : missing ';' before identifier 'IImageBytes'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(74) : error C2470: 'IImageBytes' : looks like a function definition, but there is no parameter list; skipping apparent body
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(74) : error C2059: syntax error : 'public'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(280) : error C2146: syntax error : missing ';' before identifier 'id'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusImaging.h(280) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(384) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(395) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(405) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(443) : error C2061: syntax error : identifier 'PROPID'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(444) : error C2061: syntax error : identifier 'PROPID'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(445) : error C2061: syntax error : identifier 'PROPID'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(453) : error C2061: syntax error : identifier 'PROPID'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(471) : error C2535: 'Gdiplus::Image::Image(void)' : member function already defined or declared
1>        c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(384) : see declaration of 'Gdiplus::Image::Image'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(505) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(516) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(758) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(813) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(813) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared
1>        c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(820) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(820) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared
1>        c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(829) : error C2061: syntax error : identifier 'IStream'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(829) : error C2535: 'Gdiplus::Metafile::Metafile(void)' : member function already defined or declared
1>        c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(758) : see declaration of 'Gdiplus::Metafile::Metafile'
1>c:\program files\microsoft sdks\windows\v6.0a\include\GdiplusHeaders.h(855) : error C2061: syntax error : identifier 'IStream'
Это если вкратце. Может быть выложите свой компилируемый шаблон?
В С++ разбираюсь на уровне "Моя твоя не понимать", чувствую что где то у меня ошибка.
"Тяжело в учении, легко в бою" - А.В. Суворов

Последний раз редактировалось Ivan_32; 11.07.2009 в 20:24.
Ivan_32 вне форума Ответить с цитированием
Старый 11.07.2009, 22:30   #4
Goodwin98
equ asm
Участник клуба
 
Аватар для Goodwin98
 
Регистрация: 02.05.2009
Сообщений: 1,605
По умолчанию

Вставь в пустой проект.
Код:
#define UNICODE
#include <windows.h>
#include <gdiplus.h>
#include "resource.h"
#pragma comment(lib,"Gdiplus.lib")
using namespace Gdiplus;


HINSTANCE hInst;								
INT_PTR CALLBACK DialogProc(HWND,UINT,WPARAM,LPARAM);

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
{
	DialogBox(hInst,MAKEINTRESOURCE(IDD_MAINDLG),0,DialogProc);
	return 0;
}

INT_PTR CALLBACK DialogProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
	switch(wMsg)
	{
	case WM_INITDIALOG:
		return (INT_PTR)TRUE;
	case WM_CLOSE:
		PostQuitMessage(0);
		return (INT_PTR)TRUE;
	}
	return (INT_PTR)FALSE;
}
ЗЫ: поиск по мсдн рулит.
Какой вопрос - такой ответ. Не забываем пользоваться поиском, гуглом.
Помощь в выполнении работ по ассемблеру ICQ:2725322O4
Goodwin98 вне форума Ответить с цитированием
Старый 12.07.2009, 15:28   #5
Ivan_32
somewhere else
Участник клуба
 
Аватар для Ivan_32
 
Регистрация: 17.07.2008
Сообщений: 1,409
По умолчанию

Goodwin98, большое спасибо - помогло
Добавлю что кроме всего прочего нужно еще и добавить директиву:
using namespace dllexports;
Что бы использовать функции GDI+.
"Тяжело в учении, легко в бою" - А.В. Суворов
Ivan_32 вне форума Ответить с цитированием
Старый 05.07.2011, 22:18   #6
malor
Форумчанин
 
Регистрация: 23.05.2007
Сообщений: 151
Вопрос

Цитата:
using namespace dllexports;
Что бы использовать функции GDI+.
В примере на MSDN Drawing a Line такой директивы нет. Почему?
malor вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Для облегчения работы с TFS - приложение для работы над дефектами и задачами Аякс Софт 1 18.03.2009 11:43
Приложение для AutoCAD Natali_L. Фриланс 1 09.01.2009 19:25
приложение для работы с 3G модемами. locus_ab Работа с сетью в Delphi 2 04.12.2008 12:06
Минимальное приложение для загрузки файла на FTP Gambler Работа с сетью в Delphi 6 29.01.2008 22:58