English
C ++ Forum

Return worth is correct not

 
- Page 1 -



Georg
Hovenbitzer
Hello Sebastian,

I have time again größeres trouble.
The geniale following code stammt of Pascal, soetwas could I I do not conceive.
it determined whom Source a opened IE Window, How z.B. www.google.de.
to that Test Please no large Page take, since the Zuweisung to that Edit area in the Beispielt yet by SetText goes.

in the Interpreter and as Profan Exe runs it super, übersezt comes always a Schutzverletzung.
The row The whom Error causes is the:
Error& = CallMethod(IHTMLElement&,62,@Addr(Text&))

The reason is for, that the appeal before it of:
Error& = CallMethod(IHTMLDocument2&,9,@Addr(IHTMLElement&))

an Error& number <> 0 zurückt gives and IHTMLElement&, same 0 is.

might this trouble the Übersetzen his ?
CompileMarkSeparation
 $H D:PrivatProfanXProfan9INCLUDEWindows.ph
---------------Umwandlung String > globally unique identifier

Proc StringToGUID

    Parameters GUID$,GUID&
    Declare Temp$
    Temp$ = @Space$(80)
    ~MultiByteToWideChar(1,1,@Addr(GUID$),-1,@Addr(Temp$),80)
    @External("ole32","CLSIDFromString",@Addr(Temp$),GUID&)

EndProc

-----------------------------------------------------------------------
--------------------------Methode eines COM-Interfaces aufrufen

Proc CallMethod

    Parameters IFace&,Method&
    Declare VTable&
    VTable& = @Long(IFace&,0)
    Method& = @Long(VTable&,(Method& * 4))
    Case %PCount = 2 : Return @Call(Method&,IFace&)
    Case %PCount = 3 : Return @Call(Method&,IFace&,@&(3))
    Case %PCount = 4 : Return @Call(Method&,IFace&,@&(3),@$(4))
    Case %PCount = 5 : Return @Call(Method&,IFace&,@&(3),@&(4),@&(5))

EndProc

-----------------------------------------------------------------------
----------WideChar (UniCode) zu MultiByte (Ansi) [nur OLE!]

