|
Is it possible to store the images in one dll?
Here I would like to store some images into one dll.
And when ever I want I want to call them from that dll.
Is that possiable? Can anyone help me in this concept or any suggestion please.
Nice talking to you.
|
|
|
|
|
|
In your .rc file for the DLL project, add a line something like this for each image:
"MY_NAME" "IMAGES" "path\\to\\image.jpg" .
Then load the DLL dynamically by using HMODULE hModule = LoadLibraryEx("path\\to\\dll", NULL, LOAD_LIBRARY_AS_DATAFILE); (Skip last parameter if you intend to execute code from it as well).
Then from your application call:
HRSRC hRes = FindResource(hModule, _T("MY_NAME"), _T("IMAGES"));
HGLOBAL hGlob = LoadResource(hModule, hRes);
DWORD dwResSize = SizeofResource(hModule, hRes);
void* pData = LockResource(hGlob);
By this point, pData is pointing to a byte array, which contains the data from the jpg-file. It's length is dwResSize .
I omitted all the error checking for brevity.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
G Haranadh wrote: Is it possible to store the images in one dll?
what images ?
G Haranadh wrote: And when ever I want I want to call them from that dll.
Call them for what ?
Can you help us by telling us what you want to achieve ?
One way to store images in a DLL is to include them in a resource DLL ( hint hint wink wink )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Here we are trying to store some giff images in the dll.
And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Thanks for your help.
Nice talking to you.
|
|
|
|
|
G Haranadh wrote: And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Create a Resource Dll as Suggested By Mr Jorgen!.. and you can use CEnBitmap: Derived From CBitmap[^] class by Dan.g. to dynamic display them..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Here is an easy one for you experts....
How do I put a bitmap or an icon on a CButton control and include test as well.
what I need is to have the text "Open..." on the button with a small folder icon/bitmap on the left side.
Any naswers ?
Thanks in advance,
Shay
|
|
|
|
|
|
Unfortunately, that class doesn't handle XP themes, so it would look really ugly in an XP GUI.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: so it would look really ugly in an XP GUI
doesn't everything?
i still use the 'classic' (Win98) style in XP.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
> doesn't everything?
Indeed. Which is why I'm using the ChaNinja style.
> i still use the 'classic' (Win98) style in XP.
Yikes!
My customers however mostly run XP as is. I doubt many of them know what a theme is. I do know though that they will be able to spot the difference between a seemingly square chunky thing and the rest of the GUI (the Fisher Price/Lego Duplo theme ). The worst part is that I've got customers running Win98, Me, NT4 and 2000, so anytime I need to hack up a control, I have to give it two rendering routines. (And I refuse to buy a third party class library as well. On a pre-XP box, I want things to look pre-XP. I guess I'm a stubborn GUI fascist )
--
Pictures[^] from my Japan trip.
|
|
|
|
|
I recommend the brute force approach.
Since you want to put a bitmap on the button, why not simply include the text you want in the bitmap? (i.e. your bitmap has the text "Open" with the small folder picture next to it.)
|
|
|
|
|
I have found some articles thaat describe the
free code of TCP/IP stack for linux .
do any know can i get some thing like this for
Windows
Or can i get anything for DOS is also help full
i know how to do stack for 8051 embedded so
its not a problem to understand
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I believe the window TCP/IP stack is based on that of the BSD unix variants. So maybe you can download the BSD stack source for some info.
greetings rem-c
|
|
|
|
|
Hi all,
1) i want to print a web page using vc++ 6.0.Please Guide how it can be done if the default web browser is IE(i am using IE 5.0).
2)Is there any way that we can print a web page without worrying much about the web browser we are using?
Please Help!
Thanks in anticipation!
Regards,
Ankush Mehta
Ankush Mehta
|
|
|
|
|
You could load it into a HTML view (or with a bit more manual labour directly into a IE window), and call IHTMLWindow3::print on it.
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
|
|
|
|
|
Hi Peter,
As i am not much informed on this topic, can u olease elaborate. possibly give some code snippet.
Regards,
Ankush
Ankush Mehta
|
|
|
|
|
Is this of any help:
rundll32.exe C:\WINDOWS\system32\mshtml.dll,PrintHTML c:\myfile.htm
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
As i am not much informed on this topic, can u please elaborate. possibly give some code snippet.
Regards,
Ankush Mehta
|
|
|
|
|
Use ShellExecute() with the command I provided.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
There is an icon ,and I want to set the icon as a item's image without backgroud color in a CTreeCtrl in MFC.
How do I do?
attaching my code:
hIcon=(HICON)LoadImage(NULL,GetIconFromFile ("CLSDFOLD"),IMAGE_ICON,16,16,LR_LOADFROMFILE|LR_DEFAULTSIZE);
iconIndex=m_DeviceImage.Add (hIcon);
HTREEITEM hti1=m_wndDeviceTree.InsertItem
(_T("CATEGORY"),iconIndex,iconIndex,hti);
DestroyIcon(hIcon);
The icon is able to display,but it is black backgroud color.why??
help me
would you write some code?
|
|
|
|
|
I think it is possiable by masking the icon or bitmap with background colour. Then show that masked bitmap.
Nice talking to you.
|
|
|
|
|
how to mask the icon or bitmap with background colour
I'm puzzling.
|
|
|
|
|
Am I correct in thinking that all the functions of an ActiveX is placed in the Class (e.g. Message Maps, Events etc) and the Prop provides the Methods & Properties for accessing the control.
Do you use the Dialog form on the Prop to place indicator controls( static labels, edit boxes etc) - How is this dialog used?
Not quite sure how to expose properties ( can see how to add them) but how do you tie them to Class vaiables.
Not been able to find a simple example using VS 7.1
|
|
|
|
|
Hi,
In my application , I have a List View class in which i am displaying a list control.If i enter any wrong value in list control I display error message on OnVScroll event of list view.When I press OK button of Messageboxit sets focus to list control but when i click on scroll bar of list view ,the view window is getting locked.I have to minimize and maximize the window to scroll through list view.What could be the reason?
|
|
|
|