Windows Develop Bookmark and Share   
 index > Windows Forms General > An unhandled exception of type 'System.NullReferenceException'
 

An unhandled exception of type 'System.NullReferenceException'

Hello all,

I am writing a file to generate bitmap file. While i am compiling this program I got no error but, the output isn't right. So I insert a*space
space*point, where I think the internal error might occur. I insert the breakpoint in the line of "f_ptr[i]=fopen(filename_ptr, "rb+");"

Supposingly, it doesnt went through the if statement, because f_ptr[i] is not suppose to be NULL. 



                                                f_ptr[i]=fopen(filename_ptr, "rb+");
if( f_ptr[i] == 0) {
printf("fopen failed\n");
return 0;

}

When I keep pressing F10, then it goes to the "_file.c" and then it give me an error window of:

An unhandled exception of type 'System.NullReferenceException' occurred in bitmap_gen.exe
Additional information: Object reference not set to an instance of an object.


And it happens after this state:

EnterCriticalSection( &(((_FILEX *)pf)->lock) );

If any of you guys have experienced with this and have solved this problem, or have some idea that might  help me solve this problem please email me/ reply this post.

Thank You

Y!
MigrationUser 1  Tuesday, March 16, 2004 11:59 AM
I'm having the same error message when I try to print a form using print document. I do the first time but the next times I'm having the error, I need to use "overrides"  but I don't know how.
MigrationUser 1  Tuesday, March 23, 2004 11:58 AM

You can use google to search for other answers

Custom Search

More Threads

• Null Reference Exception error
• How can I add an uninstaller in the user's desktop shortcut
• Increase/Decrease vertical and horizontal columns
• DataSourceID Property
• Duplicate text in 2 textbox concurrently
• Problem For Textbox Validation
• PrintWindow API call with Windows 2000
• Too Many Handles - Do would YOU code it ?
• Auto Hide Option For ListBox
• Preloaded ImageList control