Solved

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

Posted on 2004-10-09
8
513 Views
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.
0
Comment
Question by:German_N
8 Comments
 
LVL 6

Accepted Solution

by:
nabehs earned 75 total points
Comment Utility
// 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")

0
 

Author Comment

by:German_N
Comment Utility
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.
0
 
LVL 6

Expert Comment

by:nabehs
Comment Utility
ok, try to send it to me to: emadns@yahoo.com
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:nabehs
Comment Utility
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.

0
 

Author Comment

by:German_N
Comment Utility
I'll be trying to send it again later... thanks for taking a care :)
0
 
LVL 12

Assisted Solution

by:OnegaZhang
OnegaZhang earned 25 total points
Comment Utility
THe following is a small VC6 program demonstrating usage of GDI+
www.fruitfruit.com/vc/graphics/img2gif.cpp
0
 
LVL 2

Assisted Solution

by:Ruskialt
Ruskialt earned 25 total points
Comment Utility
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now