Click to See Complete Forum and Search --> : Using VB Activex in C++


naveen_mah
June 14th, 2002, 12:40 AM
Hi!
Can anybody tell me how to use Activex Designed in VB in C++ windows aplication in a dialog box.
Can this control come in tool box for designing dialogs in visual studio.

pls let me know if there are some links or some resources on net.
It will be great if you can give a sample code..or tutorial..

Thanks
Naveen

plpathy
June 16th, 2002, 10:18 PM
If you want to place the control in your dialig box You can just use Insert ActiveX Control menu option.



Can you explain your problem in detail?

naveen_mah
June 16th, 2002, 11:40 PM
Hi!!
Thanks !!!
Can you pls give me an example of code .....with a simple example of how to insert and what code has to be written...

I just made simple activex maybe just a edit box kind and want to use that in windows aplication ..without MFC.

I have put that control on dialog same as what you said .."insert activex control". but now when I run I dont see dialog. Why???

It will be great if you can give me a sample code .... where I can set properties and handle events ...

Can you pls tell me what is a difference between Activex dll and active x control (OCX) in VB

I found one topic in MSDN for ActiveX dll ..It can be used as COM component ...but no document for ActiveX control.

Pls help...

Thanks
Naveen

Plastelin
June 17th, 2002, 07:08 AM
#define _ATL_APARTMENT_THREADED
#include <atlbase.h>
CComModule _Module;
#include <comdef.h>
#include <atlcom.h>

#impotr "activex_name.ext" rename_namespace("namespace_name")

void main()
{
::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
namespace_name::IObjNamePtr pObj;
pObj.CreateInstance(__uuidof(XML::DOMDocument));
... // Use oObj
::CoUninitialize();
}