Recources Files

honey4u used Ask the Experts™
I want to make a Recources File (*.res) With some Bitamps
or strings for my app how i make a resouces file What Is the Way, Please Thanks
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
First, assuming that it's available, go to your project and select menu "Add-ins | Add-In Manager"

Then locate the VB 6 Resource Editor and click it then click on the "Loaded/Unloaded checkbox" (and "Load on startup" if you expect to use it every time you open VB.)

When you click OK, you should see a green 3D cube appear on your tool bar.  Either click that or use menu "Tools | Resource Editor"

In the new window, click on an image near the top right, and begin entering text/selecting bitmaps as needed.

When you save and close, you will get a new entry in your VB project.

To access it, use LoadResString... or LoadResPicture...

Follow the steps rspahitz mentioned.
When you select BitMap icon in Resource Editor, it pops up a dialog box "Open a Bit Map File". Select the folder in which your bit map exists, and u can sellct single or multiple bmp files at a go and press Open button. All the selected files will appear in Resource Editor window under BitMap Folder. Each file will be given a number to identify it. Ex: 101, 102 etc. If you want u can keep the numbers as file id or right click on the number and select properties. In the properties window, change the id to whatever you want.

In the vb project, add a picture box. and in the appropriate event/time when you want to show a picture write the following code

Picture1.Picture = LoadResPicture(101, vbResBitmap)

LoadResPicture =function to load Bitmap into picture box.
101 = id to identify the file
vbResBitmap = constant telling what type of file u r loading into picture box (other one is icon)

njoy coding
hope this helps

Sorry i forgot to tell abt Strings

If you want to use strings, follow the same procedure and in the string table u add required strings. when you want to use the strings in resource table use the following code

stringVariable = LoadResString(stringId)

Checkout this link to use resource file in your project.



Thanks For Help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial