Jump to content
  • Advertisement
Sign in to follow this  
AndrewPL

"Object reference not set to an instance of an object" ?

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! The sample from MS-SDK "skinned mesh" is using "dxstdafx.h" library. I've managed to raplace functions from that library by those used in standard tutorials. It compiled OK but then I wanted to make a new project from the beginning I recived this error: An unhandled exception of type 'System.NullReferenceException' occurred in test.exe Additional information: Object reference not set to an instance of an object. Why this error ocure if I'm using the same code? I think the problem is related to precompiled header becouse even when I removed everything from "dxstdafx.h" I still couldn't remove the line #include "dxstdafx.h" becouse of error: fatal error C1010: unexpected end of file while looking for precompiled header directive Is it possible that compiler is using different functions from precompiled header that are defined in source code? thx for reading and help if any.

Share this post


Link to post
Share on other sites
Advertisement
Precompiled headers are activated on the project's property pages. Try looking a little bit, there is an option to disable precompiled headers. Also, a NullReferenceException is thrown when you failed to initialize an object (you are using a non-initialized one). Try spotting which object failed to load/wasn't loaded at runtime.

Share this post


Link to post
Share on other sites
Hi there AndrewPL,
How are you doing?

[What does this mean?]
"Object reference not set to an instance of an object"
More often than not is that you are trying to use a reference variable who's value is null or not set.

[The solution?]
Try and check if the values that you are using are not null/nothing. You are likely using/passing variables to a method that still have null/nothing assigned to them.


Hope this helps :)

Share this post


Link to post
Share on other sites
the problem is that debuger shows en error in that line:

if (pFrame->pMeshContainer != NULL){SetupBoneMatrixPointersOnMesh(pFrame->pMeshContainer);}

this code first checks if the reference is NULL so why the error??

Share this post


Link to post
Share on other sites
When I usually get that error it seems that I haven't declared something as 'New' when I am supposed to...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!