On Windows Server 2003 32-bit, IIS 6.0 I currently have a working ASP classic page successfully using a VB6 DLL to render text as images using many varied fonts (the DLL references GDI+ to render a jpeg of the text in the specified font, etc.):
[working VBScript calling out to a VB6 DLL which calls to GDI+]
Set ig = Server.CreateObject("MyCo.ImageGenerator") 'the DLL
ret = ig.GenerateImage(text, font, size, path, color, italics, bold)
I need to transfer this site to a Windows 2008 or later server. On the new server, GDI+ has an error, specifically at this line in the VB6 DLL code:
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap) 'ret 2 (0 is success)
When I call the same DLL function (i.e. GenerateImage) from a Windows Forms App on the new server, it generates the image with no problem. I don't think it's a permissions issue because:
- the target folder for generated images that the ASP VBScript directs the DLL to has full permissions for "Everyone" (for setup testing only) and
- logging code in the DLL can write to the target directory
- EDIT I (later) gave the Network Service user (the app pool account) read / read-execute permission without seeing a change in behavior (as suggested in a comment by @Lankymart).
I'm confused why the DLL works fine from a Windows Forms app call, but not from within IIS 7.