Browser in C++

Kaiser206

Erfahrenes Mitglied
Hi,
kann mir mal jemand sagen wie man einen Browser in C++ programmiert der nur den Quelltext einer Hp ausgeben soll?
 
moin


Suchfunktion!
Das Thema gab es schon oft genug.

Und wenn dann gib mal ein bscihen mehr Informationen.
Mit reinem C++ kommst du nciht weit, mit MFC ist es ein Kinderspiel!
Aber wie gesagt, Suchfunktion benutzen, dann eine konkrete Frage stellen!


mfg
umbrasaxum
 
moin


Habs mir grad nochmal durchgelesen was du überhaupt willst.
UNd wie es aussieht reicht es dir die html Datei runterzuladen und irgendwie auszugeben (wie ausgegeben werden soll hast du ja nciht genau gesagt).
Aber dazu gibt es hier auch Informationen.


mfg
umbrasaxum
 
Nun,
Ich habe lange gesucht und nichts passendes gefunden.
Nochmal eine Erläuterung:
Ich will einen Browser Programmieren weiß aber nicht wie man in C++ auf eine Webseite >>ZUGREIFT<< das ist es was ich eigendlich wissen wollt!
Ich habe versucht passendes zu finden aber nix gefunden!
 
moin


Mit zugraifen meinst du also einlesen/runterladen.
Guck dir mal die Funktion "URLDownloadToFile" an, die sollte machen was du möchtest.


mfg
umbrasaxum
 
Tja,
Im ganzen Internet (google.de) steht nix mit URLDownloadToFile und c++. URLDownloadToFile ist zwar eine Funktion von Delpfi aber für c++ konnt ich nix finden.
Wie soll sie den Funktionieren. In meinem Handbuch das mit dem Compiler geliefert wurde steht irgend ein Text mit diesem Befehl der ungefähr 4 Seiten groß ist und sich in keiner Weise kompileren lässt...
Wie ist den die Syntax für ihn?
Muss man vorher noch etwas initialisieren?
Ich gucke jedenfalls noch etwas im Internet nach...
 
moin


MSDN hat gesagt.:
Downloads bits from the Internet and saves them to a file.

Syntax

HRESULT URLDownloadToFile( LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
Parameters

pCaller
Pointer to the controlling IUnknown interface of the calling Microsoft® ActiveX® component (if the caller is an ActiveX component). If the calling application is not an ActiveX component, this value can be set to NULL. Otherwise, the caller is a Component Object Model (COM) object that is contained in another component (such as an ActiveX control within the context of an HTML page). This parameter represents the outermost IUnknown of the calling component. The function attempts the download within the context of the ActiveX client framework and allows the caller's container to receive callbacks on the progress of the download.
szURL
Pointer to a string value containing the URL to be downloaded. Cannot be set to NULL.
szFileName
Pointer to a string value containing the name of the file to create for bits that come from the download.
dwReserved
Reserved. Must be set to 0.
lpfnCB
Pointer to the caller's IBindStatusCallback interface. URLDownloadToFile calls this interface's IBindStatusCallback::OnProgress method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called. Implementing IBindStatusCallback::OnProgress allows a caller to implement a user interface or other progress monitoring functionality. It also allows the download operation to be canceled by returning E_ABORT from the IBindStatusCallback::OnProgress call. This can be set to NULL.
Return Value

Returns one of the following values.

E_OUTOFMEMORY The buffer length is invalid or there was insufficient memory to complete the operation.
S_OK The operation succeeded.


Remarks

The client can choose to be notified of progress through a notification callback.

Function Information

Header Urlmon.h
Import library Urlmon.lib
Minimum availability Internet Explorer 3.0
Minimum operating systems Windows NT 4.0, Windows 95


mfg
umbrasaxum
 
ok
das hat mir schon etwas weitergeholfen jetzt nur noch eine Frage:
Was ist an deisem Befehl falsch?

URLDownloadToFile(0, "http://www.met.fu-berlin.de/wetter/meteosat/met_512.mpg", "c:/xyz.mpg", 0, 0);

Der Fehler lautet[C++ Error] URLMON.H(186): ) expected.

Hier ist das Programm:

//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#include <Urlmon.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
URLDownloadToFile(0, "http://www.met.fu-berlin.de/wetter/meteosat/met_512.mpg", "c:/xyz.mpg", 0, 0);
}
//---------------------------------------------------------------------------

Der Fehler scheit hier zu liegen:

STDAPI CoGetClassObjectFromURL( REFCLSID rCLASSID,
LPCWSTR szCODE, DWORD dwFileVersionMS,
DWORD dwFileVersionLS, LPCWSTR szTYPE,
LPBINDCTX pBindCtx, DWORD dwClsContext,
LPVOID pvReserved, REFIID riid, LPVOID * ppv);
 
Zuletzt bearbeitet:
Ich habe inet.lib eingebunden urlmon.lib ist bei mir nicht vorhanden wo bekomme ich es her?

---
so jetzt gehts...

LPCWSTR szTYPE,

wenn ich das hier entferne läuft alles! Aber woran liegt das?
Ich meine das steht da sicher nicht umsonst!

STDAPI CoGetClassObjectFromURL( REFCLSID rCLASSID,
LPCWSTR szCODE, DWORD dwFileVersionMS,
DWORD dwFileVersionLS, LPCWSTR szTYPE,
LPBINDCTX pBindCtx, DWORD dwClsContext,
LPVOID pvReserved, REFIID riid, LPVOID * ppv);
 
Zuletzt bearbeitet:
Zurück