[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Deveng

9/18/2007 9:30:00 PM

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?



2 Answers

Deveng

9/25/2007 8:25:00 PM

0

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);


"Bob Bins" <deveng@yahoo.com> wrote in message
news:u$aPVsj%23HHA.484@TK2MSFTNGP06.phx.gbl...
>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 Eaton

9/26/2007 2:24:00 AM

0

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



"Bob Bins" <deveng@yahoo.com> wrote in message
news:uZlfsI7$HHA.4200@TK2MSFTNGP04.phx.gbl...
>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);
>
>
> "Bob Bins" <deveng@yahoo.com> wrote in message
> news:u$aPVsj%23HHA.484@TK2MSFTNGP06.phx.gbl...
>>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?
>>
>>
>>
>
>