PC Review


Reply
Thread Tools Rate Thread

C++ ATL control on Excel 2003 VBA form

 
 
=?Utf-8?B?TmljayBHdW5u?=
Guest
Posts: n/a
 
      22nd Nov 2006
I have number of C++ ATL COM controls that I have on a VBA form. I noticed
that in excel (and maybe office in general) the default interface of the COM
component has been augmented with what looks like methods and properties from
MSForms.Control. At least that's how the intellisense makes it look.

1) Can someone explain exactly what's going on here? I assume excel (or VBA)
has dynamically shimmed up some new IDispatch implementation based on the
IDispatch of my COM object and forwards calls that belong to the 'real'
IDispatch onto the COM instance itself. But this is a guess...

2) I have a problem with *one* of these controls, that the others don't seem
to suffer. I can't QI (or Set I guess in VB parlance) to the default
interface of the underlying COM component. I always get type mismatch errors.
For example, I have some interface IFoo implemented by some coclass Foo. Foo
also supports all the other COM control interfaces - or enough to be a
'control' at least. I drop a Foo onto my excel VBA form and call it XFoo.

In some code on the Form I do

Dim LFoo As Foo
Set LFoo = XFoo

and the second line results in a type-mismatch.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Form with Calendar Control - Excel 2002 to 2003 compatibility TRE Microsoft Excel Programming 4 10th Oct 2008 10:04 AM
Ref Edit Control Error Excel 2003 files opening in Excel 2002 =?Utf-8?B?UGF1bCBDb3JkdHM=?= Microsoft Excel Programming 1 15th Nov 2007 09:57 PM
Excel application level control for Excel 2003 Kieran Microsoft Excel Programming 0 12th Nov 2007 07:03 PM
Calendar Control in Excel 2000 can't display date in Excel 2003? =?Utf-8?B?TGV3aXM=?= Microsoft Excel Misc 0 21st Apr 2006 05:07 PM
Bug in Excel 2003 while debugging RefEdit control in form =?Utf-8?B?TWV4YWdl?= Microsoft Excel Programming 0 19th Apr 2005 10:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 AM.