Jump to content
  • Advertisement
Sign in to follow this  
Zoma

[.net] Stack overflow in mixed-mode dll

This topic is 5413 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

I'm writing a tool for a game engine. The engine is an unmanaged library, and the tool is being written in managed c++. I also have a mixed-mode dll that I use to store my custom controls. I had two treeviews in my tool that did basically the same thing, and I could forsee that several more were to come. The data in my trees corresponds to the data in the game engine (textures, lights, etc). So I decided to make a custom treeview class in my dll. After going through days of pain, I finally got it working correctly. Or so I thought. Most of the code is identical to what was in the original tree. However, I now get a stack overflow caused by an unmanaged function in the engine that deletes an array. The overflow appears to be caused by an infinite loop during the call to delete (not in my code). I've traced all code and my pointers are fine (they all have the same addresses as my instances in my executable). I can move the delete back to the executable and it works fine. I'm 99% sure it is something happening behind the scenes. Does anyone have any idea what causes this? If I can't find a fix I'll just make most of the tree members public and put the delete code in my program (so the treeview class won't be as "complete" as it could be). Thanks

Share this post


Link to post
Share on other sites
Advertisement
Here's a thought:

When I was first making my custom controls, it wouldn't let me add a UserControl to my exe project, so I created a dll. Then I realized that since my treeview is a regular cpp/h file, I could add it to my exe. Will this cause any problems?

Also, I've realized that I could add regular cpp and h files to my exe, but implement a derived class from UserControl there. Will this cause any problems? If it won't, why won't the IDE let you add controls to an exe project?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!