English
Regulars table & Café

Bräuchte small VB translate to XProfan course

 

Clemens
Meier
too of me first once glad Easter all.

I have the following small trouble. I have a Source in VisualBasic found ([...] ). the meiste from it is me too clear and still came me with the Translation suddenly deliberating:

it's about The wininet.dll. as example standing in Visual Basic:
Private Declare Function InternetOpenA Lib wininet.dll ( _
ByVal lpszCallerName As String, ByVal dwAccessType As Long, _
ByVal lpszProxyName As String, ByVal lpszProxyBypass As String, _
ByVal dwFlags As Long) As Long

Later becomes The function How follows called:
hOpen = InternetOpenA( _
INET_CallerName, OpenType, _
vbNullString, vbNullString, 0)

I have the in XProfan now How follows interprets:
def InternetOpenA(5) !wininet.dll,InternetOpenA

and later the appeal:
hOpen& = InternetOpenA($INET_CallerName,opentype&,,,0)

($INET_CallerName have I as Constant definiert)

1. would be The Translation so far okay?
2. on some to put go Strings transfer, without that on The length geachtet becomes. on others to put must The length of Strings in the Funktionsaufruf mitübergeben go. I suppose, I in the second entrapment not whom String self, separate The Addresse the Strings and then its length transfer should. or ought to one in this Make not rather a area instead of the Strings transfer?
3. sometimes finds one The Bezeichnung vbNullString. is the identical with in XProfan?

I thanks already times for The Help
 
XProfan 9.1; XP SP2; FF; Editpad
04/15/06  
 



are everything nullterminierte Strings, So one Chr$(0) mark the end the Strings!
example for nullterminierten String:
CompileMarkSeparation
Declare MeinString$
MeinString$ = blub + Chr$(0)
Addr(MeinString$)re>

with the Addr becomes then the Pointer to the nullterminiertem String transfer.
 
04/15/06  
 




Clemens
Meier
tommorrow

mean You, that any Strings only as address transfer go? are with XProfan The Strings not automatically nullterminiert? Should still, because too XProfan must still discern, when the end one Strings come is.
 
XProfan 9.1; XP SP2; FF; Editpad
04/15/06  
 




RGH
Clemens Meier
mean You, that any Strings only as address transfer go?


Yes, The API knows only 32-bit-Integer as Parameter. in the entrapment of Strings means a Zeiger the first characters one strings. the end desselben becomes through one zero-byte marked. the means though too, that in API-Call in einm String no zero-byte vorkommen must. (there's a few Ausnahmen, where one simple zero-byte in the string vorkommen must and the end through one doppeltes zero-byte marked is.)
The Kennung lpsz means: Long Pointer String Zeroterminated - Zeiger on nullterminierten String.

Clemens Meier
are with XProfan The Strings not automatically nullterminiert? Should still, because too XProfan must still discern, when the end one Strings come is.


No Strings in XProfon are in the Normalfall not nullterminiert and can therefore too as much as you want zero-Bytes include. into Bytes to the Stringanfang standing z.B. The length the Strings. (it deals itself around the Ansi-Strings of Delphi.)

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/15/06  
 




RGH
Clemens Meier
sometimes finds one The Bezeichnung vbNullString. is the identical with in XProfan?


there XProfan with one API-appeal with one String-Literal (here: ) which address commit would in this drop means The address on a Leerstring transfer. If to the wants, would But rather, too whom Empty-String with a Nulbbyte abzuschließen: z (this is identical with chr$(0) ).

there's however some API-functions, The with a Zeiger on a Leerstring not so right get by. These expect then simply in lieu of the address the Leerstrings a 0 as mark, that this Parameter not used becomes. i'd means everywhere, where vbNullString standing, simply a 0 hinschreiben:
CompileMarkSeparation
hOpen& = InternetOpenA(Addr(INET_CallerName$), opentype&, 0, 0, 0)
>

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/15/06  
 




Clemens
Meier
now, something schlauer be I already become. but nevertheless still something confused:

In VB find I subesquent appeal of/ one function:
hRequest = HttpOpenRequestA( _
hConnect, POST, Path, HTTP/1.0, _
vbNullString, 0, INTERNET_FLAG_RELOAD, 0)

How Roland writes, becomes with one String-Literal The address transfer, in the obigen example means The address of String POST or. HTTP/1.0 but here without Nulltermination. ought to one in XProfan as a precaution POSTz or. HTTP/1.0z write or does it then without?

Also at Weiterübersetzen be I on the following punched:
InternetReadFile hRequest, Buffer, Len(Buffer), Bytes

InternetReadFile is again a Api function, The but none worth zurückgibt, instead sowohl whom Buffer, as well as Bytes with Values equips. in the Api-Definition becomes Bytes as Long indicated. it'll So one 4 Bytes great worth into written. in the drop give I in XProfan well too The address of Bytes& on, correctly.? In XProfan would The row How follows looks:
InternetReadFile(hRequest&,addr(buffer#),sizeof(buffer#),addr(bytes&))

correctly. so?

(I suppose, The function sizeof gives on, How tall the Buffer dimensioniert watts and not, How tall the itself therein located nullterminierte String is.)

I have straight on some further VB-pages class programs found, of them it itself lohnen would, in XProfan To translate

P.s.: have in the XProfan-Help following Lines found:

eachone String becomes through one Nullbyte (characters with the code 0) exits. On these point can Strings OHNE detour over Memory-Variables on API-functions transfer go, about:

MSGBOX(0, @Addr(cover$), @Addr(Text$), Stil&)

On well german, Strings need I do not extra with a z slip, separate must just The address transfer, there eachone String with a Nullbyte slip becomes. still the standing in the Widerspruch to the, what Roland a little while ago written has. I mean, if I reinen Text have (no Image or ähnliches, I anyhow in a area write would), need I the end not extra To mark. If I do not sure be, whether it itself circa reinen Text deals, ought to one to safety one z append.

I fasse times for me together:
Strings and Buffer go not directly transfer, separate only its Adressen. Ggf. becomes with one Buffer yet The Size the Buffers (Bereiches) mitangegeben, if The Api-function values into write would like. Integer and Long go into most Make directly transfer, unless, The Api-function would like these values give back, then gives one The jeweilige address on, so that in XProfan the worth immediate in the variables drin standing.

vbNullString supplant one on the simplest with the worth 0.
 
XProfan 9.1; XP SP2; FF; Editpad
04/15/06  
 



rather is it in the MSDN or in the PlatformSDK nachzusehen.


BOOL InternetReadFile(
HINTERNET hFile,
LPVOID lpBuffer,
DWORD dwNumberOfBytesToRead,
LPDWORD lpdwNumberOfBytesRead
);


lpBuffer becomes one Pointer expects, means The address, siehste on the lp, the same thing counts for lpdwNumberOfBytesRead
The remainder becomes directly transfer, means ByVal, the others name itself in VB ByRef.
into Beschreibungen in the PSDK standing too always explicit what expects becomes!
 
04/15/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

2.971 Views

Untitledvor 0 min.
H.Brill10/03/22
Peter Max Müller11/27/11
Stephan Lührsen08/17/11
Julian Schmidt04/08/11

Themeninformationen

this Topic has 3 subscriber:

Clemens Meier (3x)
RGH (2x)
unbekannt (2x)


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