Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread novice2 via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 20:01:19 UTC, Marcone wrote: Sorry! Solved. Just need add # in this line: get_resource("#300", "BMP", "melancia.bmp"); the mistake, very imho, is not check windows API functions results. you can use wenforce:

Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
Sorry! Solved. Just need add # in this line: get_resource("#300", "BMP", "melancia.bmp");

Re: What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
I get resource "melancia.bmp" but the file is corrupted.

What is wrong with this function that I can not get resource content?

2020-02-05 Thread Marcone via Digitalmars-d-learn
// Function get_resource() void get_resource(const(wchar)* id, const(wchar)* tipo, const(wchar)* path_name){ HRSRC file = FindResource(null, id, tipo); DWORD size = SizeofResource(NULL, file); HGLOBAL load = LoadResource(NULL, file); HANDLE new_file =