|
use CWebBrowser2::Navigate() to display a web page.
how to know if the page is displayed properly or not?
e.g.
if the page is invalid or user doesn't connect to the internet, the page can not be displayed - in the case, I want to display a local page instead.
|
|
|
|
|
Have a look at the definition of this function and try to work around with the return types if it fails .
redindian
|
|
|
|
|
Check for Navigate_complete or Navigate2_complete and Document_complete.
Hope this will help to get when page downloaded completly.
To get knowledge of error you should check MSDN for IWebBrowser2 control.
First deserve then desire. Let be deserved first.
|
|
|
|
|
who can tell me what's the CALLBACK and give me some simple code. thanks
msn:Flashcutreg@hotmail.com
|
|
|
|
|
A callback is a function that's passed to a method by a function pointer, and which then 'calls back' to provide a hook into some aspect of a functions progress, such as providing details for a progress report.
The MSDN has lots of examples, in functions that use them.
|
|
|
|
|
A Callback is a function of which the Name and Address have been registered in a special list in the excecutable file, so that other processes can access it by name It is essentially a 'Widely Advertised Function'
LateNightsInNewry
|
|
|
|
|
|
Does anyone know how to find out the bounds of esp in a running program in a System way. At the moment I use something like the following for the Upper Bound:-
///////////////////////////////
static DWORD TOP_ESP=0;
void ChckStack(void){
int CharArr[4092];
__asm mov TOP_ESP,esp;
ChckStack();
}
int GetStackTop(){
TOP_ESP=0;
try{
ChckStack();
}
catch(...){
return TOP_ESP & 0x00004000;
}
return 0; //Never Happens Throw a bone to Bill Gates
}
////////////////////////////////////////////////////
This will give me the TOS! It relies on pushing the stack until it trashes,
and assumes that it is on Page Boundaries. Any more'System' ideas, or Any ideas to find the base of the stack?
regards
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: in a running program in a System way
What do you mean by this?
Steve
|
|
|
|
|
I Meant, maybe there is an API somehere that does this in a Microsoft Approved documented way, rather than the kludge I wrote to get the allowable range of ESP. It has all to do with a custom version of longjmp, which saves away a portion of the stack before it 'jumps'. Later on, after many function calls on the cut down stack, the portion of stack is retrieved is put back.If all goes well (an there are many reasons why it should not), a bit of gerrymandering of the various registers will cause the saved process to resume where it left off. The above is ofcourse a gross simplification, we have all sorts of things to consider, starting with global variables.
In order to trap the worst of errors, it would be handy to be able to do a sanity check on the proposed value for ESP before you take the jump back. What I wrote sofar works quite well, amazingly well actually, all things considered, but, it will end up as a minor(and thankfully well hidden) part of an API for third party users. In a situation like that I feel that belts, braces, and all rescue gear available would be recommended to be in place.
Hence my request
LateNightsInNewry
|
|
|
|
|
See here[^].
Here's some code to get the limits of the stack:
#include <windows.h>
#include <iostream>
int main(int argc, char* argv[])
{
DWORD top;
DWORD bottom;
__asm
{
mov EAX, FS:[4]
mov top, EAX
mov EAX, FS:[8]
mov bottom, EAX
}
using namespace std;
cout << hex << showbase << "top = " << top << ", bottom = " << bottom << endl;
return 0;
}
Steve
|
|
|
|
|
Sorry for the thread highjack, but...
Cool! Thanks for the link
|
|
|
|
|
Thanks Steve,
Your answere points in the right direction. This however appears to give the TOS Committed Page Linear Address. What I would be looking for is the TOS Reserved Page Linear Address. When trying to rebuild a saved stack, After other processes played havoc, the committed stack could well have depleted. (we were not using that portion of the stack after all). The stack adjustment we are talking about here, has been known to span several hundreds of kByte.
Hence, in this case, the stack to be restored, should not be compared to the committed pages, but the the reserved pages.
regards
LateNightsInNewry
|
|
|
|
|
I need to send a set of WM_USER+x Messages into a Dialog, which is sitting waiting in a Modal Loop on another thread. How do I thread in an SDK WindowProcedure with MFC in such a way that I get a copy of all parameters.
regards
LateNightsInNewry
|
|
|
|
|
to ues some individual jpeg pictures to make video,no matter the form of the video(avi,divx,xvid,mpeg4,mpeg2.....)
thank you~
|
|
|
|
|
The answer is not going to change. IS google broken where you live ?
|
|
|
|
|
ok i have 2 questions.
does anyone know how to check and see if a shortcut is good or points to nothing? (i know the short answer of click it lol)
and is there a list of all shortcuts in the registry somewhere?
|
|
|
|
|
locoone wrote: ...is there a list of all shortcuts in the registry somewhere?
I believe they are stored in special folders - check out SHGetFolderPath() API
This article may be helpful: CShortcut (Shell links to special folders)[^]
|
|
|
|
|
Hi all,
I need help with string functions in C.
Eg.,
const char *str1 = "Apple+Orange+Pineapple";
I need to crack the list above and get them as three different strings like
str2 = Apple
str3 = Orange
str4 = Pineapple
The "+" sign separates them.
How do I do it? Can anyone help? Thanks in advance.
|
|
|
|
|
strtok will tokenise a string ( split it based on a token ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for your help. Is there a simple code snippet that you can send ?(if you have one). Thanks.
|
|
|
|
|
|
Thanks. was very helpful.
|
|
|
|
|
I assume you're writing in C (not cpp).
well, copy the lot to a buffer, and scan the string. Every time you find a '+' you replace it with a 0, and store the advanced pointer in the result atrray
e.g
int Breakup(char* str,char Sep,int nMax char* Result[]){
int i,j=0;
if(str==NULL)return -1;
int len =strlen(str);
char* buf=malloc(len);
if(buf==NULL)return -2;
Result[j++]=buf;
for(i=0;i<len;i++){
if(buf[i]!=sep)continue;
buf[i]=0;
result[j++]=buf[i+1];
if(j>=nMax)return nMax;
}
return j;
}
Don't be stuck, but thee's a lot to be said for CPP!
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: copy the lot to a buffer, and scan the string. Every time you find a '+' you replace it with a 0, and store the advanced pointer in the result atrray
Why not just use strtok() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|