GlobalSize

 

Contents

Description

The GlobalSize function retrieves the current size, in bytes, of the specified global memory object.

Syntax

DWORD GlobalSize( HGLOBAL hMem )

Parameters

hMem
[input] Handle to the global memory object.

Return

If the function succeeds, the return value is the size of the specified global memory object, in bytes.

Examples

EX1

void GlobalSize_Ex1()
{
    DWORD nMemSize =200 ;
    HGLOBAL hData = GlobalAlloc(GHND,nMemSize);
    
    if(!hData)
    {
        out_str("failed to allocate memory\n");
        return ;
    }
    
     printf("The memory resized to : %d BYTES",GlobalSize(hData)) ;
    
     GlobalFree(hData) ;
}

Remark

See Also

GlobalReAlloc, GlobalReAlloc, GlobalFree, GlobalLock, GlobalUnlock

header to Include

origin.h

Reference