Click here to Skip to main content
16,005,491 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: using classes Pin
Hamid_RT16-Oct-07 19:20
Hamid_RT16-Oct-07 19:20 
QuestionNeed serialize/deserialize container class to/from XML. Pin
oleg6316-Oct-07 9:33
professionaloleg6316-Oct-07 9:33 
AnswerRe: Need serialize/deserialize container class to/from XML. Pin
indigox317-Oct-07 3:44
indigox317-Oct-07 3:44 
QuestionGDI+ initialization Pin
indigox316-Oct-07 9:16
indigox316-Oct-07 9:16 
AnswerRe: GDI+ initialization Pin
led mike16-Oct-07 9:43
led mike16-Oct-07 9:43 
GeneralRe: GDI+ initialization Pin
indigox316-Oct-07 9:53
indigox316-Oct-07 9:53 
GeneralRe: GDI+ initialization Pin
led mike17-Oct-07 4:44
led mike17-Oct-07 4:44 
AnswerRe: GDI+ initialization Pin
Mark Salsbery16-Oct-07 9:58
Mark Salsbery16-Oct-07 9:58 
I don't know. 

The docs state:

"You must call GdiplusStartup before you create any GDI+ objects,
and you must delete all of your GDI+ objects (or have them go out
of scope) before you call GdiplusShutdown.
"

Although there's a token associated with each startup/shutdown pair,
the token (or any other context) isn't used when working with GDI+
objects.  That means there's no internal context relating created GDI+
objects with a GdiPlusStartup() call.

If I had to guess, I'd say it will work fine - the DLL is probably released
when the last token is returned to GdiPlusShutdown().  It's not documented,
however, so that's a complete assumption, and relying on that assumption
could be disastrous in the future..

To be safe, I personally chose (and still choose) to do this pair of calls ONCE
for an entire application.

This can be done with a singleton class wrapping the gdiplus dll (may fit nice with
your wrapper class), or simply calling the startup/shutdown functions during app
initialization/cleanup.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: GDI+ initialization Pin
indigox317-Oct-07 3:41
indigox317-Oct-07 3:41 
GeneralRe: GDI+ initialization Pin
led mike17-Oct-07 4:43
led mike17-Oct-07 4:43 
AnswerRe: GDI+ initialization Pin
Randor 16-Oct-07 10:28
professional Randor 16-Oct-07 10:28 
GeneralRe: GDI+ initialization Pin
Mark Salsbery16-Oct-07 10:31
Mark Salsbery16-Oct-07 10:31 
GeneralRe: GDI+ initialization Pin
indigox317-Oct-07 3:38
indigox317-Oct-07 3:38 
QuestionProblem on MM_HIMETRIC mode with different video cards Pin
JibJeab16-Oct-07 6:12
JibJeab16-Oct-07 6:12 
AnswerRe: Problem on MM_HIMETRIC mode with different video cards Pin
Iain Clarke, Warrior Programmer17-Oct-07 5:36
Iain Clarke, Warrior Programmer17-Oct-07 5:36 
QuestionPrint an image file on default printer from c++ application Pin
ShilpaPotnis16-Oct-07 5:27
ShilpaPotnis16-Oct-07 5:27 
AnswerRe: Print an image file on default printer from c++ application Pin
led mike16-Oct-07 5:46
led mike16-Oct-07 5:46 
GeneralRe: Print an image file on default printer from c++ application Pin
ShilpaPotnis16-Oct-07 5:54
ShilpaPotnis16-Oct-07 5:54 
GeneralRe: Print an image file on default printer from c++ application Pin
led mike16-Oct-07 6:05
led mike16-Oct-07 6:05 
GeneralRe: Print an image file on default printer from c++ application Pin
ShilpaPotnis16-Oct-07 6:12
ShilpaPotnis16-Oct-07 6:12 
QuestionHow do you set the text color for a static label? Pin
littleGreenDude16-Oct-07 5:14
littleGreenDude16-Oct-07 5:14 
QuestionRe: How do you set the text color for a static label? Pin
David Crow16-Oct-07 5:21
David Crow16-Oct-07 5:21 
AnswerRe: How do you set the text color for a static label? Pin
littleGreenDude16-Oct-07 5:43
littleGreenDude16-Oct-07 5:43 
GeneralRe: How do you set the text color for a static label? Pin
David Crow16-Oct-07 5:52
David Crow16-Oct-07 5:52 
GeneralRe: How do you set the text color for a static label? Pin
littleGreenDude16-Oct-07 6:13
littleGreenDude16-Oct-07 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.