Click here to Skip to main content
16,006,493 members
Home / Discussions / C#
   

C#

 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 6:25
Stephane Rodriguez.9-May-03 6:25 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter9-May-03 10:11
LongRange.Shooter9-May-03 10:11 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 10:25
Stephane Rodriguez.9-May-03 10:25 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter9-May-03 10:37
LongRange.Shooter9-May-03 10:37 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.9-May-03 10:58
Stephane Rodriguez.9-May-03 10:58 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter12-May-03 4:25
LongRange.Shooter12-May-03 4:25 
GeneralRe: writing strings to the browser control Pin
Stephane Rodriguez.12-May-03 4:35
Stephane Rodriguez.12-May-03 4:35 
GeneralRe: writing strings to the browser control Pin
LongRange.Shooter15-May-03 7:37
LongRange.Shooter15-May-03 7:37 
.S.Rod. --

I got this solved, finally. To write a string to the browser control all I have to do is this:

C#
StringBuilder msg = new StringBuilder();
msg.Append("<HTML>\n\r<BODY>\n\r");
...                               //construct HTML body
msg.Append("</BODY>\n\r<\HTML>");
IHTMLDocument2 document = this.WebBrowser.Document as IHTMLDocument2; 
document.write(msg.ToString()); 


Now the browser control thinks it is still working with the about:blank document, so when I had scripting errors they were reported as occuring inside of about:blank. However when I view source I see my constructed string HTML source. When I click an object, the script is seen and executed.

That is it. No IPersist... was necessary. I just needed to find the syntax for deploying the IHTMLDocument2 interface.

Condor

_____________________________________________
The world is a dangerous place.
Not because of those that do evil,
    but because of those who look on and do nothing.

Generalmp3 in C# Pin
Anonymous8-May-03 3:47
Anonymous8-May-03 3:47 
GeneralRe: mp3 in C# Pin
Paresh Gheewala8-May-03 7:01
Paresh Gheewala8-May-03 7:01 
GeneralRe: mp3 in C# Pin
AlexDunn19-May-03 14:14
AlexDunn19-May-03 14:14 
GeneralRe: mp3 in C# Pin
Paresh Gheewala21-May-03 5:49
Paresh Gheewala21-May-03 5:49 
GeneralRe: mp3 in C# Pin
AlexDunn21-May-03 12:04
AlexDunn21-May-03 12:04 
GeneralRe: mp3 in C# Pin
leppie8-May-03 7:34
leppie8-May-03 7:34 
GeneralRe: mp3 in C# Pin
Kant8-May-03 8:23
Kant8-May-03 8:23 
GeneralRe: mp3 in C# Pin
leppie8-May-03 10:16
leppie8-May-03 10:16 
GeneralRe: mp3 in C# Pin
jtmtv189-May-03 19:05
jtmtv189-May-03 19:05 
GeneralLarge File Transfer in Client-Server Applications Pin
Vasant Salian8-May-03 1:28
Vasant Salian8-May-03 1:28 
GeneralRe: Large File Transfer in Client-Server Applications Pin
Katalyst8-May-03 4:55
Katalyst8-May-03 4:55 
Questionwhat you must add to your exe file Pin
flyingv7-May-03 19:56
flyingv7-May-03 19:56 
AnswerRe: what you must add to your exe file Pin
Stephane Rodriguez.7-May-03 20:03
Stephane Rodriguez.7-May-03 20:03 
QuestionHandle for a child window? Pin
lxhan7-May-03 17:26
lxhan7-May-03 17:26 
AnswerRe: Handle for a child window? Pin
Stephane Rodriguez.7-May-03 20:00
Stephane Rodriguez.7-May-03 20:00 
AnswerRe: Handle for a child window? Pin
LongRange.Shooter9-May-03 10:44
LongRange.Shooter9-May-03 10:44 
QuestionC++ define statements == what in C#? Pin
dazinith7-May-03 9:38
dazinith7-May-03 9:38 

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.