TCppWebBrowser component

c++ builder

    Sponsored Links


  • 1. XP SP2 Question SOLVED
    Thanks to all who helped. Yes, the problem did involve no on the machine. The disk drive is now gone. It won't boot to DOS and boots to XP only with difficulty and with no PPP drivers, no CD/DVD, no USB or printer and no ability to do many other things and with a chkdsk at each boot. The machine is toast. I'm not home so don't have another development machine and only one alternative. I've reached here via my wife's machine. . Ed > Ed Mulroy wrote in message > news: XXXX@XXXXX.COM ...
  • 2. XP SP2 Question
    My machine has started acting up. It is XP Pro, Service Pack 2. Does anyone have a suggestion as to what I might try? I use some DOS utilities, one of which is pkzip.exe. When I ran it today I received a message box saying this: --------------- 16 bit MS-DOS Subsystem Command Prompt - pkzip -ofex 1\mypage config.nt The system file is not suitable for running MS-DOS and Microsoft Windows applications. Choose 'Close' to terminate the application. --------------- At the bottom were 2 buttons, Close and Ignore, both of which do the same thing, stop the command. Both config.nt and autoexec.nt are fine, unchanged and located in c:\winnt\system32. Both of them compare exactly with the copies the OS keeps in c:\winnt\repair. The files (some comments deleted to save space) -------autoexec.nt--------- lh %SystemRoot%\system32\mscdexnt.exe REM Install network redirector (load before dosx.exe) lh %SystemRoot%\system32\redir REM Install DPMI support lh %SystemRoot%\system32\dosx ---------config.nt--------- dos=high, umb device=%SystemRoot%\system32\himem.sys files=40 ntcmdprompt ---------------------------- Removing ntcmdprompt has no effect on this. . Ed
  • 3. Hurray
    I just fell off my chair, C++ Builder Direct seems to be up and running again! Way to go Borland, that wasn't _that_ difficult, was it? Especially as it was just a minor thing to do to let your customers know C++ Builder isn't completely dead yet. Next thing you'll know, product announcements will actually go to the announce group! <g>

TCppWebBrowser component

Postby Roland » Wed, 15 Nov 2006 19:33:15 GMT

Dear all,

If I use in BCB6 the TCppWebBrowser component the results are significant
difference in case I use IE6 from Microsoft when I login to a site in this
case my Bank.

I login to my Bank with the URL http:// ..and for some actions the URL is
switched to an https://....... URL.

In the last case I get an error message from my Bank with the BCB6 component
and not with IE6 from Microsoft.

Does anyone know how I can handle this?



Re: TCppWebBrowser component

Postby Remy Lebeau (TeamB) » Thu, 16 Nov 2006 09:53:55 GMT

There should be no difference whatsoever.  TCppWebBrowser is a wrapper for
the Internet Explorer ActiveX control - the exact same control that the
Internet Explorer UI itself uses internally.  So all of the actualy
request/response and parsing logic is identical because it is shared logic.

That is perfectly normal.  'http://' is an unsecure website, whereas
'https://' is secure.  The non-secure website is simply redirectly the
browser to the secure website.  I would expect a Bank website to do that.
Such redirection works exactly the same whether you are using TCppWebBrowser
or the IE UI directly, as it is handles at the HTTP level.  It has nothing
to do with which browser you are using.

What EXACTLY are you seeing happen?  Please be more specific.  What does
your actual code look like?  What is the actual error message?


Re: TCppWebBrowser component

Postby Remy Lebeau (TeamB) » Thu, 16 Nov 2006 09:54:36 GMT

BTW, why did you post a technical question in a non-technical newsgroup?


Re: TCppWebBrowser component

Postby Roland » Thu, 16 Nov 2006 17:46:47 GMT

Sorry Gambit if this is not the newsgroup for this kind of questions.

My actual code is verry simple (or maybe to simple) I use:

A = " http://www.**--****.com/ ";

With this simple code I can login to my Bank.

On there website I wand to change for example my username and password.

The website switches over to a next screen.

In this screen normally I get the possibility to fill in the data but 
nothing happens and I get after a while a message that my session is over.

This happens not when I use IE6 from Microsoft and I can normally change my 


"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM > schreef in bericht 

Re: TCppWebBrowser component

Postby Hans Galema » Thu, 16 Nov 2006 18:53:45 GMT

After that you can click "Inloggen ... " and you get the SesamLoginServlet.
There you can fill in username and password

So where did you click? I do not see an opportunity here to change

Please trim your posts: do not send back everything.


Re: TCppWebBrowser component

Postby Remy Lebeau (TeamB) » Thu, 16 Nov 2006 19:39:27 GMT

Unless 'A' is a WideString, then that code will not compile, as Navigate()
expects a BSTR as its first parameter, not a char* or an AnsiString.

Then what is the actual problem you are having?  I see no problem here so

When I download  http://www.**--****.com/ , I see a link in the HTML that
goes to, which then has username/password fields.
So why not just have TCppWebBrowser go to directly
to begin with?


Re: TCppWebBrowser component

Postby Hans Galema » Thu, 16 Nov 2006 22:36:48 GMT

Which version are you using? AnsiString as well as char* can be used
in Turbo C++ Explorer. Also in many eventhandlers the URL parameter
can now be assigned directly to an AnsiString. (Which was impossible
with bcb5 fot instance).

Or yet more direct:


Re: TCppWebBrowser component

Postby Hans Galema » Thu, 16 Nov 2006 22:40:22 GMT

Sorry. That is for TWebBrowser.

The post here is about TCppWebBrowser.


Re: TCppWebBrowser component

Postby Roland » Fri, 17 Nov 2006 01:37:17 GMT

Hi Hans,

You are right but it is not an login problem.

After you are logged in you have the option to change your password.

And then the site switches to an other screen where you can input your new 
password for example.

And that is the screen where I get the message: "Session over" before I can 
input my new password.

But I can understand that this is difficult to test for you because you must 
have first a username and password to login.

Anyway thanks all for your answers.


"Hans Galema" < XXXX@XXXXX.COM > schreef in bericht 

Re: TCppWebBrowser component

Postby Hans Galema » Fri, 17 Nov 2006 02:02:34 GMT

 > And then the site switches to an other screen ...

What do you mean with 'screen' in this context ?

After login I choose 'Wachtwoord wijzigen'. As a responce an extra window
is opened where I can choose which of the two or both I want to change.

Don't you get that window? If so: why did not you tell? Please state exaxctly
the steps.


Re: TCppWebBrowser component

Postby Remy Lebeau (TeamB) » Fri, 17 Nov 2006 03:57:48 GMT


Sessions are generally tracked in one of two ways:

1) cookies

2) passing session IDs around as part of the URLs

IE handles #2 automatically, whether you are using the main IE UI or
TCppWebBrowser.  #1 is a different matter.  Do you have cookies enabled in
your browser?

You need to talk to the website admin to find out what causes a session to
become invalid.  This is not a browser issue anymore.  As I told you before,
TCppWebBrowser and the IE UI share the SAME ACTIVEX CONTROL, so the runtime
functionality of the browser in each is identical.


Re: TCppWebBrowser component

Postby Remy Lebeau (TeamB) » Fri, 17 Nov 2006 03:59:00 GMT

Are you saying that the "change password" option is handled inside a
separate popup window?  If so, then make sure that the TCppWebBrowser's
OnNewWindow2 event is not preventing popup windows from occuring.


Re: TCppWebBrowser component

Postby Hans Galema » Sat, 18 Nov 2006 17:44:58 GMT

Sorry that I waited so long to answer you. I had let it to Roland
as it is his problem. But it seems that he has gone.

Indeed a new popup window appears. Whatever happens then: it will
never return to the CppWebBrowser. I did not go so far though as
I waited for Roland also to confirm.

That is not enough. It should display that new window itself.


Re: TCppWebBrowser component

Postby Roland » Sun, 19 Nov 2006 19:30:10 GMT

Sorry Gambit and Hans for my late reaction but I had other things to do for 
a few days.

With the remarks off Gambit I get the right popup windows and everything 
seems to work fine accept that I get a script error if I want to leave the 
popup window with 'cancel' or 'ok'.

The error message is: Could not obtain OLE control window handle.

Because I did not know what I had to do in the fastcall NewWindow2 I was 
looking on the web for some statements and found what you see in the text 

I realise that this is not a good way (and maybe stupid) but I hope you can 
help me with the 'CppWebBrowser1NewWindow2' fastcall.

Sorry if the text is to long for the newsgroup.



__fastcall TForm1::TForm1(TComponent* Owner)

                : TForm(Owner)





void __fastcall TForm1::CppWebBrowser1NewWindow2(TObject *Sender,

                  LPDISPATCH *ppDisp, VARIANT_BOOL *Cancel)


 // hier moet wat verbeterd worden i.v.m scripterror bij afsluiten

 // als je het postbank wachtwoord wijzigen scherm invult en daarna afsluit!

 // krijg ik de melding: Could not obtain OLE control window handle

                CppWebBrowser2->Visible = true;

                *ppDisp = CppWebBrowser2->Application;



void __fastcall TForm1::CppWebBrowser1NavigateComplete2(TObject *Sender,

      LPDISPATCH pDisp, Variant *URL)


                if(AnsiString(CppWebBrowser1->LocationURL) != "about:blank")

                Label1->Caption = "URL->  " + CppWebBrowser1->LocationName;

                else Label1->Caption = EmptyStr;



"Hans Galema" < XXXX@XXXXX.COM > schreef in bericht 

Re: TCppWebBrowser component

Postby Hans Galema » Mon, 20 Nov 2006 22:09:22 GMT

In short: you are displaying the contents of the popup window in a second
instance of CppWebBrowser. You should have told so to begin with.

It is perfectly ok.

Then why did you quote all the previous text too? Please trim your quotes.

And why all those extra white lines?

That is ok.

 > .. everything
 > seems to work fine accept that I get a script error if I want to leave the
 > popup window with 'cancel' or 'ok'.

 > The error message is: Could not obtain OLE control window handle.

At the moment you click 'Annuleren' (Cancel) in the second webbrowser,
it's object becomes gray. If you then close the application you get that
message. Why do you think that it is a script message ? Do you mean javascript?
Why do you think so?

You can bring up that message too in another way. After clicking 'Annuleren'
click on a TEdit or a TMemo that is on the same form. There is the message!

Can you confirm this?


Similar Threads:

1.TCppWebBrowser component

2.TCppWebBrowser/MSHTML Component bug

3.Component derived from TCppWebBrowser?

I've seen this question asked a few times over the years, but I've never seen an answer. It seems like a simple enough question. Can you derive a component/class from TCppWebBrowser?

I've tried a real simple test app, which is something like:

class TMyCppWebBrowser : public TCppWebBrowser
  __fastcall TMyCppWebBrowser(TComponent *Comp) :

When you click a button on an otherwise empty form I do something like:

web = TMyCppWebBrowser(this);

web->::TOleControl->Parent = this;  (don't remember exact syntax)


I always get an access violation when it gets to Navigate(). I can use the exact same code, but just replace "TMyCppWebBrowser" with "TCppWebBrowser", and everything works fine. The only thing in my derived class is the required constructor, so how could it be causing anything different to happen?

Could it really be that no one has ever tried to do this, or never succeeded? Can anyone tell me if these issues go away if I was to switch to Delphi and try to derive a new component from TWebBrowser? I'm sure someone has derived a component from that one, right? Come on! Anyone?

The only solution I've come up with so far, but it isn't pretty, is to edit the CPP and HPP files generated by the "import ActiveX control" process. That seems to work, and I know they are just wrappers that the utility spits out, so it seems like that should be safe, but those files are far from pretty, so I really hate to edit them and compile them into my own (very pretty) code.

4.New component - TCppWebBrowser

I created a new component with TCppWebBrowser as the ancestor type. Without
adding any code to it I compiled and installed it. When I tried it in a test
form everything except the TCppWebBrowser functions worked, that is, setting
properties and calling function inherited from COleControl and up is OK but
when calling Navigate2 or GoHome I get an Access violation. Am I supposed to
do something special for this to work? Initialize something? When I inspect
the object everything looks normal...
When using the CppWebBrowser component directly these function work of

The exception notification:
Project wbtest.exe raised exception class EAccessViolation with message
'Access violation at address 00937073. Write of address 00004570'.

Do you know what I need to do to make this work?

Thank you

5.Create TCppWebBrowser dynamically, how to delete/free?


I have a problem using the TCppWebBrowser component dynamically.
My code to create a TCppWebBrowser is:

// In Unit1.h:
TCppWebBrowser *W;

// In Unit1.cpp

void __fastcall TForm1::Button1Click(TObject *Sender)
  W = new TCppWebBrowser(Form1);
  W->ParentWindow = Form1->Handle;

void __fastcall TForm1::Button2Click(TObject *Sender)
  delete W;

I start my application and watch the occupied memory (in taskmanager) and it 
occupies arround 10.000k.
If I click Button1, the browser navigates successfully, the application now 
occupies arround 15.000k

Then I want to delete the TCppWebBrowser component therefore I pressed 
My application then still needs arround 14.700k, so it seems the 
browsercomponent does not release all memory using delete.
What I am doing wrong?
How do I completely release the TCppWebBrowser component and all its 
occupied memory?

Thanks for any help!

6. Stop TCPPWebBrowser Javascript Popup

7. google maps and tcppwebbrowser

8. TCppWebBrowser OnNewWindow2 event

Return to c++ builder


Who is online

Users browsing this forum: No registered users and 24 guest