I need to use an ActiveX control developed using MFC.

The soln posted at http://fly.cc.fer.hr/~lethe/asmjournal/html/apj_8/Accessing%20COM%20Objects% 20from%20Assembly.shtml is good enough, but uses a COM obj; developed using ATL or other frameworks not MFC.

I have a very specific need. I need to use an ActiveX control developed using MFC ONLY.

Any help would be appreciated,

TIA,
~Manoj
Posted on 2002-10-21 01:57:32 by Manoj
since COM is a binary standard there should be no difference using an control developed with MFC compared with one in ATL.
Posted on 2002-10-21 03:13:45 by japheth
Goal: I want to use active-x controls (*.ocx or *.dll) in masm32

Description:

Activex controls example : windows media player ,calendar control 10.0, 3rd party active-x control ,??etc

In vc++ Microsoft rich-edit control is an active-x control.

In MASM using LoadLibrary(?RICHED32.DLL?) and using the following code we can use richedit control in masm

RichEdMl proc dw1:DWORD,dw2:DWORD,wd:DWORD,ht:DWORD,hParent:DWORD,ID:DWORD
szText EditMl,"RICHEDIT"
invoke CreateWindowEx,0,ADDR EditMl,0,
WS_VISIBLE or WS_CHILDWINDOW or ES_SUNKEN or \
ES_MULTILINE or WS_VSCROLL or WS_HSCROLL or \
ES_AUTOHSCROLL or ES_AUTOVSCROLL or ES_NOHIDESEL,
a,b,wd,ht,hParent,ID,hInstance,NULL
ret
RichEdMl endp


In vc++ there is two major sub division (MFC and SDK)
MASM is very similar to sdk.

In sdk we can?t use MFC active-x controls (that is *.ocx or *.dll).If u place one active-x control in a dialog (vc++ sdk) and execute the application, it exits without showing the dialog, it never goes to WM_INITDIALOG, WM_CREATE or any messages.

I find same problem in MASM too.

we can use ATL in vc++ sdk but u can?t use MFC active-x controls in sdk, if we want to use MFC active-x in sdk we must provide whole mfc support (that is to rebuild entire mfc) in sdk (that is full support of MFC42d.dll must be written in SDK)

My question is ?can I use windows media player, calendar control 10.0, 3 rd party active-x control, Microsoft flexgrid ??etc in MASM?. If yes plz give me some samples for the above activex controls.
Posted on 2002-10-21 08:41:50 by Manoj
to use media control with masm you have to create a activex container.

Some time ago I have posted an activex container in asm. You can download it from here . It is with source code but be warned: it is written to host any activex control, uses much typeinfo stuff and hence it isnt a good sample for hosting a specific control. But at least it works with the ms media control.
Posted on 2002-10-21 11:41:45 by japheth
Manoj,
you are one confused puppy. It sounds like you are trying to run before you can walk. Let's get a few things straight:

- as japheth said, ActiveX controls are ActiveX controls, it makes no difference what language or environment they were written in
- the RichEdit window is a control in MFC because MS encapsulated it with extra code for use with MFC. You can still use the standard RichEdit window in MFC by using API calls.
- you keep pointing out the differences between vc++(sdk) and vc++(mfc). You terminology of (sdk) is incorrect, what you are using is (fairly) standard C++, which is procedural. MFC is MS designed extensions to standard C++ that make it more event driven.

If u place one active-x control in a dialog (vc++ sdk) and execute the application, it exits without showing the dialog, it never goes to WM_INITDIALOG, WM_CREATE or any messages.
Welcome to the twilight zone, procedural code meets event driven code. Your code will be entering your main() procedure, and exiting straight out the end, because you haven't told it otherwise. Did you think that you could just do some crap at the visual end and not have to code anything else at all?

I find same problem in MASM too.
Huh? You have a cool visual asm editor that allows you to drag and drop activex controls without any coding, and none of us have this editor?

we can use ATL in vc++ sdk but u can?t use MFC active-x controls in sdk, if we want to use MFC active-x in sdk we must provide whole mfc support (that is to rebuild entire mfc) in sdk (that is full support of MFC42d.dll must be written in SDK)
That is the way it is supposed to be with MFC, you can't have half the project in MFC and the other half done some other way. And stop confusing ATL and MFC, they are NOT related (except they are both written in C and designed to be used in VC++).

My question is ?can I use windows media player, calendar control 10.0, 3 rd party active-x control, Microsoft flexgrid ??etc in MASM?.
Yes. For questions on using active x controls in MASM, visit the COM forum, they will point you in the right direction.
Posted on 2002-10-22 03:33:26 by sluggy