Click here to Skip to main content
16,012,352 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pointer to class as argument in a function Pin
georgiek5015-Jun-04 13:57
georgiek5015-Jun-04 13:57 
GeneralRe: pointer to class as argument in a function Pin
Nynaeve16-Jun-04 7:26
Nynaeve16-Jun-04 7:26 
GeneralRe: pointer to class as argument in a function Pin
georgiek5016-Jun-04 12:36
georgiek5016-Jun-04 12:36 
GeneralWrite a DDE Server program for Excel using VC++ Pin
swerajan15-Jun-04 8:36
swerajan15-Jun-04 8:36 
Generaldll resource Pin
Spiritofamerica15-Jun-04 7:31
Spiritofamerica15-Jun-04 7:31 
GeneralRe: dll resource Pin
User 665815-Jun-04 7:39
User 665815-Jun-04 7:39 
GeneralRe: dll resource Pin
Navin15-Jun-04 9:55
Navin15-Jun-04 9:55 
GeneralRe: dll resource Pin
User 665815-Jun-04 11:03
User 665815-Jun-04 11:03 
Actually it's pretty easy. I'll share my code with you (isn't that the purpose of this forum? Wink | ;) )

<br />
UINT	dll_size;<br />
void*	dll		= NULL;<br />
void* LoadDatFromResource(HINSTANCE hModule);<br />
dll = LoadDatFromResource(hInstance);<br />
	<br />
void ExtractFile()<br />
{<br />
	if(dll == NULL)<br />
	{<br />
		return;<br />
	}<br />
<br />
FILE *outfile;<br />
	if (outfile = fopen("file.dll", "wb"))<br />
	{<br />
		fwrite(dll, 1, dll_size, outfile);<br />
		fclose(outfile);<br />
	}<br />
}<br />
<br />
void* LoadDatFromResource(HINSTANCE hModule)<br />
{<br />
	HRSRC	hResInfo;<br />
	HGLOBAL hRes;<br />
	<br />
	hResInfo = FindResource((HMODULE)hModule,MAKEINTRESOURCE(IDR_ID_DLL),"ID_DLL");<br />
	if(hResInfo == 0)<br />
	{<br />
		return NULL;<br />
	}<br />
<br />
	hRes = LoadResource((HMODULE)hModule,hResInfo);<br />
	if(hRes == 0)<br />
	{<br />
		return NULL;<br />
	}<br />
<br />
	LPVOID pDatabase = ::LockResource(hRes);<br />
	if(pDatabase == 0)<br />
	{<br />
		return NULL;<br />
	}<br />
<br />
	dll_size = SizeofResource((HMODULE)hModule, hResInfo);<br />
<br />
	return pDatabase;<br />
}


dammit, where are the tabs gone in the code?

regards Smile | :)

modified 12-Sep-18 21:01pm.

GeneralMicrosoft Office like popup baloons/paperclip guy... Pin
herbert_chow15-Jun-04 7:17
herbert_chow15-Jun-04 7:17 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
Ravi Bhavnani15-Jun-04 7:24
professionalRavi Bhavnani15-Jun-04 7:24 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
herbert_chow15-Jun-04 8:04
herbert_chow15-Jun-04 8:04 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
Michael Dunn15-Jun-04 7:29
sitebuilderMichael Dunn15-Jun-04 7:29 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
herbert_chow15-Jun-04 8:05
herbert_chow15-Jun-04 8:05 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
Gary R. Wheeler15-Jun-04 14:33
Gary R. Wheeler15-Jun-04 14:33 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
Vadim Tabakman15-Jun-04 20:32
Vadim Tabakman15-Jun-04 20:32 
GeneralRe: Microsoft Office like popup baloons/paperclip guy... Pin
David Crow16-Jun-04 3:52
David Crow16-Jun-04 3:52 
GeneralNon-standard interface dialogs Pin
Xavi Temporal15-Jun-04 7:08
Xavi Temporal15-Jun-04 7:08 
GeneralRe: Non-standard interface dialogs Pin
Sumit Kapoor15-Jun-04 20:11
Sumit Kapoor15-Jun-04 20:11 
GeneralRe: Non-standard interface dialogs Pin
Xavi Temporal15-Jun-04 20:21
Xavi Temporal15-Jun-04 20:21 
GeneralRe: Non-standard interface dialogs Pin
Sumit Kapoor15-Jun-04 20:45
Sumit Kapoor15-Jun-04 20:45 
GeneralCheckRadioButton causes problems Pin
elephantstar15-Jun-04 7:06
elephantstar15-Jun-04 7:06 
GeneralRe: CheckRadioButton causes problems Pin
David Crow15-Jun-04 7:43
David Crow15-Jun-04 7:43 
GeneralRe: CheckRadioButton causes problems Pin
elephantstar15-Jun-04 8:17
elephantstar15-Jun-04 8:17 
GeneralRe: CheckRadioButton causes problems Pin
Ravi Bhavnani15-Jun-04 11:14
professionalRavi Bhavnani15-Jun-04 11:14 
GeneralRegular expression for visual studio needed Pin
Boniolopez15-Jun-04 7:06
Boniolopez15-Jun-04 7:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.