CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2001
    Location
    Calcuta, WB, India
    Posts
    63

    Using VB Activex in C++

    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

  2. #2
    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?

  3. #3
    Join Date
    Dec 2001
    Location
    Calcuta, WB, India
    Posts
    63
    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

  4. #4

    Re: Using VB Activex in C++

    [ccode]
    #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:OMDocument));
    ... // Use oObj
    ::CoUninitialize();
    }
    [/ccode]

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured