|
hey,
i need to create a web browser control for my app. i'm using mfc, and don't want to use .net's web browser control (unless i can statically link it).
ive searched the articles and found a few things, but they are all pretty complicated. i don't need to display the page, just connect to a server and store the html code in a string.
is their a simple way to do this?
thanks in advance,
sam kline
|
|
|
|
|
If you are using webbrowser control, when load completes you must use IHTMLDocument and related interfaces to retrieve the code but in your case, my recomendation is to use sockets to connect to the server, send it the minimal http request header and parse the response.
I believe it can be less complicated and avoid webcontrol dependency.
Best regards,
Mauro.
|
|
|
|
|
Have a look at the MFC internet class - CInternetFile etc. They will let you download a web page as a CFile object that you can just call Read() on to get the page data.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
thats what i used.
thanks & nice article.
Sam Kline
|
|
|
|
|
How can I add a carriage return at the end of a CString?
|
|
|
|
|
CString s;
s += _T("\n");
s += _T("\r\n");
Steve
|
|
|
|
|
Thanks a lot. I don't know why I didn't think of that.
|
|
|
|
|
isn't \n\r work or \r\n ..!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
It depends on what the string will be written to. If it's a text file, use \r\n uness you're going to be using the C I/O functions, in which case use \n and let the CRT change it to \r\n on its own. For multi-line text boxes, use \r\n .
\n\r is never right.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote: \n\r is never right.
Right
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Can Any one please tell me how can I compile and see the result(on the screen) of the following program using VisualStudio?
include<stdio.h>
main()
{
int i=3;
int*j;
j = &i;
printf("The value of i=%d",*j);
}
|
|
|
|
|
Though I personally use streams (cout) for my programs at school, and I am not familiar with the printf() function, If you are using VC++.Net, I think you actually have to put a system("pause"); at the end of your program or it will not remain open long enough for you to see anything... other than that, you'll have to wait for someone else to answer. I hope it helps!
sincerely, Brett Peirce - PolerBear
To err is human; To forgive: divine.
|
|
|
|
|
use getch() function at last,declare in conio.h
|
|
|
|
|
Hi! I have a template function problem.
This is what I tried to do:
First, I created a .lib file called writeValue.lib, using this source code:
<br />
#include <iostream><br />
<br />
template <class T><br />
void __cdecl writeValue( T value )<br />
{<br />
std::cout << value << flush;<br />
}<br />
Then, I tried to build a Win32 Console Project, in which I put a single file called main.cpp, containing the following lines:
<br />
template <class T><br />
extern void __cdecl writeValue( T value );<br />
<br />
#pragma comment( lib, "writeValue" )<br />
<br />
int main( void )<br />
{<br />
writeValue <int> ( 10 );<br />
<br />
return 0;<br />
}<br />
It compiles, so I get a main.obj, it links writeValue.lib, but I get a link error when I try to use the writeValue( ) function with an integer parameter:
error LNK2019: unresolved external symbol "void __cdecl writeValue<int>(int)" (??$writeValue@H@@YAXH@Z) referenced in function _main
- even though the writeValue( ) function is defined (as a template) in the writeValue.lib file.
All was done in Microsoft Visual Studio .NET Professional 2003.
Can anyone help me with this, please? Thank you!
|
|
|
|
|
|
I want to invoke a certain method when a edit control is double clicked, but i cant seem to find any info on the event handling that i need to do. Any help would be appriacated, thank you.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Is this MFC or not?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yea, MFC. Using .NET '02
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
I would instruct you to use ClassWizard, but that does not exist beyond VS v6. I think it has been "replaced" with a properties-type of thing. In any case, You'll need a ON_BN_CLICKED() entry in the dialog's BEGIN_MESSAGE_MAP() method. Don't forget to implement the handler function.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I tried that. It complies fine, but when its running i tried it out, and it never reachs my method that i attached to it through the ON_BN_CLICKED() method... As of now im just grabbing the cursor on any double click, and having to compare to where my edit controls are, but this seems way to complex for something that i feel should an easier way..
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
See the example here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a dialog with several controls in it for several miscellaneous functions. Among them, I created a pushbutton control (function) which, when entered, loops forever processing the following:
opens a file, processes file data, closes the file, sleeps to
allow file access and repeats within the loop.
Once I select the pushbutton to do this, it locks me out from any of the other controls. How can I suspend (etc.) the loop to allow me to tell if another control has been selected and, if so, leave this loop to process the selected control.
Thanks, Ron
|
|
|
|
|
ronwurster wrote: opens a file, processes file data, closes the file,
You need to put this code in a worker thread.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|