Currently viewing: GipsySoft » Front Page» QHTM

funcQHTMResourceCallback

typedef HGLOBAL (CALLBACK *funcQHTMResourceCallback)( LPCTSTR pcszResourceName, LPARAM lParam );

Type used when setting a resource callback.

Remarks

QHTM will call the this function when it needs a resource such as a HTML file, image file or something else.

QHTM calls GlobalFree() on the returned HGLOBAL after it has extracted the resource from the memory block.

Example

HGLOBAL MyQHTMResourceCallback( LPCTSTR pcszResourceName, LPARAM )
{
	//
	//	Only pass HTML page requests back.
	if( strstr( pcszResourceName, "html" ) )
	{
		static TCHAR sz[] = _T("Hello, I am a <b>demo</b>");
		LPTSTR p = (LPTSTR)( GlobalAlloc( GPTR, sizeof( sz ) ) );
		_tcscpy( p, sz );

		return (HGLOBAL)p;
	}
	return NULL;
}


QHTM_SetResourceCallback( hwndQHTM, MyQHTMResourceCallback );

See also QHTM_OPT_SET_RESOURCE_CALLBACK