Click here to Skip to main content
15,903,540 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to get the system IP address in mfc Pin
Iain Clarke, Warrior Programmer21-Oct-08 3:47
Iain Clarke, Warrior Programmer21-Oct-08 3:47 
QuestionRegarding string conversion Pin
H4u3221-Oct-08 3:25
H4u3221-Oct-08 3:25 
AnswerRe: Regarding string conversion Pin
Iain Clarke, Warrior Programmer21-Oct-08 3:45
Iain Clarke, Warrior Programmer21-Oct-08 3:45 
GeneralRe: Regarding string conversion Pin
H4u3221-Oct-08 3:52
H4u3221-Oct-08 3:52 
GeneralRe: Regarding string conversion Pin
Cedric Moonen21-Oct-08 4:42
Cedric Moonen21-Oct-08 4:42 
GeneralRe: Regarding string conversion Pin
Mark Salsbery21-Oct-08 4:58
Mark Salsbery21-Oct-08 4:58 
GeneralRe: Regarding string conversion Pin
H4u3221-Oct-08 5:09
H4u3221-Oct-08 5:09 
QuestionCrashes on application exit while hosting an VB ActiveX Control providing UI in a MFC application Pin
Martin081521-Oct-08 2:06
professionalMartin081521-Oct-08 2:06 
Hello,

perhaps somebody can help me to find the reason for the crashes I have.

I have a MFC Application with MFC extension DLLs.
One of the dialogs is a window with a CPropertySheet.
One CPropertyPage is a host for ActiveX Controls providing extending UI.
This CPropertyPage has a CWnd member to host the ActiveX Controls dynamically created runtime using the CWnd::CreateControl method.

I have a VB ActiveX Control providing needed extending UI.
It can be loaded and used without problems.
The only problem occurs, when the application exits:
1. The CPropertySheet is destroyed ... the CPropertyPage is destroyed, ...
... which releases its previously queried interfaces,
... sends a WM_DESTROY to the CWnd hosting the ActiveX Control and
... deletes/frees the CWnd
2. Somewhere at the end just before invoking "exit" open "OLE" connections/loaded "OLE" libraries are terminated by Microsoft internal code. I saw that the ActiveX OCX module was active until this moment.
3. In the "exit" invocation the MFC application crashes from within the VB ActiveX Control. The VB ActiveX Control does not execute its UserControl_Terminate handler, so it seems, that there happens an irregular deletion of the VB ActiveX Control.

This crash happens currently only in the debug version of our application. But adding CommonControls to the VB ActiveX Control UI causes a crash even in the release version of this MFC application.

Using a MFC ActiveX Control providing some UI, too, no problems occur.

The only difference seen while releasing the last reference to the previously queried interface are that ...
... the release on the interface of VB ActiveX Control returns 4 still valid references,
... while the release on the interface of the MFC ActiveX Control returns only 3 still valid references.

Thus I suspect, that at application end there is still a last reference valid, not released, which causes a crash after the OCX is unloaded from Microsoft internal code cleaning up before the real application exit.
Something in the VB ActiveX Control wants still to work (like executing UserControl_Terminate), but the OCX is already unloaded.

But ... where and how can I find this last reference?

Debugging through the MFC code hosting the ActiveX Control didn't help really?

Has somebody here experienced a similar problem? Or can somebody help?

Thanks in advance,

Martin
AnswerRe: Crashes on application exit while hosting an VB ActiveX Control providing UI in a MFC application Pin
Martin081522-Oct-08 4:47
professionalMartin081522-Oct-08 4:47 
GeneralSolved - Re: Crashes on application exit while hosting an VB ActiveX Control providing UI in a MFC application Pin
Martin081528-Oct-08 23:07
professionalMartin081528-Oct-08 23:07 
Questionwant to use some vc++ code in place of system call... Pin
m_mun21-Oct-08 2:00
m_mun21-Oct-08 2:00 
AnswerRe: want to use some vc++ code in place of system call... Pin
Rajesh R Subramanian21-Oct-08 2:02
professionalRajesh R Subramanian21-Oct-08 2:02 
JokeRe: want to use some vc++ code in place of system call... Pin
CPallini21-Oct-08 2:57
mveCPallini21-Oct-08 2:57 
GeneralRe: want to use some vc++ code in place of system call... Pin
Rajesh R Subramanian21-Oct-08 3:08
professionalRajesh R Subramanian21-Oct-08 3:08 
GeneralRe: want to use some vc++ code in place of system call... Pin
CPallini21-Oct-08 3:13
mveCPallini21-Oct-08 3:13 
JokeRe: want to use some vc++ code in place of system call... Pin
Rajesh R Subramanian21-Oct-08 3:17
professionalRajesh R Subramanian21-Oct-08 3:17 
GeneralRe: want to use some vc++ code in place of system call... Pin
SandipG 21-Oct-08 3:18
SandipG 21-Oct-08 3:18 
JokeRe: want to use some vc++ code in place of system call... Pin
CPallini21-Oct-08 6:15
mveCPallini21-Oct-08 6:15 
QuestionHow can a Bitmap resize as Dialog Resize? Pin
Le@rner21-Oct-08 1:51
Le@rner21-Oct-08 1:51 
QuestionRe: How can a Bitmap resize as Dialog Resize? Pin
CPallini21-Oct-08 2:46
mveCPallini21-Oct-08 2:46 
QuestionSpeed issue when using CArray. Pin
KASR121-Oct-08 1:34
KASR121-Oct-08 1:34 
AnswerRe: Speed issue when using CArray. Pin
toxcct21-Oct-08 1:40
toxcct21-Oct-08 1:40 
GeneralRe: Speed issue when using CArray. [modified] Pin
KASR121-Oct-08 2:06
KASR121-Oct-08 2:06 
GeneralRe: Speed issue when using CArray. Pin
Alan Balkany21-Oct-08 3:58
Alan Balkany21-Oct-08 3:58 
GeneralRe: Speed issue when using CArray. Pin
KASR121-Oct-08 18:01
KASR121-Oct-08 18:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.