IIs Error

I am using Flexcel version 6.3.0 with intraweb 14.   I have an application that works just fine when it runs as an executable, but when I try to run flexcel under IIS I get the following error.

Error trying to create an empty image of dimensions 1 x 1
and PixelFormat "2498570"  Probably out of memory.

Any ideas?

Hi,


This is a GDI+ error message, and I guees the most likely problem is that it isn't initialized.

When you are running FlexCel from a dll, as in this case, you need to initialize GDI+ from the main application, since Microsoft doesn't allow to initialize GDI+ from a dll.

From http://msdn.microsoft.com/en-us/library/windows/desktop/ms534077(v=vs.85).aspx
Do not call <strong style="color: rgb69, 69, 69; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; line-height: 20px;">GdiplusStartup or <strong ns="http://www.w3.org/1999/">GdiplusShutdown</strong> in DllMain or in any function that is called by DllMain. </strong>

Can you try to call
FlexCelDllInit;
CodeThatUsesFlexCel
FlexCelDllShutdown;

And see if it does any difference?

Adrian Gallero2014-05-28 15:58:01

Thanks.   That fixed the issue.

I am assuming that calling FlexCelDllInit will not negatively affect flexcel being threadsafe?

Hi,

It shouldn't affect it, but I am not 100% on what happens with GDI+ in that environment. I am not expert in IIS / intraweb. The easiest thing to do is to test it: Create 2 files at the same time, and see if there is any GDI+ error message. If there isn't, it should be safe to use.