Advertisement

04.04.2008 at 03:46AM PDT, ID: 23295563
[x]
Attachment Details

Loading bitmap from resource dll

Asked by Snapples in Microsoft Visual C++.Net, C++ Programming Language, Microsoft Visual C++

Tags: Visual C++

I want to place all my bitmaps in a resource dll which I've already made and loaded into my program.
Now the problem is, I have an existing Bitmap class which can get a bitmap from a file or an embedded resource, now I want it to be able to get a bitmap from the resource dll but everything I've tried so far doesn't work.
Can anyone explain me how to do this?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
Bitmap::Bitmap(int IDBitmap, String const& sTypeRef, bool createAlphaChannel): m_TransparencyKey(-1), m_Opacity(100), m_Exists(false)
{
	m_HasAlphaChannel = createAlphaChannel;
 
	m_Handle = LoadBitmap(Engine::GetSingleton()->GetInstance(), MAKEINTRESOURCE(IDBitmap));
 
	if (m_Handle != 0) m_Exists = true;
}
 
 
//////////////
 
 
void X::Start()
{
 
    hMod = LoadLibrary (_T("testdll.dll"));
    if (hMod == NULL)//
    {
        ENGINE->MessageBox("Failed to locate testdll.dll!");
        ENGINE->Quit();
    }
    else
    {
        ENGINE->MessageBox("OK");
    }
    // This works
    
//FindResource(hMod,_T("IDB_AILEX"),_T("BITMAP"))
 
    //bmptest = new Bitmap (FindResource(hMod,_T("IDB_AILEX"),_T("BITMAP")),"BITMAP",false);
}
[+][-]04.04.2008 at 10:54AM PDT, ID: 21284132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 01:19PM PDT, ID: 21285333

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 01:26PM PDT, ID: 21285394

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 01:46PM PDT, ID: 21285538

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 01:48PM PDT, ID: 21285553

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C++.Net, C++ Programming Language, Microsoft Visual C++
Tags: Visual C++
Sign Up Now!
Solution Provided By: jkr
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.04.2008 at 02:02PM PDT, ID: 21285632

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628