English
Forum

nproc / sizeof / DrawText / Structures

 

Ernst
Why bleats XPSE with the function sizeof  in a nproc
( warning: undeklarierte function : SIZEOF )
too {$pushkeyword sizeof} helps not
 
05/05/14  
 




E.T.
on which place in the View source standing because the {$pushkeyword sizeof}  ??
 
XProfan X2
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
05/05/14  
 




Ernst
as Kompilerschalter at the beginning

{$iq}
{pushkeyword sizeof}

or.

{pushkeyword sizeof}
{$iq}

both attempts - Result same
----------
subsequently come same two ask involved DrawText and Structures...

with the attempt The API ~DRAWTEXT To use, there because of the xpse-own function The
warning: function DRAWTEXT expects with Parameter 4.
function: WNDPROC
remedy: STR
 
can The API-function somehow reindrücken or can only on Umwegen to that target (Textausrichtung , etc.) come ?

to that second, z.B. Paintstruct: alike How I try the structure reinzubekommen is the Message there
warning: "PAINTRUCT" : Kollision with structure (PAINTSTRUCT) 
if xpse The different Structures already knows, How use I tappt im dunkeln then correctly. ?
Regards
 
05/05/14  
 




Nico
Madysa
serious (05.05.14)

Why bleats XPSE with the function sizeof in a nproc
( warning: undeklarierte function : SIZEOF )
too {$pushkeyword sizeof} helps not


within NProcs must You only self defined functions use and such, The of XPSE for NProcs ready set go. You must not of it go out, that any XProfan-functions within NProcs How dwelt functions.

If you into XPSE-Function Reference [...]  schaust, become You check, that the commands not existing.

I suppose, that You The Size in Bytes of/ one Memory-Variables having want. in the entrapment is it rather, GlobalAlloc  [...]  To use, The sustained address in a Longvariablen To Save and these then as an Memory-Variable To use. Dispose  becomes then through GlobalFree  [...]  supplant, SizeOf  through GlobalSize  [...] .
CompileMarkSeparation
 $H Window.ph

nproc DoATest

    parameters value&
    var mem& = GlobalAlloc(~GPTR, 4)
    SetLong(mem&, 0, value&)
    var returnValue& = GetLong(mem&, 0)
    GlobalFree(mem&)
    return returnValue

endproc

cls
print "Ergebnis:", DoATest(42)
'Ergebnis: 42
waitinput
end

serious (05.05.14)

with the attempt The API ~DRAWTEXT To use, there because of the xpse-own function The
warning: function DRAWTEXT expects with Parameter 4.
function: WNDPROC
remedy: STR
can The API-function somehow reindrücken or can only on Umwegen to that target (Textausrichtung , etc.) come ?


i'm I do not More integrally sure, but it ought to klappen, if You instead of DrawText  ~DrawText  write.

serious (05.05.14)

to that second, z.B. Paintstruct: alike How I try the structure reinzubekommen is the Message there
warning: "PAINTRUCT" : Kollision with structure (PAINTSTRUCT)
if xpse The different Structures already knows, How use I tappt im dunkeln then correctly. ?
Regards


so:
CompileMarkSeparation
I faith, XPSE allows it to you, The Tilde wegzulassen. important is, that the Strukturname not the Headerkonstanten PAINTSTRUCT  kollidiert. I suppose, that the the trouble is.
 
05/06/14  
 




Ernst
@Nico - funkt unfortunately not
The APIs write I gewohnheitsmäßig always with the Tilde; there one but these in xpse omit can, lying Maybe even therein the trouble. xpse can therefore obviously not between eigenem drawtext and api-drawtext discern and wants only 4 Parameter. Gibts for Perhaps a workaround ?

involved the Structures have I among other things too very these Variante already attempts - negative, but now is it me clear warum; I hab's within of/ one nProc attempts.

sizeof  -trouble: have I you there correctly. understood, that $pushkeyword with nProcs none Einfluss has, and ebenn only self defined, xpse-own and api-functions applied go can - there really for sizeof a adäquate (short) api-function ?
Greeting serious
 
05/06/14  
 




E.T.

{$iq}
{pushkeyword sizeof}


already time with

{$iq}
{$pushkeyword sizeof}

attempts
 
XProfan X2
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
05/06/14  
 




Ernst
@E.T.
was only one mistake in writing
have it already with {$pushkeyword sizeof} attempts (see my first question)

