[.net] Stack overflow in mixed-mode dll
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
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?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement