TCppWebBrowser component

c++ builder

    Sponsored Links

    Next

  • 1. What is your prefered newsreader (and why )?
    I currently use the basic solution - OutlookExpress. What can some other newsreader offer better to me? Best regards, Vladimir.
  • 2. Bad OnLine documentation
    Hi everyone, I was wondering if exist a good search engine for the BCB documentation ?. I really think that the online documentation is good but the search engine (windows help) is very bad. I never ever can find what I want. For example, when I created my first MDI Application I was looking for the method to get the active mdi child and I never found it. Any comment, Hernan Diaz
  • 3. Frameworks
    There has been some discussion on the CBX news group about the Mozilla application frame work. However there has benn no response from Borland or team B members I wonder, the team B take a gander and make some comments. This is an interesting route other than wxWindows. Cheers R.
  • 4. Advice - DB Design book
    Sorry if this belongs in the DB section... I'm looking for a good intro/medium level book on DB design. I have looked through the copy of DB Design for Mere Mortals at Chapters and for 70$ I thought there was a little too much about interviewing etc.. for my purposes. Someone else suggested Database Design Clearly Explained....but haven't had a chance to look through it.

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?

Regards,

Roland



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?


Gambit



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?


Gambit



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/ ";
CppWebBrowser1->Navigate(A);"

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 
password.


Roland



"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
password.

Please trim your posts: do not send back everything.

Hans.

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
far.


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


Gambit



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: https://mijn.postbank.nl/internetbankieren/SesamLoginServlet

Hans.

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.

Hans.

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.



Roland






"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.

Hans.

Re: TCppWebBrowser component

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






can

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.


Gambit



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.


Gambit



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.

Hans.

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 
below.

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.



Roland





//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

                : TForm(Owner)

{

CppWebBrowser1->Navigate((WideString)"https://mijn.postbank.nl");

}

//---------------------------------------------------------------------------

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?

Hans.

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
{
public:
  __fastcall TMyCppWebBrowser(TComponent *Comp) :
TCppWebBrowser(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)

web->Navigate(L"about:blank");

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
course.

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
hm


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

Hello,

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;
  W->Navigate(WideString(Edit1->Text).c_bstr());
}

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 
Button2.
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 22 guest