Using MFC ActiveX control in ASP

Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default Using MFC ActiveX control in ASP

    I'm using VS.Net 2003 to create a very simple ActiveX control in MFC. The
    control has no ui and just a few properties and methods.

    What do I need to do to make it work in a classic ASP page? Currently any
    time I try to set a property on my control {after calling 'Set obj =
    Server.CreateObject(...)'} I get this error:

    Error Type: (0x8000FFFF) Catastrophic failure

    I can successfully use my control from a C# Winforms app.

    What am I missing?

    -Brett-


    Brett Robichaud Guest

  2. Similar Questions and Discussions

    1. ActiveX Control in C#
      Hi, I am trying to create a program similar to the BasicIacOCXCS sample. I have tried to look though the IACRefrence pdf but haven't been able to...
    2. Help with Activex control
      :I try to build a web site with flash pictures. The problem is this activex control yellow bar that users might not want to click on when visiting...
    3. User Control and ActiveX control
      Now I am hosting a user control(an assembly in .dll) in IE. I want to know the difference between this kind of control and ActiveX control. thank...
    4. develop activex control in c# .net
      Hi, I've read the article on “Writing an ActiveX Control in .NET” from c-sharpcorner.com and have succeeded in creating the simple textbox...
    5. HELP: ActiveX Control on webform
      I am going to use an ActiveX control on my webform. 1. How can I set it up so that if a user views the web page and doesn't have the ActiveX...
  3. #2

    Default Re: Using MFC ActiveX control in ASP

    > 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


    Kathy Guest

  4. #3

    Default Re: Using MFC ActiveX control in ASP

    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
    >
    >

    Brett Robichaud Guest

  5. #4

    Default Re: Using MFC ActiveX control in ASP

    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
    > >
    > >
    >
    >

    Brett Robichaud Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139