mfc >> Using ActiveX in a DHtmlDialog

by bellabax » Mon, 24 Nov 2003 21:42:41 GMT

I need to catch an event fired by an ActiveX control embed into a
page.
The code in the DHTML_EVENT_MAP() is:

BEGIN_DHTML_EVENT_MAP(CModificaDatiCont)
DHTML_EVENT_ONCLICK(_T("visColRettifica"), OnChShowrett)
{DHTMLEVENTMAPENTRY_CONTROL,0x02,_T("F1Book"),
reinterpret_cast<DHEVTFUNCCONTROL>(OnDblClick)) },
END_DHTML_EVENT_MAP()

I need to perform this cast because the DHTML_EVENT_AXCONTROL() works
only for functions without parameters; my callback func has two
parameters:
(declare in CModificaDatiCont.h)
void OnDblClick(long nRow, long nCol);

All works fine until I try to access variables in the OnDblClick()
function; every access generates a violation, forn example *this
object is corrupted.

Someone can help me? i'm really in trouble.
Thanks in advance for help,
Luca Basso Ricci.


Similar Threads

1. About HTML element CALLBACK question in DHTMLDialog. thx

2. Create an ActiveX in C# using other ActiveX created in VC++

Please let me know how to create an ActiveX in C# using other ActiveX created 
in VC++.

3. question about converting Console App that uses ActiveX ctrl to ATL dll that uses ActiveX ctrl. Advice needed on Serial Port ActiveX Control

4. Using an old VS6 activex with c# (pointer to struct used in method

I have an old activex control that I am trying to use with c# "Ruler.ocx"
It has a method:

     RequestData(ref int id, ref int status, ref float data)

which requires the caller to pass in memory to be filled with data and 
returned. The problem is that the REAL VS6 C++ method is:

     RequestData(long * id, long * status, profile* data)

where profile is the following struct:

     struct profile{
          point points[508];
     }

and points is the following struct:

     struct point{
          float X;
          float R;
          float I;
     }
     
The int32's are the same as the longs so that it is not a big deal (I know 
this because other methods which use ref ints work fine)  but I can't seem to 
get anything to work for the struct/float.

I have read a post describing how to do something similar using tools like 
aximp and ildasm to modify the control. I have tried to duplicate what they 
are doing but to no avail.

What do I have to do to get this working?
Is there an easier way than disassembling, modifying and reassembling the 
code?

5. Using a C++ Win32 DLL internally in an ActiveX deployed on a webpage

6. Seek for example of ActiveX containner write with C++ (without using MFC)

I want to study the detail of ActiveX containner's implement.
Would any guy who have written ActiveX containner with C++ send me a copy?
Or give me some examples you have gathered.

Thanks in advance!


7. Using ActiveX versions of common controls from C++ rather than Visual Basic

8. problem using an ActiveX object written in C# in native C++

hi,


i have written an ActiveX Control in C#, registered it with COM and
can use it without any problems in VB6 and VBA. My problem is: the
Class assistant in Visual C++ 6 uses "_Object" as type for a member
variable for this control instead of my explicit declared Interface.
here is the TLB:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Generated .IDL/C++ pseudo source equivalent of Win32 type library ..
\USBDevicesActiveX.tlb
[
  uuid({98DF6D97-AE0D-4523-AC86-3FC61F7F0BE8}),
  version(1.0)
]
library USBDevicesActiveX
{
    // Forward references and typedefs
    dispinterface _USBDevicesAX;
    dispinterface _USBDeviceEventsAX;

    [
      uuid({47E027B6-1509-422B-9D48-BB14BF1DDD11}),
      version(1.0)
    ]
    dispinterface _USBDevicesAX
    {
        properties:
        methods:
            //the methods
    };

    [
      uuid({461579DC-9A3E-41C1-9C7C-64FD540D2052}),
      version(1.0)
    ]
    coclass USBDevicesAX
    {
        dispinterface _Object;
        dispinterface IComponent;
        dispinterface IDisposable;
        interface IWin32Window;
        [default] dispinterface _USBDevicesAX;
        [default, source] dispinterface _USBDeviceEventsAX;
    };

    [
      uuid({C6793ABA-5077-4D1B-8A8D-753B44494BCB}),
      version(1.0)
    ]
    dispinterface _USBDeviceEventsAX
    {
        properties:
        methods:
            //the event methods
    };
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

as you can see, the first interface in the coclass is "_Object", i
don't know if that is the issue, i marked my Interface as default, and
as i said: it works fine under VB and as i guess also under C++ if i
would do it manually, the problem is: an external programmer
(preferring functional C without classes and objects) has to use this
control and i can't get it working.

thanks for any help