• Advertisement
Sign in to follow this  

GDI+ [simple question]

This topic is 3510 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, ive made 2 games in using the GDI and have now managed to create a working GDI+ project but i am confused on 2 things. what do these two lines mean and do?
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR                 gdiplusToken;
Thanks, thats all, everything else i understand. :) ~Reegan

Share this post


Link to post
Share on other sites
Advertisement
You are declaring two variables. The first is a structure that holds input information for GDI, the second is an unsigned long pointer.

Share this post


Link to post
Share on other sites
Quote:
Original post by Portmanteau
You are declaring two variables. The first is a structure that holds input information for GDI, the second is an unsigned long pointer.


erm, would it be possible for a little more information than that? sorry.
i know that the second is an unsigned long pointer but why is it there and what does it actually do behind the scenes? same goes for the first line.

why is the second one called a token?

this code snippets are from the MSDN library under Win32... > GDI+

Share this post


Link to post
Share on other sites
I don't know why it is there, you are only showing that you declare it. Nothing happens except that some memory gets allocated. If they were C++ objects there would be a constructor called, but they aren't, and there isn't.

Share this post


Link to post
Share on other sites
My guess for why you need to supply a token would be because the GDI+ library can be used by several apps at once. So later when you shut down GDI+, the token would tell the library which app is calling so that any data particular to your app can be cleaned up. Again, just a guess.

Share this post


Link to post
Share on other sites
GdiplusStartupInput is a class that lets you customize a few things about the way GDI+ works.

gdiplusToken is a value returned by GdiplusStartup that you need to hang on to and pass back to GdiplusShutdown. It probably keeps track of per-instance info used by GDI+.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement