Error while running with GDI+ in VC++6 application

Posted on 2004-10-09
Last Modified: 2013-11-20
Dear experts,
I've decided to enable my VC++6 with GDI+ graphics. By adding the following code:

typedef unsigned __int64 ULONG_PTR
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment (lib, "Gdiplus.lib")

to stdafx.h, I get the following error:

gdiplus.h(18) : error C2144: syntax error : missing ';' before type 'IDirectDrawSurface7'

I've tried to add the additional code needed to get VC++6 application running with GDI+, but still get the same error.
I'd be greatly appreciated for any suggestion.
Question by:German_N
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

nabehs earned 75 total points
ID: 12270296
// write the following in stdafx.h
// delete the typedef
//typedef unsigned __int64 ULONG_PTR
#include <ddraw.h>
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment (lib, "Gdiplus.lib")


Author Comment

ID: 12274828
Followig your comments:
if I don't define "typedef unsigned __int64 ULONG_PTR" I get the following error: diplusinit.h(32) : error C2065: 'ULONG_PTR' : undeclared identifier. If I do, I get the following error: ddraw.h(38) : error C2144: syntax error : missing ';' before type 'int'.
It would be nice you could take a look at the project, sure if you have vc++6 installed. Probably I miss something basic.

Expert Comment

ID: 12274856
ok, try to send it to me to:
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 12275127
i received  a notification message saying: This notification has been sent to inform you that a message has been deleted .The message subject is GDI+ problem project. Why is this happening? The message you are sending is infected with a virus.


Author Comment

ID: 12275169
I'll be trying to send it again later... thanks for taking a care :)
LVL 12

Assisted Solution

OnegaZhang earned 25 total points
ID: 12293784
THe following is a small VC6 program demonstrating usage of GDI+

Assisted Solution

Ruskialt earned 25 total points
ID: 12324314
Check the order of your include paths in tools->options->directories, make sure that the new sdk paths are listed before anythin else, this goes for includes and for libs. You may hit some wrong (old) files, if the order is incorrect.

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question