English
Regulars table & Café

GlobalFree.

 


Description:

gives one globales Speicherobjekt spare and power his lever null




Deklaration:

Def GlobalFree(1) !kernel32, GlobalFree




Parameter:

1.Parameter: hMem& lever the Speicherobjekts



Return Value:

in the Erfolgsfalle 0 otherwise lever the global Speicherobjekts

Examples:

CompileMarkSeparation
Def GlobalAlloc(2) !"KERNEL32.DLL", "GlobalAlloc"
Def GlobalFree(1)  !"KERNEL32.DLL", "GlobalFree"
Def MoveMemory(3)  !"KERNEL32", "RtlMoveMemory"

Proc PeekL

    Parameters ReadMemoryAddr&
    Declare Value&, Result!
    MoveMemory(Addr(Value&), ReadMemoryAddr& + 2, 2)
    Result! = Value& * 2^16
    MoveMemory(Addr(Value&), ReadMemoryAddr&, 2)
    Result! = Result! + Value&
    Return Result!

EndProc

Proc PokeL

    Parameters WriteMemoryAddr&, Value!
    Declare Value&

    If (Value! > -1) And (Value! < 2^32)

        If Value! - (2^16 - 1) > 0

            Value& = Value!  2^16

        Else

            Value& = 0

        EndIf

        MoveMemory(WriteMemoryAddr& + 2, @Addr(Value&), 2)
        Value& = Int(Value! - (Value& * 2^16))
        MoveMemory(WriteMemoryAddr&, Addr(Value&), 2)

    Else

        MessageBox("Zahl zu groß!", "Wichtiger Hinweis", 48)

    EndIf

EndProc

Declare hMem&
4 Byte = Long Speicher reservieren
hMem& = GlobalAlloc($40, 4)

If hMem&

    Speicher mit 1111 füllen
    PokeL hMem&, 1111
    Speicher auslesen und in MessageBox wiedergeben
    MessageBox("In Adresse: " + Str$(hMem&) + " steht folgender Wert: " + Str$(Int(PeekL(hMem&))) , "Inhalt des Speicher", 0)
    Speicherobjekt freigeben
    GlobalFree(hMem&)

Else

    MessageBox("Speicher konnte nicht reserviert werden", "Wichtiger Hinweis", 48)

f='./../../Function-References/XProfan/endif/'>EndIf


[keywords:f990269c64]
GlobalAlloc GlobalLock GlobalReAlloc memory enable Delete Speicherfreigabe Dispose
[/keywords:f990269c64]
 
05/24/05  
 



salvo.
 
05/24/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.762 Views

Untitledvor 0 min.
GDL07/23/15

Themeninformationen

this Topic has 2 subscriber:

iF (1x)
unbekannt (1x)


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