Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2007

Tip: Looking for answers? Try searching our database.

Stack overflow help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Bins - 18 Sep 2007 22:30 GMT
I am getting a strange System.StackOverflowException exception when my COM
object fires an event in to my .net code.

The call stack is only about 10 items longs so its not the standard infinite
loop.  What else would cause this?  Is there a way to see how much stack
space is taken up and what it contains?

Does anyone have any tips that might help me debug this?
Bob Bins - 25 Sep 2007 21:24 GMT
I was able to stop the error by removing the use of the below ATL/COM
functions from my COM object.  I guess since W2A uses the stack it
contributed to the problem.  I am not to sure what the CComBSTR class had to
do with it but  I replaced the code with custom objects/functions and all is
good.

CComBSTR
USES_CONVERSIONS;
W2A(X);

>I am getting a strange System.StackOverflowException exception when my COM
>object fires an event in to my .net code.
[quoted text clipped - 4 lines]
>
> Does anyone have any tips that might help me debug this?
Bob Eaton - 26 Sep 2007 03:23 GMT
FYI, the newer version of those conversion macros doesn't rely on the stack.
If you're using VS.Net 2002, I think there's a bug in that it doesn't
allocate a big enough buffer for the potential conversion (it used 3x
instead of 4x or something, which caused us a problem at one time). VS.Net
2003 (or 5, I forget which) fixed this and now will allocate the right size
automatically by calling WC2MB first to ask for the full length.

If you're using one of these versions of the compiler, you can look up
"CW2A" for the newer version.

Bob

>I was able to stop the error by removing the use of the below ATL/COM
>functions from my COM object.  I guess since W2A uses the stack it
[quoted text clipped - 14 lines]
>>
>> Does anyone have any tips that might help me debug this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.