All pastes #13399 Raw Edit

wrs

public cpp v1 · immutable
#13399 ·published 2005-06-04 21:56 UTC
rendered paste body
#include <windows.h>#include <iostream.h>#include <stdio.h>#include <stdlib.h>#define MAXMODULE 50typedef void (WINAPI*cfunc)();cfunc BLP2DECODE_GetLastErrorStr;cfunc BLP2DECODE_GetLastError;cfunc BLP2DECODE_BLP2toRGBA;cfunc BLP2DECODE_RGBAtoBLP2;cfunc BLP2DECODE_FreeAll;cfunc BLP2DECODE_FreeData;cfunc BLP2DECODE_FreeErrorStr;cfunc BLP2DECODE_FreeBuffer;	// depreciatedint main(){	HINSTANCE hLib = LoadLibrary("blp2decode.dll");	if (hLib == NULL){		cout << "Unable to load library!" << endl;		getchar();		return 1;	}	char mod[MAXMODULE];	GetModuleFileName((HMODULE)hLib, (LPTSTR)mod, MAXMODULE);	cout << "Loaded library: " << mod << endl;	BLP2DECODE_GetLastErrorStr = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_GetLastErrorStr@@YAXPAD@Z");	BLP2DECODE_GetLastError = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_GetLastError@@YAKXZ");	BLP2DECODE_BLP2toRGBA = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_BLP2toRGBA@@YAPAEPAUblp2header@@PAEKPAKQAUrgba@@KK@Z");	BLP2DECODE_RGBAtoBLP2 = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_RGBAtoBLP2@@YAPAEPAEKPAUblp2header@@KKPAK@Z");	BLP2DECODE_FreeAll = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_FreeAll@@YAXXZ");	BLP2DECODE_FreeData = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_FreeData@@YAXXZ");	BLP2DECODE_FreeErrorStr = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_FreeErrorStr@@YAXXZ");	BLP2DECODE_FreeBuffer = (cfunc)GetProcAddress((HMODULE)hLib, "?BLP2DECODE_FreeBuffer@@YAXXZ");	// depreciated	if ( (BLP2DECODE_FreeAll == NULL) || (BLP2DECODE_BLP2toRGBA == NULL) || (BLP2DECODE_RGBAtoBLP2 == NULL) ){		cout << "Unable to load function(s)!" << endl;		getchar();		return 1;	}	cout << "Press [Enter] to quit..." << endl;	getchar();	return 0;}