Thanks in advance,
http://msdn.microsoft.com/en-us/library/2wyzh77w(VS.80).aspx
Drew
"nehal" <sneha...@gmail.com> wrote in message
news:e4070b10-42fb-4858...@j5g2000yqm.googlegroups.com...
Hi Drew,
Thanks for your immediate reply. But i really cudnt figure out the
solution from the msdn link. Can you please give an explanation on it
and it's use in my case.
I will tell you my scenario in detail:
I have an activeX control created using MFC. When i run it a container
is generated and when i insert the control, the control is
displyed.But the thing that i want to try out is to write a simple C++
class and use this activeX.ocx (activeX control) in my class. Is there
any way to do it? Please help.
Waiting for your reply
Thanks
Hi Drew,
Thanks for your immediate reply. But i really cudnt figure out the
solution from the msdn link. Can you please give an explanation on it
and it's use in my case.
I will tell you my scenario in detail:
I have an activeX control created using MFC. When i run it a container
is generated and when i insert the control, the control is
displyed.But the thing that i want to try out is to write a simple C++
class and use this activeX.ocx (activeX control) in my class. Is there
any way to do it? Please help.
Waiting for your reply
Thanks
nehal,
I presume you want to embed your control in a CWnd. In which case, from
ClassView right click the project and choose Add/Class... You will be
presented with a dialog. Choose "MFC Class from ActiveX Control". You'll get
another dialog which has a combo-box listing all registered ActiveX
controls. Choose yours from the list and follow the ensuing wizard. A class
will be generated for you based on CWnd. Declare a member of whatever class
you wish to have control this window using the class name of the generated
class, i.e. CMyActiveX m_MyOCX; Then follow the documentation in the link I
provided to instantiate the control i.e. m_MyOCX.CreateControl(...); From
then on use the properties/methods of the control normally, i.e.
m_MyOCX.SomeMethod(argument1, etc);
Drew
Hi,
Thanks for your detailed information. But i was looking for simple C
code(without using MFC). I came across this code:
http://www.codeproject.com/KB/cpp/ActiveXControlWithoutMFC.aspx
This sample code make use of rc file(resource script) in which there
is a reference to ClSID. Is there any alternative to rc file.I mean,
in my case i cannot create a rc file.So how can I avoid using it
without any errors in the given code.
Thanks
Sorry, you haven't stated your intended purpose of this control, what you
are trying to accomplish, or really ANY meaningful information other than "I
have created an activeX control using MFC. Now i have to write a simple C++
code in which I have to invoke this control".
You created the control using MFC, but you refuse to use MFC to use the
control. In addition you say you want simple C++ code to invoke the control.
Well, MFC *IS* simple C++ code to invoke the control. In addition, you've
posted this message to microsoft.public.vc.mfcole (notice the MFC in the
group name?). This time if you want an answer you need to give COMPLETE
context of: your requirements, platform, VS edition used and any other
relevant information.
Drew