Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unadvise fails in release build

Status
Not open for further replies.

wduty

Programmer
Jun 24, 2000
271
US
Calling Unadvise() in a connection point sink causes an access violation in ReleaseMinDependency build but not in Debug build.
Anyone ever seen this?
--Will Duty
wduty@radicalfringe.com

 
No. I recommend you do a rebuild all and see if that helps. I hate that though - I have had problems in release but not in debug before. I thought debug builds were supposed to be more strict than release builds?
 
Yeah, I tried that and several other things with no avail. Thanks though.

At first I was having a hard time compiling the release build (unresolved external _main). Then I read that taking out _ATL_MIN_CRT would solve the problem which it did. But then I started getting the access violation. So I got rid of all the c functions (especially wcstombs and mbstowcs to which I replaced with USES_CONVERSION macros) but I am still getting the error. I'll keep looking though.

--Will Duty
wduty@radicalfringe.com

 
Did your Advice returned a valable cookie? Maybe your advice failed. John Fill
1c.bmp


ivfmd@mail.md
 
I was checking for before calling unadvise like this:

if(mdwCookie)
{
[tab]mpICP->Unadvise();
[tab]mdwCookie = 0;
}

Also, I was pretty sure the sink was connecting becuase I was receiving notifications from it prior to the access violation. It turned out that there was a subtle twist in the code which allowed for the Unadvise to be called after I had released the object. Two lines of code fixed that and everything works great now.

It's disconcerting that it wasn't showing up in the debug build.

All responses greatly appreciated.
--Will Duty
wduty@radicalfringe.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top