Advertisement

02.23.2006 at 06:00AM PST, ID: 21748501
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

How to compile and use code in VC++ 6.0

Asked by programmed2live in Microsoft Visual C++.Net

Tags: ,

I found some code at this website: http://www.memecode.com/news.php?id=282&comments=1
which I have include below.

Since I am new to VC++ 6.0 I am not sure how to compile the code and use it in my application to embed the browser. Will this code be compiled to .exe or .dll or something else and how?

heres the code:

#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <atlwin.h>
#include <atlhost.h>
#include <exdisp.h>
#include <comdef.h>

CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()

class ActiveXCtrl
{
      CAxHostWindow *Host;
      CAxWindow Wnd;
      IUnknown *Ctrl;
      IWebBrowser2 *Browser;

public:
      ActiveXCtrl()
      {
            Host = 0;
            Ctrl = 0;
            Browser = 0;

            _Module.Init(ObjectMap, (HINSTANCE)GetCurrentProcess());
            AtlAxWinInit();
      }

      ~ActiveXCtrl()
      {
            Detach();
      }

      bool Attach(HWND hwnd)
      {
            bool Status = false;
            RECT Rc = {0, 0, 100, 100};

            WORD *Url = L"http://www.mozilla.org";
            #if 1
            char *Ctrl = "Mozilla.Browser.1"; // Mozilla
            #else
            char *Ctrl = "Shell.Explorer.2"; // IE
            #endif

            if (Wnd.Create(      hwnd,
                                    Rc,
                                    _T(Ctrl),
                                    WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
                                    0))
            {                  
                  if (Wnd.QueryControl(IID_IWebBrowser2, (void**)&Browser) == S_OK)
                  {
                        CComVariant v;
                        
                        _bstr_t u = Url;
                        if (Browser->Navigate(u, &v, &v, &v, &v) == S_OK)
                        {
                              Status = true;
                        }
                  }
            }
            
            return Status;
      }

      bool Detach()
      {
            if (Browser)
            {
                  Browser->Release();
                  Browser = 0;
            }
            if ((HWND)Wnd)
            {
                  Wnd.DestroyWindow();
            }
            return true;
      }

      bool SetPos(RECT Rc, bool Repaint = false)
      {
            if ((HWND)Wnd)
            {
                  Wnd.MoveWindow(&Rc, Repaint);
            }

            return true;
      }
};



Thank You.Start Free Trial
[+][-]02.23.2006 at 07:44AM PST, ID: 16029831

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.23.2006 at 04:11PM PST, ID: 16034764

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.23.2006 at 06:05PM PST, ID: 16035341

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual C++.Net
Tags: caxhostwindow, caxwindow
Sign Up Now!
Solution Provided By: venkaiah
Participating Experts: 2
Solution Grade: C
 
 
[+][-]02.23.2006 at 10:03PM PST, ID: 16036320

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.24.2006 at 04:54AM PST, ID: 16037849

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2006 at 09:41PM PST, ID: 16048055

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32