Search
Table.LoadPicInCellFromRes Method
See Also
 



Loads an image from the resources embedded in a .dll or .exe file and assigns it to a cell's picture.

 Syntax

VB6  Copy Code

Public Sub LoadPicInCellFromRes( _
    ByVal hRsrcInst As Long, _
    ByVal RsrcName As String, _
    ByVal RsrcType As String, _
    ByVal col As Long, _
    ByVal row As Long _
)

C++  Copy Code

public:
void LoadPicInCellFromRes (
    unsigned int hRsrcInst,
    BSTR RsrcName,
    BSTR RsrcType,
    int col,
    int row
)

 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.

col
The column that contains the cell.
row
The row that contains the cell.

 Remarks

Loads an image from a resource into a cell of the table. Note that standard icon and bitmap resource- formats 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 a cell like this:

 Copy Code

fc.LoadPicInCellFromRsc((ULONG)AfxGetResourceHandle(), RESNAME, TYPENAME, c, r)

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

 See Also