Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIntegrating a .HLP help file into a VC++ project Pin
Colin Davidson24-Apr-03 6:22
Colin Davidson24-Apr-03 6:22 
GeneralRe: Integrating a .HLP help file into a VC++ project Pin
Roger Allen24-Apr-03 6:59
Roger Allen24-Apr-03 6:59 
GeneralRe: Integrating a .HLP help file into a VC++ project Pin
Toni7825-Apr-03 7:49
Toni7825-Apr-03 7:49 
GeneralVisual C++ .Net 2003 Standard edition Pin
Darren Steadman24-Apr-03 5:54
Darren Steadman24-Apr-03 5:54 
GeneralProcess enumeration problems Pin
Zamfir24-Apr-03 5:46
Zamfir24-Apr-03 5:46 
GeneralWebBrowser Question Pin
Brian van der Beek24-Apr-03 5:40
Brian van der Beek24-Apr-03 5:40 
GeneralRe: WebBrowser Question Pin
Chris Losinger24-Apr-03 5:50
professionalChris Losinger24-Apr-03 5:50 
GeneralRe: WebBrowser Question Pin
Chris Richardson24-Apr-03 6:38
Chris Richardson24-Apr-03 6:38 
It's possible, but it's a little ugly. Here's some code I think I found in the MSDN. I was just poking around with it for a while, not using it in a production environment, so it's not too clean.

USES_CONVERSION;

// c_oWebBrowser is your CWebBrowser2 object...
IDispatch * a_poDisp = c_oWebBrowser.GetDocument();

if( a_poDisp )
{
   IHTMLDocument2 * a_poDoc = NULL;
   a_poDisp->QueryInterface( IID_IHTMLDocument2, (void**)&a_poDoc );

   if( a_poDoc )
   {
      // Ugh, it's gross code I know, I can't remember where I got it from...probably MSDN.
      //

      HRESULT hresult = S_OK;
      VARIANT *param;
      SAFEARRAY *sfArray;
      CString sHtml = ??? //put your HTML in this string.
      BSTR bstr = SysAllocString(A2COLE(sHtml));

      sfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1); // Creates a new one-dimensional array

      hresult = SafeArrayAccessData(sfArray,(LPVOID*) & param);
      param->vt = VT_BSTR;
      param->bstrVal = bstr;
      hresult = SafeArrayUnaccessData(sfArray);
      hresult = a_poDoc->write(sfArray);

      //SysFreeString(bstr); // Can't remember why this is commented out..sorry.
      if( sfArray != NULL )
      {
         SafeArrayDestroy( sfArray );
      }

      a_poDoc->Release();
   }
}


Chris Richardson

You can stash and you can seize
In dreams begin, responsibilities

U2 - Acrobat[^]


Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your Beer | [beer] - Rohit Sinha in the content-challenged thread
GeneralRe: WebBrowser Question Pin
Joan M24-Apr-03 6:52
professionalJoan M24-Apr-03 6:52 
GeneralRe: WebBrowser Question Pin
Brian van der Beek24-Apr-03 20:56
Brian van der Beek24-Apr-03 20:56 
QuestionHow to disable frame resize Pin
Anonymous24-Apr-03 5:37
Anonymous24-Apr-03 5:37 
AnswerRe: How to disable frame resize Pin
Joan M24-Apr-03 7:04
professionalJoan M24-Apr-03 7:04 
AnswerRe: How to disable frame resize Pin
Phil Hamer24-Apr-03 13:31
Phil Hamer24-Apr-03 13:31 
GeneralI do not want to wait for an event Pin
--dlb--24-Apr-03 5:02
--dlb--24-Apr-03 5:02 
GeneralRe: I do not want to wait for an event Pin
David Crow24-Apr-03 5:36
David Crow24-Apr-03 5:36 
GeneralRe: I do not want to wait for an event Pin
--dlb--24-Apr-03 6:48
--dlb--24-Apr-03 6:48 
GeneralRe: I do not want to wait for an event Pin
David Crow24-Apr-03 7:38
David Crow24-Apr-03 7:38 
Generaldetect connection to internet without popping up dial-up Pin
Kuniva24-Apr-03 5:01
Kuniva24-Apr-03 5:01 
GeneralRe: detect connection to internet without popping up dial-up Pin
Jason Henderson24-Apr-03 5:25
Jason Henderson24-Apr-03 5:25 
GeneralRe: detect connection to internet without popping up dial-up Pin
David Crow24-Apr-03 5:37
David Crow24-Apr-03 5:37 
GeneralSet Directory to save to Pin
rbeat10024-Apr-03 4:14
rbeat10024-Apr-03 4:14 
GeneralRe: Set Directory to save to Pin
Rickard Andersson2024-Apr-03 4:27
Rickard Andersson2024-Apr-03 4:27 
GeneralRe: Set Directory to save to Pin
Maximilien24-Apr-03 4:31
Maximilien24-Apr-03 4:31 
GeneralRe: Set Directory to save to Pin
rbeat10024-Apr-03 4:40
rbeat10024-Apr-03 4:40 
GeneralRe: Set Directory to save to Pin
basementman24-Apr-03 6:39
basementman24-Apr-03 6:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.