1

I need to redistribute gdiplus.dll v.1.1 with my app and be sure that this particular version is used. E.g. Windows XP has system version of gdiplus.dll but it can be not upgraded (v.1.0). But if I put my gdiplus.dll into application folder, the system one is still used. Why? How to resolve this?

MSDN says:

If you are redistributing GDI+ to a downlevel platform or a platform that does not ship with that version of GDI+ natively, install Gdiplus.dll in your application directory. This puts it in your address space, but you should use the linker's /BASE option to rebase the Gdiplus.dll to prevent address space conflict.

But I have no clue how to rebase gdiplus.dll and for what, anybody can explain this?

[EDIT] Seems Microsoft decided not to ship GDI+ 1.1 for Windows XP, only Vista and so on. Nice move. Thank you all

Daniel DiPaolo
  • 55,313
  • 14
  • 116
  • 115
Andriy Tylychko
  • 15,967
  • 6
  • 64
  • 112

2 Answers2

2

You don't actually need to rebase it. If you don't then the DLL will be rebased automatically whenever it is loaded. This will have a mild impact on start-up speed but I would guess that it won't even be detectable.

However, it seems that you cannot redistibute GDI+ 1.1 to XP: How do I install GDI+ version 1.1 on Windows XP?

Community
  • 1
  • 1
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • so MSDN recommends this only for almost not noticable speedup? and, the main question, how to load specific version of gdiplus.dll that is in my app folder? shouldn't it be default behavior? – Andriy Tylychko Feb 09 '11 at 16:42
  • I'm not sure why MSDN recommends this. It seems odd to me. Put gdiplus.dll in the same folder as your exe, link your exe with the .lib for GDI+ 1.1 and that will be the one that loads. – David Heffernan Feb 09 '11 at 16:43
  • @David: it's not. carefully checked. probably because system version is cached and is used instead of the one in my folder, not sure. – Andriy Tylychko Feb 09 '11 at 17:13
  • 1
    @andy there's no caching that affects which dll gets loaded. Does your app have a manifest that specifies gdiplus version? – David Heffernan Feb 09 '11 at 18:06
  • @David: nope, I simply link with gdiplus.lib – Andriy Tylychko Feb 09 '11 at 19:34
  • @David: actually, seems there's a problem with GDI+ v.1.1 on Windows XP, updating my question – Andriy Tylychko Feb 09 '11 at 22:34
  • MSDN's suggestion to rebase the DLL is a relic of older times. Normally a binary (executable or DLL) is simply mapped into memory and pages are brought in on demand. But if the loader needs to fix up addresses, that effectively causes the entire file to be paged in, even if those pages were never otherwise needed. Multiply this by many DLLs and it could be a significant portion of startup time. Today, we have more RAM, faster disks/SSD, and address space layout randomization (which effectively requires load-time rebasing anyway). – Adrian McCarthy Feb 11 '14 at 14:02
0

Put gdiplus.dll in the same folder as your exe, link your exe with the .lib for GDI+ 1.1 and that will be the one that loads.

First line of code in your app will need to register it. Shell "regsvr32 /s gdiplus.dll"