News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GDI+ scribble

Started by donkey, February 12, 2010, 09:09:51 AM

Previous topic - Next topic

donkey

Quote from: BlackVortex on February 12, 2010, 08:04:54 PM
I found a gdiplus.dll versioned 6.1.xxx and put it on my XP installation in the same folder, but still same error.

Works fine on win7x64 of course. I'm talking about the link in the first post.

How can I tell the windows loader to use that dll ? Do I have to register something, somehow ?

Hi,

That is a limitation in manifest files as described here, please read through the article, it will help you solve most manifest and SxS issues:

http://www.masm32.com/board/index.php?topic=13348.0

You would require a different manifest for it, you can always alter the manifest to include <file name = "gdiplus.dll"/> and recompile the rc and assembler the project to make it work if you like. This was a just a small test of GDI+, I knew about the issues in versioning which is why the original has WINVER set to VISTA and not the default XP, I should really have mentioned that it was only sporadically compatible with XP in the original post, sorry.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

BlackVortex

Your current manifest is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="GdipScribble" type="win32"/>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
            <security>
                  <requestedPrivileges>
                        <requestedExecutionLevel level="asInvoker" />
                  </requestedPrivileges>
            </security>
      </trustInfo>
      <dependency>
          <dependentAssembly>
              <assemblyIdentity
                  type="win32"
                  name="Microsoft.Windows.Common-Controls"
                  version="6.0.0.0"
                  language="*"
                  processorArchitecture="x86"
                  publicKeyToken="6595b64144ccf1df"
              />
          </dependentAssembly>
      </dependency>
      <dependency>
          <dependentAssembly>
              <assemblyIdentity
                  type="win32"
                  name="microsoft.windows.gdiplus"
                  version="1.1.0.0"
                  language="*"
                  processorArchitecture="x86"
                  publicKeyToken="6595b64144ccf1df"
              />
          </dependentAssembly>
      </dependency>
</assembly>

What would be the correct one ?

donkey

Hi BlackVortex,

Leaving the GDI+ dependency will force the loader to look only in the SxS folder for a version of the DLL that meets your needs. If you want to use a DLL in your app folder you have to change the manifest as detailed here:

http://www.masm32.com/board/index.php?topic=13348.0

If you read the last section:

QuoteNow, what if you want to ensure that your version of the DLL is exactly the one used ? Well, if its redistributable no problem, you have simply to include it with your distribution. But you ask, won't Windows go looking for the highest version above my requirements and use that instead ? Yes, it will, so we need to use a different manifest if we are distributing the DLL in our application folder, in this case we'll assume that we have shipped GDIPLUS.DLL with the application and we need that particular one:

The example manifest that follows will work for you in this case (change the program name). Then recompile the RC file and reassemble the project and it should work fine.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Yuri

Quote from: donkey on February 12, 2010, 08:03:08 PM
Hi Yuri,

Dependency Walker is a great utility to search for things like that, I use it a lot when I get mysterious failures like that.

Thanks, in fact I already have it installed but have completely forgotten about that.  :toothy

BlackVortex

Arrgh, still couldn't get it to work on XP. But I was bored to recompile it and I just resource hacked the new manifest in it. It works on win7, but gave a side-by-side... error on XP as before. Anyway, I was just fooling around.
If I resource-hack-delete the manifest resource, then I get a GdipInitialize..blahblah... procedure entry missing on my XP installation. Maybe the gdiplus.dll I fished from my win7 installation sucks ? It's version 6.1 and weighs in at 1.54mb

By the way, PeCompact can compress gdiplus.dll to 663kb and UPX to 656kb ! 41% of original, not bad.  :green

donkey

Try this, this is the last I am tackling with this problem, the app is Vista and above though this should work on XP. You need to copy gdiplus.dll version 1.1 (dll version 6.0 or greater) into the application folder.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

An interesting thing, I was just trying was to see if there was a faster way to lock the bits and it seems that GdipBitmapLockBits accepts NULL for the region so there is no need to pass the RECT if you just want to lock the entire bitmap...

invoke GdipBitmapLockBits,[pPic],NULL,ImageLockModeWrite,PixelFormat32bppARGB,offset bmd

This is undocumented behavior however.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

There seems to be a problem when editing zoomed images, there is an artifact in the image that survives even when it is saved so it is not a problem with the zooming process but with garbage being written to the buffer returned by GdipBitmapLockBits. I can't figure out what is wrong though, this image was zoomed 4x then edited, only one pixel was drawn (a red one) then saved...



Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ecube

I can't even find gdiplus 6.* anywhere(besides massive SDK), I only have 5.13 and it complains about gdiinitzliepalette not existing. anyway I give up

dedndave

Cube - i think it depends on which OS you have
i am using xp pro and have version 5's also
6 seems to be a vista and/or win7 thing
i don't think you can just transplant GdiP 6 into xp   :bg

donkey

#25
Quote from: dedndave on February 13, 2010, 04:54:13 AM
Cube - i think it depends on which OS you have
i am using xp pro and have version 5's also
6 seems to be a vista and/or win7 thing
i don't think you can just transplant GdiP 6 into xp   :bg

Though GDI+ version 1.1 is redistributable down to Win98 you should never replace the version in \System32. If it has not been installed in the Side by Side folder then you have to include it in the application folder and include a special manifest. Both Windows Vista and Win7 have version 1.0 in System32 though they have 1.1 as a side by side in all versions. For example my laptop (which I'm on right now), is a Vista box with version 5.2.6002.18005 in System32.

about 900K

<File removed, you can get it from the power point viewer here>

Get it fast I am not hosting this file forever...

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

thanks much, Edgar
now, let me figure out the right way to install it   :P

ecube

now it says "the procedure entry point _except_handler4_common could not be located in the dynamic link library msvcrt.dll"

lol...i'll just test in win7 in vmware

dedndave

it appears i need the CAT file, the manifest file in WinSxs, and some registry entries
i don't suppose there is an INF file someplace
there has to be a right way to do this - lol
i wonder if updating DirectX would update GdiPlus

dedndave

this may be it
http://support.microsoft.com/KB/958911

KB958911 for XP
http://www.microsoft.com/downloads/details.aspx?FamilyId=3296f213-4c70-4616-8375-7d20af9843c5&displaylang=en

well - that got me version 5.2.6001.22290

that tells me there may be a newer ms KB to get the job done   :8)