IHTMLElement & put_innerHTML update problem
-
-
Hi, I am updating the innerHTML of a page element to show a progress, the progress string inside the DIV element only updates when I move the mouse over the IE window. if it's idle it does not update. Does anyone know a problem to this solution. Thanks Ceri
Ceri wrote: Does anyone know a problem to this solution. :-D Where is the MSHTML Com Object. Is it an app of yours or are you doing something in IE? A code snippet might help. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Ceri wrote: Does anyone know a problem to this solution. :-D Where is the MSHTML Com Object. Is it an app of yours or are you doing something in IE? A code snippet might help. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
It's a C++ MFC app that I am developing in. Basicly the loop snippet looks something like this; pElem is a pointer to an IHTMLElement iProg is an integer that contains a progress bsText is a formated BSTR that contains the string to put in the innerHTML [code] do { iProg = GetCurrentProgress(); ... //string formating to put number into BSTR. e.g. "10%" pElem->put_innerHTML(bsText); }while(iProg != 100) [/code] The code works except that the display only updates when I move the mouse over the embedded IE control
-
It's a C++ MFC app that I am developing in. Basicly the loop snippet looks something like this; pElem is a pointer to an IHTMLElement iProg is an integer that contains a progress bsText is a formated BSTR that contains the string to put in the innerHTML [code] do { iProg = GetCurrentProgress(); ... //string formating to put number into BSTR. e.g. "10%" pElem->put_innerHTML(bsText); }while(iProg != 100) [/code] The code works except that the display only updates when I move the mouse over the embedded IE control
Sitting in a tight light probably isn't a good idea. Try calling UpdateWindow() on the View. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Sitting in a tight light probably isn't a good idea. Try calling UpdateWindow() on the View. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Steve S wrote: Err, did you mean tight loop? Maybe I was thinking he needs to see the light, or that I need to turn the light out and head for bed, seeing its nearly 11pm here and I started coding at 5am.:zzz: Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Sitting in a tight light probably isn't a good idea. Try calling UpdateWindow() on the View. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
Hi, Yes i already tried that and it didn't work. If you think that being in a tight loop will be a problem how else could you do something that needed to be updated often. Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. Ceri
-
Hi, Yes i already tried that and it didn't work. If you think that being in a tight loop will be a problem how else could you do something that needed to be updated often. Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. Ceri
Ceri wrote: Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. There are various problems doing GUI stuff from secondary threads with MFC. I would try doing the updates from the main thread. In the secondary thread Post a message to the main thread and add a Message handler and get it to do the work of updating IE. That should fix it. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Ceri wrote: Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. There are various problems doing GUI stuff from secondary threads with MFC. I would try doing the updates from the main thread. In the secondary thread Post a message to the main thread and add a Message handler and get it to do the work of updating IE. That should fix it. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Ceri wrote: Another thing that i forgot to mention is that this happenes in a different thread than the IE Windows message loop. There are various problems doing GUI stuff from secondary threads with MFC. I would try doing the updates from the main thread. In the secondary thread Post a message to the main thread and add a Message handler and get it to do the work of updating IE. That should fix it. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Done a postmessage with a custom message and it worked fine. Thanks. I think that is a bit silly mind, I think that the message loop is a little slow. Although it's OK in this case. Ceri
Ceri wrote: Done a postmessage with a custom message and it worked fine. Thanks. I thought it would.;) Ceri wrote: I think that the message loop is a little slow I haven't noticed any problems doing this in ED (see sig) which is heavilly multithreaded. But I haven't tried updating the HTML control this way. You might want to through in an UpdateWindow(). Or maybe your tight loop is using too much CPU. ;) Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
Ceri wrote: Done a postmessage with a custom message and it worked fine. Thanks. I thought it would.;) Ceri wrote: I think that the message loop is a little slow I haven't noticed any problems doing this in ED (see sig) which is heavilly multithreaded. But I haven't tried updating the HTML control this way. You might want to through in an UpdateWindow(). Or maybe your tight loop is using too much CPU. ;) Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com