Re: Using MFC ActiveX control in ASP
From: Brett Robichaud (brettrobichaud_at_nospam.yahoo.com)
Date: 09/29/04
- Next message: TenDot: "Setting SelectedDate in <asp:calendar"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Sep 2004 14:00:09 -0700
I figured this out. Turns out to use a basic MFC ActiveX control in ASP you
need to override IsInvokeAllowed() and return TRUE.
Man I hate it when the answer is some subtle little thing like this. I just
blew 5 hrs trying to figure this out before I found the kb article Q146120.
Argh. I was just on the verge of re-writing it in ATL.
-Brett-
"Brett Robichaud" <brettrobichaud@nospam.yahoo.com> wrote in message
news:%23%23oOOElpEHA.1152@TK2MSFTNGP11.phx.gbl...
> It does have an IDispatch interface. Here is the IDL:
> // SimX.idl : type library source for ActiveX Control project.
> // This file will be processed by the MIDL compiler tool to
>
> // produce the type library (SimX.tlb) that will become a resource in
>
> // SimX.ocx.
>
> #include <olectl.h>
>
> #include <idispids.h>
>
> [ uuid(B879589D-FE5D-4602-AEA3-563546B8ACA0), version(1.0),
>
> helpfile("SimX.hlp"),
>
> helpstring("SimX ActiveX Control module"),
>
> control ]
>
> library SimXLib
>
> {
>
> importlib(STDOLE_TLB);
>
> // Primary dispatch interface for CSimXCtrl
>
> [ uuid(7FE57EC8-590F-416E-9842-829258C6A376),
>
> helpstring("Dispatch interface for SimX Control")]
>
> dispinterface _DSimX
>
> {
>
> properties:
>
> [id(1), helpstring("property Prop1")] LONG Prop1;
>
> [id(2), helpstring("property Prop2")] LONG Prop2;
>
> methods:
>
> };
>
> // Event dispatch interface for CSimXCtrl
>
> [ uuid(5D27723A-5B39-4E99-BAE5-04CD9B5225A4),
>
> helpstring("Event interface for SimX Control") ]
>
> dispinterface _DSimXEvents
>
> {
>
> properties:
>
> // Event interface has no properties
>
> methods:
>
> };
>
> // Class information for CSimXCtrl
>
> [ uuid(F3BCCE44-7CFB-47CE-BCFF-88C676FD3B28),
>
> helpstring("SimX Control"), control ]
>
> coclass SimX
>
> {
>
> [default] dispinterface _DSimX;
>
> [default, source] dispinterface _DSimXEvents;
>
> };
>
> };
>
> This is from a plain-jane MFC activeX control. I must be doing something
> simple wrong.
>
> "Kathy" <i_luv_usenet@munged.yahoo.nospam.com> wrote in message
> news:%23PSQy%23kpEHA.3592@TK2MSFTNGP09.phx.gbl...
> > > What do I need to do to make it work in a classic ASP page?
> >
> > It needs a standard COM and/or an IDispatch interface. Does it have
that?
> >
> > - Kathy
> >
> >
>
>
- Next message: TenDot: "Setting SelectedDate in <asp:calendar"
- Messages sorted by: [ date ] [ thread ]