Proc OLE_WideToMulti

    Parameters Text&
    Declare Text$,Size&,Text#
    Size& = @External("oleaut32","SysStringLen",Text&)
    Dim Text#,Size&
    Clear Text#
    ~WideCharToMultiByte(0,0,Text&,-1,Text#,Size&,0,0)
    @External("oleaut32","SysFreeString",Text&)
    Text$ = @String$(Text#,0)
    Dispose Text#
    Return Text$

EndProc

-----------------------------------------------------------------------
------------------------------EnumChildProc---------------------------

Proc EnumChildProc

    Parameters wnd&
    Declare Name#
    Dim Name#,255
    ~GetClassName(wnd&,Name#,255)
    Case @String$(Name#,0)="Internet Explorer_Server" : IEServerWnd& = wnd&
    Dispose Name#
    Return 1

EndProc

---------------------------------------------------------------------------------
--------------------------RunningIE_GetText-----------------------

Proc RunningIE_GetText

    Parameters IEHwnd&
    Declare Error&,IID#,Msg&,Result&,oleacc&,IHTMLDocument2&,IHTMLElement&,Text&,Text$,Url&,Url$
    Dim IID#,16
    Declare IEServerWnd&
    ~EnumChildWindows(IEHwnd&,@ProcAddr(EnumChildProc,2),0)
    @ProcAddr(EnumChildProc,-2)--ProcAddr freigeben
    Print "IEServerwnd&",IEServerWnd&
    Print
    Msg& = ~RegisterWindowMessage("WM_HTML_GETOBJECT")
    Print "msg",Msg&
    Print
    Error& = ~SendMessageTimeout(IEServerWnd&,Msg&,0,0,~SMTO_ABORTIFHUNG,1000,@Addr(Result&))
    Print "Error SendMessageTimeout",Error&
    Print "Result SendMessageTimeout",Result&
    @External("ole32","CoInitialize",0)
    oleacc& = @UseDLL("oleacc.dll")
    Print "oleacc",oleacc&
    Print
    StringToGUID("{332c4425-26cb-11d0-b483-00c04fd90119}",IID#)--IID_IHTMLDocument2
    Error& = @External("oleacc","ObjectFromLresult",Result&,IID#,0,@Addr(IHTMLDocument2&))
    Print "Error ObjectFromLresult",Error&
    Print "IHTMLDocument2",IHTMLDocument2&
    FreeDLL oleacc&
    Error& = CallMethod(IHTMLDocument2&,9,@Addr(IHTMLElement&))--IHTMLDocument2::get_body
    Print "Error IHTMLDocument2::get_body",Error&
    Print "IHTMLElement",IHTMLElement&
    Print
    ----------------------------------------------Quelltext ermitteln
    Error& = CallMethod(IHTMLElement&,62,@Addr(Text&))--IHTMLElement::get_outerHTML
    Print "Error IHTMLElement::get_outerHTML",Error&
    Print "Result get_outerHTML",Text&
    Print
    Text$ = OLE_WideToMulti(Text&)
    -------------------------------------------------------URL ermitteln
    Error& = CallMethod(IHTMLDocument2&,40,@Addr(Url&))--IHTMLElement::get_URL
    Print "Error IHTMLElement::get_URL",Error&
    Print "Result get_URL",URL&
    Print
    Url$ = OLE_WideToMulti(Url&)
    Print "URL = ";Url$
    Dispose IID#
    @External("ole32","CoUninitialize")
    Return Text$
    EndProc---------------------------------------------------------------------------------
    Window 0,0-800,600
    Declare Fenster&
    Declare Edit&
    Declare Quell$
    Declare IEServerWnd&
    Fenster& = ~FindWindow("IEFrame",0)--Hier könnte man auch andere Möglichkeiten nehmen,

    IfNot Fenster&---------------------z.B. Suche nach Fenstertitel.

        Print "Bitte IE starten!!"------Benötigt wird das gewünschte Hauptfenster des IE!
        WaitInput
        End

    EndIf

    Quell$ = RunningIE_GetText(Fenster&)

    If @Len(Quell$)

        Edit& = @Create("multiedit",%hwnd,"",300,20,450,500)----Text anzeigen
        SetText Edit&,Quell$

    EndIf

    './../../Function-References/XProfan/waitkey/'>WaitKey
    End
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
05/17/06  
 



 
- Page 2 -



Michael
Wodrich
[quote:c61d21d565]
[quote:c61d21d565]
Why means not

Set(P2CPP:...,1)
[/quote:c61d21d565]
2. XProfan would a such instruction with Unbekannter switch: P2PP... receipting...
[/quote:c61d21d565]
No, iF meant whom new commands of XProfan10:
CompileMarkSeparation
only time so to that understanding.

Best wishes
Michael Wodrich

where me straight auffällt, the XPSE The new command Yes any yet beigebracht go must. A good opportunity for Präprozessor-switch...
 
Programmieren, das spannendste Detektivspiel der Welt.
05/24/06  
 



[quote:25d48ad347]where me straight auffällt, the XPSE The new command Yes any yet beigebracht go must. A good opportunity for Präprozessor-switch...[/quote:25d48ad347]
some 10it have I the XPSE already beigebracht - I bemühe me too the the remainder not such a long time on itself Waiting can.
 
05/24/06  
 



@Sebastian: I mean only the comments too such his stay should. I mean one could crazy go if one now too hereon respect ought to what The Comments imply. Ne ne, Rems with weight - the find I not at all well!

I faith another Solution must since, and not therefore because I the XPSE procure should The Comments To parsen.
 
05/24/06  
 




Sebastian
König
[quote:4dc4baa0c2]there a Possibility The CPP Source manually so To Change as later by switch his becomes.
there it Yes still so a couple Problems gives (DLLs must by UseDLL loaded go, urlmon.dll functions with manchen left not any more, Hotkeys weg not) would I this gladly time try.[/quote:4dc4baa0c2]
Yes - clear But something with difficulty: any External and Call between whom Schaltern müssten in External_ST or. Call_ST changed go...
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
05/24/06  
 




Michael
Wodrich
and how'bout then herewith?

$DEFINE name: setting a circumstance
$UNDEF name: setting a circumstance back

this is still anyhow solely feed for Präcompiler. here can Sebastian then whom suitable names pretending, the uses go must, z.B.:

$DEFINE p2cpp_irgendeinschalter

so need one then too nothing new To invent - XProfan 10 has it Yes on board.

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
05/24/06  
 




Sebastian
König
[quote:d6877f32d4]the Set(...,x) was that's all right - only ought to it hold of Präprozessor worn out go.

If XPSE now so a erweiterbaren commands bekäme, then could too any of Profan not understood XPSE-command there into.

$Set(XPSE,cx)
$Set(P2CPP,external_on)
$Set(P2CPP,call_on)
...[/quote:d6877f32d4]
as long as the whole in a comment standing and accordingly Profan self not disturbing is it Yes ok - where I The Syntax already almost To tricky find... ;)

[quote:d6877f32d4]$DEFINE name: setting a circumstance
$UNDEF name: setting a circumstance back

this is still anyhow solely feed for Präcompiler. here can Sebastian then whom suitable names pretending, the uses go must, z.B.:

$DEFINE p2cpp_irgendeinschalter[/quote:d6877f32d4]
really a nice idea - but unfortunately neither abwärtskompatibel To older Profan-versions
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
05/24/06  
 




Sebastian
König
[quote:d01220718e]@Sebastian: I mean only the comments too such his stay should. I mean one could crazy go if one now too hereon respect ought to what The Comments imply. Ne ne, Rems with weight - the find I not at all well![/quote:d01220718e]
the see I really differently - and there's with the #!/be/sh too one right bekanntes Example for a comment-row with weight!

I find too, one ought to the whole not überbewerten: It's all right here really about a very Special Situtation, namely around the manipulation the Translation of External(), Call() for integrally defined pieces the Codes - possibly becomes the except Georg in this drop not even someone need... In so well How all Make is the integrally normal Translation this functions Yes completely aale!

If one this deliberating, is with the whom Kommentaren really the most beautiful Possibility, The me so falls in...
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
05/24/06  
 




Michael
Wodrich
And if one with this Spezialkommentaren certainly, that before it no commands stand must - means to beliebigen Whitespaces follows the Kommentarzeichen with the Spezialbefehl - then can itself the too properly filter out (comments weg Yes until Zeilenende).
its then Yes always on of/ one row for itself.

I see the too as only Possibility for Abwärtskompatibilität - and the has P2CPP Yes on The tab written.

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
05/24/06  
 




Georg
Hovenbitzer
[quote:fec088bf63]Yes - clear But something with difficulty: any External and Call between whom Schaltern müssten in External_ST or. Call_ST changed go...[/quote:fec088bf63]
Hello Sebastian,

if I it correctly. understood have, must I still only The Aufrufe The whom Error cause with .._ST slip and no define settle.
If this is correct are not so many
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
05/24/06  
 




Sebastian
König
Hello Georg,

[quote:e363eebe1e]if I it correctly. understood have, must I still only The Aufrufe The whom Error cause with .._ST slip and no define settle.
If this is correct are not so many [/quote:e363eebe1e]
Yes, but so the Thread-context always is correct, should You as a precaution any Aufrufe in the Prozeur Runningie_gettext adjust.

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
05/24/06  
 



 
- Page 3 -



Georg
Hovenbitzer
Hello Sebastian,

it has worked
any Externals and Calls The needed get geänder well then runs everything without Error
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
05/25/06  
 



there can I only say respect Sebastian!

what kind of nude!
 
05/25/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.799 Views

Untitledvor 0 min.
Normann Strübli02/05/23

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie