[VC++] FindResources altijd null

Pagina: 1
Acties:

  • FolkertR
  • Registratie: Juni 2001
  • Laatst online: 07-11-2024
Ik heb problemen met het gebruik van FindResource en heb niet kunnen uitvinden waar het aan ligt.

Main.cpp:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
#include "resource.h"
..

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLine, int iCmdShow)
{

    HRSRC hrsrc = FindResource(hInst,MAKEINTRESOURCE("ZIPFILE"),"RT_RCDATA");
    if (hrsrc == NULL) {
        MessageBox(0, "Resource couldn't be found.", "Error", MB_OK);
        exit(0);
    }
    DWORD size = SizeofResource(hInst,hrsrc);
    HGLOBAL hglob = LoadResource(hInst,hrsrc);
    void *buf = LockResource(hglob);

Resources.rc:
code:
1
2
3
4
#include "windows.h"
#include "resource.h"

ZIPFILE                 RT_RCDATA "images.zip"

Resources.h:
code:
1
#define ZIPFILE                         101


Alles compiled goed, alleen wat ik ook verander in de code de popup "resource couldnt be found" blijft verschijnen.
Wat doe ik hier fout?

  • .oisyn
  • Registratie: September 2000
  • Laatst online: 13:45

.oisyn

Moderator Devschuur®

Demotivational Speaker

Waarom maak je een int resource van een string met de inhoud "ZIPFILE", ipv de macro ZIPFILE die gesubstitueerd wordt door de int 101?

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


  • FolkertR
  • Registratie: Juni 2001
  • Laatst online: 07-11-2024
ack yeah, stom B) nu werkt t