My application crashes when I open Word! (System.NullReferenceException)

G

Graeme Neath

I'm having a very bizarre problem. I have a vb.net application which uses
the ESRI MapObjects 2.2 component (unmanaged code). When I use the
MapObjects built-in function 'CopyMap' to copy the map to the clipboard my
app will crash sometimes.

Even stranger, sometimes if I copy the map to the clipboard (and my app
doesnt crash immediately), if I then launch Word my app will spontaneously
crash!

The CopyMap function takes a parameter 'scale' to determine how accurate an
image to put into the clipboard. It appears that a scale of 2 is ok, but
anything larger than that causes the problem. Is there a maximum size of
object that I can safely put in the clipboard?


In both cases I get the following error and stack trace:


An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll

Additional information: Object reference not set to an instance of an
object.


system.windows.forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0x13 bytes
system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0x2e8 bytes
system.windows.forms.dll!System.Windows.Forms.AxHost.WndProc(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0x34e bytes
system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0x13 bytes
system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
hWnd = 20449702, int msg = 15, int wparam = 0, int lparam = 0) + 0x3d bytes
system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(int
dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason
= -1, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1,
System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes
system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form
mainForm = {link.Splash}) + 0x34 bytes
link.exe!link.aspSplash.Main() Line 3 + 0x1d bytes Basic



I would be most grateful for any insights!

Cheers
Graeme Neath
 
G

Graeme Neath

Graeme Neath said:
I'm having a very bizarre problem. I have a vb.net application which uses
the ESRI MapObjects 2.2 component (unmanaged code). When I use the
MapObjects built-in function 'CopyMap' to copy the map to the clipboard my
app will crash sometimes.

It turns out that the image that I was saving to the clipboard was massive
(about 15000x10000 pixels at 16 million colours - or 450MB as a
non-compressed bitmap!!). This is rather extravagant and must be the root of
the problem!
 
P

Phill. W

Graeme Neath said:
... the image that I was saving ... was massive ... 450MB as a
non-compressed bitmap!!). This is rather extravagant

Nonsense!
Just have all your users upgrade to bigger and better PC's ...

;-}}

Regards,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top