#include "windows.bi"
Function GetResource(ByVal ResourceName As String, ByVal ResourceType As String) As Any Ptr
    Dim ResH As HRSRC
    Dim MemH As HGLOBAL
    Dim ResSize As UInteger
    Dim As Any Ptr ResPtr,RetPtr   
    ResH = FindResource(NULL, ResourceName, ResourceType)
    ResSize = SizeOfResource(0, ResH)
    MemH = LoadResource(NULL, ResH)
    ResPtr = cPtr(Any Ptr, LockResource(MemH))   
    RetPtr = Allocate(ResSize)
    MoveMemory ByVal RetPtr, ByVal ResPtr, ResSize   
    FreeResource MemH   
    Return RetPtr
End Function

Dim MySprite As Any Ptr

MySprite = GetResource("MYSPRITE", "DATA")

Screen 17,32
Put (0, 0), MySprite
Sleep