Nachtrag @Nico
i'm now clear, Why not functions has, because I all this within
of/ one nProc unterbringen wished - goes hold not.
"workaround" for Textausrichtung have I me already Done.
 
05/06/14  
 




Nico
Madysa
serious (06.05.14)
sizeof -trouble: have I you there correctly. understood, that $pushkeyword with nProcs none Einfluss has, and ebenn only self defined, xpse-own and api-functions applied go can


The Kompilerdirektive PUSHKEYWORD existing from Kompatibilitätsgründen and assure XPSE, that a gewisse function present is, though tappt im dunkeln XPSE not famous is -- to that example, because the function first in a neueren XProfan-Version installed been is.

within NProcs must You but no XProfan-functions use. use can you only WinAPI-functions and functions, The in the XPSE-reference [...]  definiert are. you see sure, that there manches missing.

serious (06.05.14)
there really for sizeof a adäquate (short) api-function ?
Greeting serious


Yes, GlobalSize . The problem is, I do not white, whether GlobalSize something with XProfan-own Memory-Variables to begin white. this is the reason for, I recommended have, within NProcs fundamentally only with GlobalAlloc  erstellte Speicherbereiche To use. tappt im dunkeln afford a almost same Funktionalität what about me can me hereon leave, that they make, what tappt im dunkeln should.
 
05/08/14  
 




Findus
serious (06.05.14)
@Nico - funkt unfortunately not
The APIs write I gewohnheitsmäßig always with the Tilde; there one but these in xpse omit can, lying Maybe even therein the trouble. xpse can therefore obviously not between eigenem drawtext and api-drawtext discern and wants only 4 Parameter. Gibts for Perhaps a workaround ?


In this case lying the sooner on it the it The function too again as xpse function gives directly of xpse: [...] 

there's the 4. parameter one string.

If you zentrierten Text want etc then can you Yes times the drawtextex api use because The goes well for.

but not globalfree etc would I The xpse functions take The as XProfan functions lauten means dim and dispose, The weg too in nprocs and are there too gelistet. [...] 
 
05/09/14  
 




Ernst
Findus (09.05.14)
If you zentrierten Text want etc then can you Yes times the drawtextex api use because The goes well for.

very the ist’s (i was To heavy on drawtext fixes) – thanks
Findus (09.05.14)
but not globalfree etc would I The xpse functions take The as XProfan functions lauten means dim and dispose, The weg too in nprocs and are there too gelistet.

dim and dispose use I ohnedies, but me went/goes it around the sizeof 
usually would I write
textlen& = ~GetWindowText(hWnd&, Text#, sizeof(#)-1)
but How mach I it in a nproc, The sizeof not knows – and a suitable api Have so did i not found
 
05/09/14  
 




Nico
Madysa
Findus (09.05.14)
but not globalfree etc would I The xpse functions take The as XProfan functions lauten means dim and dispose, The weg too in nprocs and are there too gelistet. [...] 


Hoppla, there Have I getrieft and the reference not correctly. red.

serious (09.05.14)
dim and dispose use I ohnedies, but me went/goes it around the sizeof
usually would I write
textlen& = ~GetWindowText(hWnd&, Text#, sizeof(#)-1)
but How mach I it in a nproc, The sizeof not knows ? and a suitable api Have so did i not found


I can very well present, that XPSEs Dim- and Dispose-functions only Wrapper circa GlobalAlloc and GlobalFree are.
look still simply time, whether the following code the expected Result outputs:
nproc TestGlobalSize

    parameters sizeOfMem&
    var mem& = Dim(sizeOfMem&)
    var result& = GlobalSize(mem&)
    Dispose(mem&)
    return result&

endproc

proc assert

    parameters param&
    print param&,
    print if(TestGlobalSize(param&) = param&, "OK", "Fail!")

endproc

cls
assert(4)
assert(23)
assert(42)
waitinput
end
 
05/10/14  
 




Ernst
mistake in writing:
textlen& = ~GetWindowText(hWnd&, Text#, sizeof(#)-1) ought to his:
textlen& = ~GetWindowText(hWnd&, Text#, sizeof(Text#)-1)

@Nico: anyway is globalsize  exakt The api, The I sought having.
long Text=dim(255)
var textlen& = ~GetWindowText(hWnd&,Text,~GlobalSize(Text)-1)
thanks
 
05/10/14  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

20.876 Views

Untitledvor 0 min.
p.specht12/05/17
Ernst06/24/16
Wilfried06/02/16
funkheld04/11/16
More...

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