Search
Table.LoadPicFromRes Method
See Also
 



Loads an image from the resources embedded in a .dll or .exe file and assigns it to the table Picture.

 Syntax

VB6  Copy Code

Public Sub LoadPicFromRes( _
    ByVal hRsrcInst As Long, _
    ByVal RsrcName As String, _
    ByVal RsrcType As String _
)

C++  Copy Code

public:
void LoadPicFromRes (
    unsigned int hRsrcInst,
    BSTR RsrcName,
    BSTR RsrcType
)

 Parameters

hRsrcInst

A HINSTANCE. This is the handle of the module from which the resource is to be loaded.

RsrcName

The name of the resource. Use MAKEINTRESOURCE macro if you use integer identifiers for your resources (in Visual C++).

RsrcType

The name of the resource type.

 Remarks

Loads an image from a resource in the table. Note that standard icon and bitmap resources are not supported. You should insert your pictures as custom resources, either by pasting the binary contents of the image file into the resource binary code or by addressing it through the resource script.

Following syntax in the .RC file makes the latter:

 Copy Code

RESNAME TYPENAME "path to file"

The image can be loaded in the table that way:

 Copy Code

fc.LoadPicFromRsc((ULONG)AfxGetResourceHandle(), RESNAME, TYPENAME)

Check the PicFromRes sample to see how Windows resources can be accessed from VB.

 See Also