Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LoadPicFromRes question (Read 5728 times)
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
LoadPicFromRes question
Apr 1st, 2011 at 6:57am
Print Post  
HINSTANCE hDll=NULL;
hDll=LoadLibrary("runda.dll");
if (hDll)
{
                       box.LoadPicFromRes((LONG) hDll,MAKEINTRESOURCE(IDB_BITMAP1),_T("Bitmap"));

}

first question :

IDB_BITMAP1 is define in dll, so build failed.
I change
  box.LoadPicFromRes((LONG) hDll,MAKEINTRESOURCE(4000),_T("Bitmap"));

in dll  #define IDB_BITMAP1 4000
but picture can't show in box.

  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #1 - Apr 1st, 2011 at 7:08am
Print Post  
i read help ,find bmp not support,
i insert one gif in resouce,
and use help example:

box.LoadPicFromRes((ULONG)AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_GIF1), _T("gif"));

picture can't be showed in box.
  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #2 - Apr 1st, 2011 at 7:10am
Print Post  
i want to load gif from dll. how do it?
  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #3 - Apr 1st, 2011 at 7:47am
Print Post  
HRSRC   hStr   =  FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_GIF1), "gif" );
if (hStr!=NULL)
{
box.LoadPicFromRes((ULONG)AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_GIF1), "gif" );
AfxMessageBox("ok");
}
findresource ok
but picture can't be showed.
  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #4 - Apr 1st, 2011 at 10:14am
Print Post  
#if 1
if(Load(MAKEINTRESOURCE(6002), "gif",hDll,&iPic))
{

//if(LoadPictureGlobal(hStr,hDll,&iPic))
{

box.SetPicture((IDispatch*)iPic);
iPic->Release();
}
AfxMessageBox("ok");

}

#else

box.LoadPicFromRes((ULONG)hDll, MAKEINTRESOURCE(6002), "gif" );
#endif

first way is ok,
second is failed 。

i find strang question ,bmp is not supoorted.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadPicFromRes question
Reply #5 - Apr 4th, 2011 at 5:53am
Print Post  
Have you added it as a custom resource as explained in the help topic?
  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #6 - Apr 5th, 2011 at 12:58pm
Print Post  
yes ,i add a customer resource  named gif
  
Back to top
 
IP Logged
 
strong_peng
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 69
Joined: Jul 18th, 2007
Re: LoadPicFromRes question
Reply #7 - Apr 5th, 2011 at 1:00pm
Print Post  
can you receive source code?
i send dll source code to you .
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadPicFromRes question
Reply #8 - Apr 5th, 2011 at 6:12pm
Print Post  
The "MoreAnchors" sample project shows how to add such resources and load them using LoadPicFromRes. Here's a modification that loads a transparent gif:

https://mindfusion.eu/_samples/fcx_res_gif.zip
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint