BCGSoft Forums
BCGSoft Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 BCGControlBar Pro for MFC Forums
 BCGControlBar Professional Edition
 CBCGPDialog destructor throws exception
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Thiru_BCGSoft

5 Posts

Posted - 08/11/2021 :  3:29:07 PM  Show Profile  Visit Thiru_BCGSoft's Homepage  Reply with Quote
Hi, I am trying to integrate Desktop notification into my application per sample provided at https://bcgsoft.com/featuretour/tour192.htm. I am getting the below error:

Unhandled exception at <hex address> in <my appl>.exe: 0xC000041D: An unhandled exception was encountered during a user callback.

When I checked the "Call Stack", seeing the below entries there.

ATL::CStringData::Release()
ATL::CSimpleStringT<char,0>::~CSimpleStringT<char,0>()
ATL::CStringT<char,strTraitMFC<char,ATL::ChTraitsCRT<char>> destrcutor
CBCGPDialog::~CBCGPDialog()
CBCGPPopupDlg::~CBCGPPopupDlg()

I haven't used any dynamic memory allocation except CMyPopupWindow as it is there in the sample.

Is any member of CBCGPPopupDlg/ CBCGPDialog missed to be initialized?. Please provide me your valuable suggestions. Thanks!

Support

4187 Posts

Posted - 08/11/2021 :  11:05:00 PM  Show Profile  Visit Support's Homepage  Reply with Quote
Hi,

Please take a look at our forum rules:
https://bcgsoft.com/cgi-bin/forum/topic.asp?TOPIC_ID=8230

3. If the problem cannot be reproduced in our examples/samples, please open a new support ticket (http://support.bcgsoft.com/) and attach your sample where we can see the problem.

Best regards,

BCGSoft Technical Support
Go to Top of Page

Thiru_BCGSoft

5 Posts

Posted - 08/17/2021 :  3:42:05 PM  Show Profile  Visit Thiru_BCGSoft's Homepage  Reply with Quote
Hi,

I am unable to reproduce the error in the examples/samples. I tried as a sample Dialog based application which is derived from CBCGPDialog and seeing it is working fine. When I integrate the same piece of code into our project , I am getting the above error with CBCGPDialog() destructor.

Is there any problem with Project Settings? Do I need to specify in the Project Configuration Settings to resolve this issue.

Is there any problem with Visual Studio, MFC version, etc.,??

Because, the project development started in VC++ 6.0 in a decade before. But, now a days the project is getting compiled in VS2010 and working.

Please let me know if you need any information regarding the project setting/Compiler option and help to resolve the issue with CSimpleStringT destructor issue.
Go to Top of Page

Support

4187 Posts

Posted - 08/17/2021 :  8:55:12 PM  Show Profile  Visit Support's Homepage  Reply with Quote
Please verify that you have the default (8) byte alignment in your project settings.

BCGSoft Technical Support
Go to Top of Page

Thiru_BCGSoft

5 Posts

Posted - 08/18/2021 :  11:33:23 AM  Show Profile  Visit Thiru_BCGSoft's Homepage  Reply with Quote
Hi, I checked Project Properties -> C/C++ -> Code Generation -> Struct Member Alignment has "Default" entry. I checked with 8 Bytes( /Zp8 ) and 16 Bytes( /Zp16 ) too. Getting the issue as below:

Unhandled exception at <hex address> in <my appl>.exe: 0xC0000005: Access violation reading location <hex address>.

The "Call Stack" is the same as mentioned earlier in the topic.

When I debugged further in "BCGPDialog" destructor, the following assembly statement throws the error:

call ATL::CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT<char> > >::~CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT<char> > > (1CD9D00h)

Please provide your valuable suggestion to resolve this blocker issue as it will be very much helpful for customizing many dialogs in the project.
Go to Top of Page

Support

4187 Posts

Posted - 08/18/2021 :  10:52:06 PM  Show Profile  Visit Support's Homepage  Reply with Quote
Hi,

Please take your project, remove from it all files except application class and dialog and attach it to support ticket.

We cannot figure out what's going wrong in your specific project without repro sample.

Best regards,

BCGSoft Technical Support
Go to Top of Page

Thiru_BCGSoft

5 Posts

Posted - 08/20/2021 :  3:53:11 PM  Show Profile  Visit Thiru_BCGSoft's Homepage  Reply with Quote
Hi, I have found #pragma pack(1) in one of the important header file in the project. I have commented-out it and run the application. It is working fine and not seeing the exception/error had thrown by CBCGPDialog.

I would like to check with you that any side-effect will be there by commenting-out the "pragma pack" directive in terms of memory-leak, message passing, memory-corruption, data-loss, etc.,

Please advice/suggest on the above. Thanks!
Go to Top of Page

Support

4187 Posts

Posted - 08/22/2021 :  05:35:38 AM  Show Profile  Visit Support's Homepage  Reply with Quote
You may use the following code in your stdafx.h:

#pragma pack(push, 8)
#include <BCGCBProInc.h>
#pragma pack(pop)

BCGSoft Technical Support
Go to Top of Page

Thiru_BCGSoft

5 Posts

Posted - 08/24/2021 :  1:20:38 PM  Show Profile  Visit Thiru_BCGSoft's Homepage  Reply with Quote
I have used the suggested code and seeing the application is working fine without any issue. I have checked with most of the dialogs in the application and seeing them working fine.

Thank you for your valuable support and back to back responses to resolve this issue.

Thanks a lot to the Support Team. Keep up the great work!
Go to Top of Page

Support

4187 Posts

Posted - 08/25/2021 :  03:11:20 AM  Show Profile  Visit Support's Homepage  Reply with Quote
Thanks for the feedback!

Please feel free to contact us for further assistance.

Sincerely yours,

BCGSoft Technical Support
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To:
BCGSoft Forums © Copyright (c) 1998-2022 BCGSoft Co Ltd Go To Top Of Page
Snitz Forums 2000