Connecting Tech Pros Worldwide Help | Site Map

ATL Question

Fredrik Wahlgren
Guest
 
Posts: n/a
#1: Nov 17 '05
Hi

I have used ATL a couple of times to make excel autoamtion add-ins. So far,
I have only made functions that take simple arguments like strings or
integers. I now want to do so something a little more complicted. What I
have in mind requires that one of the parameters is an Excel Range object.
But I don't know how to do this. My guess is that I use something like an
IDispatch pointer and then edit the files manually. When I enter the
function in a cell, I want Excel ro recognize that the parameter should be a
Range

Anty help is appreciated.

/Fredrik


Arnaud Debaene
Guest
 
Posts: n/a
#2: Nov 17 '05

re: ATL Question


Fredrik Wahlgren wrote:[color=blue]
> Hi
>
> I have used ATL a couple of times to make excel autoamtion add-ins.
> So far, I have only made functions that take simple arguments like
> strings or integers. I now want to do so something a little more
> complicted. What I have in mind requires that one of the parameters
> is an Excel Range object. But I don't know how to do this.[/color]
use #import on the Excel tlb to generate a wrapper class around all Excel
types, including Range.

Arnaud
MVP - VC


Fredrik Wahlgren
Guest
 
Posts: n/a
#3: Nov 17 '05

re: ATL Question



"Arnaud Debaene" <adebaene@club-internet.fr> wrote in message
news:%23tyMXou%23EHA.1524@TK2MSFTNGP09.phx.gbl...[color=blue]
> Fredrik Wahlgren wrote:[color=green]
> > Hi
> >
> > I have used ATL a couple of times to make excel autoamtion add-ins.
> > So far, I have only made functions that take simple arguments like
> > strings or integers. I now want to do so something a little more
> > complicted. What I have in mind requires that one of the parameters
> > is an Excel Range object. But I don't know how to do this.[/color]
> use #import on the Excel tlb to generate a wrapper class around all Excel
> types, including Range.
>
> Arnaud
> MVP - VC
>
>[/color]

How do Igenerate wrapper classes? Is there a site which explains how to
proceed? I assume this means I have to use MFC, right?

/Fredrik

/


Arnaud Debaene
Guest
 
Posts: n/a
#4: Nov 17 '05

re: ATL Question


Fredrik Wahlgren wrote:[color=blue]
> "Arnaud Debaene" <adebaene@club-internet.fr> wrote in message
> news:%23tyMXou%23EHA.1524@TK2MSFTNGP09.phx.gbl...[color=green]
>> Fredrik Wahlgren wrote:[color=darkred]
>>> Hi
>>>
>>> I have used ATL a couple of times to make excel autoamtion add-ins.
>>> So far, I have only made functions that take simple arguments like
>>> strings or integers. I now want to do so something a little more
>>> complicted. What I have in mind requires that one of the parameters
>>> is an Excel Range object. But I don't know how to do this.[/color]
>> use #import on the Excel tlb to generate a wrapper class around all
>> Excel types, including Range.
>>
>> Arnaud
>> MVP - VC
>>
>>[/color]
>
> How do Igenerate wrapper classes? Is there a site which explains how
> to proceed?[/color]

As i said, use the #import directive. The doc is here :
http://msdn.microsoft.com/library/de...asp?frame=true
[color=blue]
>I assume this means I have to use MFC, right?[/color]
You assume wrongly...

Arnaud
MVP - VC


Fredrik Wahlgren
Guest
 
Posts: n/a
#5: Nov 17 '05

re: ATL Question



"Arnaud Debaene" <adebaene@club-internet.fr> wrote in message
news:%23poFCcZ$EHA.3124@TK2MSFTNGP11.phx.gbl...[color=blue]
> Fredrik Wahlgren wrote:[color=green]
> > "Arnaud Debaene" <adebaene@club-internet.fr> wrote in message
> > news:%23tyMXou%23EHA.1524@TK2MSFTNGP09.phx.gbl...[color=darkred]
> >> Fredrik Wahlgren wrote:
> >>> Hi
> >>>
> >>> I have used ATL a couple of times to make excel autoamtion add-ins.
> >>> So far, I have only made functions that take simple arguments like
> >>> strings or integers. I now want to do so something a little more
> >>> complicted. What I have in mind requires that one of the parameters
> >>> is an Excel Range object. But I don't know how to do this.
> >> use #import on the Excel tlb to generate a wrapper class around all
> >> Excel types, including Range.
> >>
> >> Arnaud
> >> MVP - VC
> >>
> >>[/color]
> >
> > How do Igenerate wrapper classes? Is there a site which explains how
> > to proceed?[/color]
>
> As i said, use the #import directive. The doc is here :
>[/color]
http://msdn.microsoft.com/library/de...asp?frame=true[color=blue]
>[color=green]
> >I assume this means I have to use MFC, right?[/color]
> You assume wrongly...
>
> Arnaud
> MVP - VC
>[/color]

I think I know how to do this know. I managed to implement an interface
written in C#. And sure enough, there was my Range parameter. I suppose that
if I wanted to create a function "Manually", using the wixzard, I would
select an IDsipatch pointer and then manually change it to Excel::Range. I
think that in VC6, you had to deal with the idl file as well.

/Fredrik


Closed Thread