Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Nur Frame ändern (https://www.delphipraxis.net/65538-nur-frame-aendern.html)

tms 17. Mär 2006 17:33


Nur Frame ändern
 
Hi!
Ich rufe in Delphi im Webbrowser eine Seite mit Frames auf. Über einen Button möchte ich aber nur eine Frame austauschen. Wie mach ich das??

tms 18. Mär 2006 16:58

Re: Nur Frame ändern
 
SO hab nochmals intersiv gegoogelt:

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant); overload;

Das ist alles, was ich gefunden habe:

Bisher hab ichs so: WebBrowser1.Navigate(url);

Wie bekomm ich da jetzt das Frame rein??

Thomas

Master_RC 18. Mär 2006 17:11

Re: Nur Frame ändern
 
Schau doch mal die Parameter von "Navigate()" an ;)

procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant);

tms 18. Mär 2006 18:14

Re: Nur Frame ändern
 
WebBrowser1.Navigate(url,'','frame');

So klappt es aber leider nicht!

Thomas

Master_RC 18. Mär 2006 18:35

Re: Nur Frame ändern
 
TargetFrameName ist ja vom Typ her auch kein String ;)

Schau mal nach, wie das Ding aussieht (Bei Delphi7 kann ich einfach per STRG+Klick auf das Ding herausfinden, was das ist :) )

tms 18. Mär 2006 18:56

Re: Nur Frame ändern
 
Hab Delphi 2005 PE und da klappt es nicht, könnstest es du mir nicht einfach bitte sagen, wie es geht??

Thomas

marabu 18. Mär 2006 19:02

Re: Nur Frame ändern
 
Delphi-Quellcode:
WebBrowser.Navigate('http://www.delphipraxis.net', null, 'bigframe', null, null);
Grüße vom marabu

tms 19. Mär 2006 09:29

Re: Nur Frame ändern
 
WebBrowser.Navigate('http://www.delphipraxis.net', null, 'bigframe', null, null);

gibt folgenden Fehler aus:
E2250 Es gibt keine überladene Version von 'Navigate', die man mit diesen Argumenten aufrufen kann

marabu 19. Mär 2006 09:35

Re: Nur Frame ändern
 
Hallo Thomas,

jetzt ist der Augenblick gekommen, an dem du völlig selbständig in die Referenz zum IWebBrowser2 Interface rein schauen musst: klick

marabu

tms 19. Mär 2006 10:46

Re: Nur Frame ändern
 
Hi!

Ich komm damit leider nicht weiter:

Zitat:

Syntax

HRESULT Navigate( BSTR url,
VARIANT *Flags,
VARIANT *TargetFrameName,
VARIANT *PostData,
VARIANT *Headers
);
Parameters

url
[in] Required. A BSTR expression that evaluates to the URL, full path, or Universal Naming Convention (UNC) location and name of the resource to display.
hab ich so gemacht, da kann man ja nichts falsch machen!
Zitat:

Flags
[in] Pointer to a variable that specifies whether to add the resource to the history list, whether to read to or write from the cache, and whether to display the resource in a new window. The variable can be a combination of the values defined by the BrowserNavConstants enumeration.
TargetFrameName
[in] Pointer to a string that contains the name of the frame in which to display the resource. The possible values for this parameter are:
_BLANK
Load the link into a new unnamed window.
_PARENT
Load the link into the immediate parent of the document the link is in.
_SELF
Load the link into the same window the link was clicked in.
_TOP
Load the link into the full body of the current window.
<WINDOW_NAME>
A named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link.
Will ich ja machen! Auch in <> bringt nichts.
Zitat:

PostData
[in] Pointer to data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter does not specify any post data, IWebBrowser2::Navigate issues an HTTP GET transaction. This parameter is ignored if URL is not an HTTPURL.
Headers
[in] Pointer to a value that contains the HTTP headers to send to the server. These headers are added to the default Microsoft Internet Explorer headers. The headers can specify things such as the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL is not an HTTPURL.
Return Value

Returns one of the following values.

S_OK The operation was successful.
E_INVALIDARG One or more parameters are invalid.
E_OUTOFMEMORY Out of memory.


Remarks

The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The VARIANT should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.

The WebBrowser control or InternetExplorer object can browse to any location in the local file system, on the network, or on the World Wide Web. Use the IWebBrowser2::Navigate method to tell the browser which location to browse to. By including a text box in your application, you can let the user specify the location to browse to and then pass the location to the IWebBrowser2::Navigate method.

In Internet Explorer 6 or later, you can navigate through code only within the same domain as the application hosting the WebBrowser control. Otherwise, this method is disabled.
Also ich kann leider keinen Fehler feststellen!


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:03 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz