Article View: borland.public.cppbuilder.nativeapi
Article #17430Re: Resource dll
From: Remy Lebeau (TeamB)
Date: Mon, 24 Mar 2003 20:13
Date: Mon, 24 Mar 2003 20:13
40 lines
2065 bytes
2065 bytes
"ScOe" <sven.savic@zg.hinet.hr> wrote in message news:3e7f5a3a@newsgroups.borland.com... > BACKGROUND BITMAP BCK.BMP > SNAKE BITMAP SNAKE.BMP How exactly did you define BACKGROUND and SNAKE? Are they integers or strings? Are you using a .rh header file as well? > SnakeImage->LoadFromResourceName((int)HInstance, "SNAKE"); Assuming you're calling that from within the application itself, you need to use the HINSTANCE for the DLL itself, not the application. Look at LoadLibrary() in the Win32 API. > (HBITMAP)LoadImage(GetModuleHandle(NULL), "SNAKE", IMAGE_BITMAP, 0, 0, > LR_CREATEDIBSECTION); GetModuleHandle() will return the instance of the application that loaded your DLL, not for the DLL itself. > Second way would be better couse i need HBITMAP result Using TBitmap as in your first sample, the Handle property will contain the HBITMAP. > I'm working on game ... and i'm not sure what should i use as > main game loop ... That depends, what exactly are you trying to accomplish? > Timer is not very useful. Why not? You need to be more specific when you say something doesn't work for you. Gambit
Technical Details
Message-ID:
<3e7f64aa$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e7f5a3a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,35566035837173d7 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-24 12:08:10 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e7f5a3a@newsgroups.borland.com> Subject: Re: Resource dll Date: Mon, 24 Mar 2003 12:13:42 -0800 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3e7f64aa$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048536234 207.175.226.26 (24 Mar 2003 12:03:54 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail