Using the CommonDialog ActiveX Control from within an ATL COM dll 
Author Message
 Using the CommonDialog ActiveX Control from within an ATL COM dll

Hi,

I previously wrote a component using ATL technology in C++ that had a browse interface on it allowing users to browse for a specific file to load. When writing a variation of the component in VB (as a means of demonstrating the different methods a third party can write their own versions whilst still keeping to the interface construct) I realised that the browse dialogs were different between both versions. The C++ one uses the CFileDialog class whilst the VB one uses the ActiveX CommonDialog control. In order that I keep the consistency between the versions I decided to try and use the ActiveX Control from within my ATL Component. I tried to instantiate the CommonDialog object through its smart pointer interface. This caused no problem and I could go on to set various properties prior to displaying the dialog. However, when I issue the ShowSave method on the interface I get the following error shown in the debug output pane -

HEAP[ImporterTestHarness.exe]: Heap block at 001490B8 modified at 001490C0 past requested size of 0HEAP[ImporterTestHarness.exe]: Invalid Address specified to RtlFreeHeap(130000, 1490c0 )
First-chance exception in ImporterTestHarness.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.

The Dialog is not displayed and several User breakpoints are encountered. I was wondering if anyone might have any idea what is going on?

JP



Sat, 01 Feb 2003 03:00:00 GMT  
 Using the CommonDialog ActiveX Control from within an ATL COM dll

The OCX uses the file dialog internally - it is all about the flags you
initialize it with... Shortly, don't bother about the OCX in VC...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Hi,

I previously wrote a component using ATL technology in C++ that had a browse
interface on it allowing users to browse for a specific file to load. When
writing a variation of the component in VB (as a means of demonstrating the
different methods a third party can write their own versions whilst still
keeping to the interface construct) I realised that the browse dialogs were
different between both versions. The C++ one uses the CFileDialog class
whilst the VB one uses the ActiveX CommonDialog control. In order that I
keep the consistency between the versions I decided to try and use the
ActiveX Control from within my ATL Component. I tried to instantiate the
CommonDialog object through its smart pointer interface. This caused no
problem and I could go on to set various properties prior to displaying the
dialog. However, when I issue the ShowSave method on the interface I get the
following error shown in the debug output pane -

HEAP[ImporterTestHarness.exe]: Heap block at 001490B8 modified at 001490C0
past requested size of 0HEAP[ImporterTestHarness.exe]: Invalid Address
specified to RtlFreeHeap(130000, 1490c0 )
First-chance exception in ImporterTestHarness.exe (KERNEL32.DLL):
0xE06D7363: Microsoft C++ Exception.

The Dialog is not displayed and several User breakpoints are encountered. I
was wondering if anyone might have any idea what is going on?

JP



Sat, 01 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem using activex control inside ATL com dll

2. Help with Visual Basic ActiveX DLL showing form within Visual C++ ATL app

3. ATL: instantiating a COM object within its own implementation DLL

4. Problem Hosting ActiveX Controls Using ATL AXHost (CAxWindow2) using VC7

5. ATL C++ control using MapPoint ActiveX control

6. Using ActiveX controls in ATL Composite control

7. Using Visual Basic ActiveX dll within C++??

8. Problem using VB 5 activex DLL in a VC++ activex control

9. ActiveX Control within a DLL

10. what is the diffrence between Activex DLL in VB and ATL COM in VC

11. ATL COM - Passing ATL COM classes through another ATL COM class in the same app

12. ATL ActiveX Control hosting code fails to initialize ActiveX Controls on Win9x

 

 
Powered by phpBB® Forum Software