Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

delphi and embeddedwb

Posted on 2014-10-10
7
Medium Priority
?
910 Views
Last Modified: 2014-10-18
hi i have chat application that cleint send message and show it to other connected clients in  tmemo  iam done with the application but i decided to change the TMEMO WITH Tembeddedwb  but i dont know how to get it work i found example like this

procedure addChatText(WB: TEmbeddedWB; const html: string;add:integer = 0);
var
   Range: IHTMLTxtRange;
   mText : string;
   ext : string;
   sURL : string;
   i : Integer;
begin
  if not joined then Exit;

  if Not Assigned(Wb.Document) then exit;
  Range := ((WB.Document AS IHTMLDocument2).body AS IHTMLBodyElement).createTextRange;
  Range.Collapse(False) ;

  if add = 1 then
  begin
    if ChatContent <> nil then
    begin
      ChatContent.Add(html+'<BR>');
      mText := ChatContent.Text;
    end else
    begin
      mText := html+'<BR>';
    end;
  end else begin
    mText := html+'<BR>';
  end;

  if ChatContent <> nil then
  begin
    if ChatContent.Count > ChatContentTotal then
    begin
      for i := 0 to 10 do
      begin
        ChatContent.Delete(0);
      end;
    end;
//   while (ChatContent.Count) > ChatContentTotal do ChatContent.Delete(0);
  end;
end;{ * chatPMAppend *}

Open in new window



but that doesn't work in delphi xe5 i did not recive any message that i sent

i send message like this

addChatText(weblog,'<span class="Name">'+Name+':</span> '+ message,1);

Open in new window


Note : Weblog is my  Tembeddedwb .
0
Comment
Question by:drama22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40375863
TEmbeddedWB is a quite large - try use smaller HtmlViewer component. You need to be sure what you post o ewb/html viewer. Try save to file first as html file and try to open in common web browser. Sometimes you need to have common html header at top...
0
 

Author Comment

by:drama22
ID: 40375887
Html viewer can show embedded youtube videos ? If yes can I have sample code of how client message can be showing after they send it ,, I know its sounds very odd but iam very beginner to understand everybthing without code sample .
0
 
LVL 27

Accepted Solution

by:
Sinisa Vuk earned 2000 total points
ID: 40383742
I downloaded TEmbeddedWB from Torry.net
In a package in Demo section is example of how to use additional TEditDesigner component with TEmbededWb. Purpose is something like chat like editor and can produce html text to send.

Connect EditDesigner1 with Ewb component and load chat text like this:
  if EditDesigner1.ConnectDesigner = S_OK then
  begin
     EmbeddedWB1.LoadFromString(html_text);
  end;

Open in new window


without EditDesigner Ewb is just a html viewer.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:drama22
ID: 40384413
that not what i need i test it before  not doing the job the code above that i post in my main question would be helpful if some fixes added but thats not solve for the main need ..
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40386761
Grab html encoded text form one user and send to another (code in older question) (from one ewb to another ewb)
0
 

Author Comment

by:drama22
ID: 40388639
Better yet xan I grab the messages from tmemo and show it in embeddedwb ?
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40388827
like this:
if EditDesigner1.ConnectDesigner = S_OK then
  begin
     EmbeddedWB1.LoadFromStrings(Memo1.Lines);
  end;

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question