Solved

use DLL resource to fill picturebox

Posted on 1998-12-05
2
129 Views
Last Modified: 2012-08-14
i use Borland REsource Workshop to make a DLL resource.
i got 1 bmp file (file type BMP, file name BMP1) and 1 JPEG file (file type JPG, filename JPG1). (note bmp is default support by the borland workshop, while jpeg is user define).

how can i use the above picture file to fill let say picturebox1 in VB ?

i have asked this question at many different forums and mailing lists, but now yet been answered for year. hope someone can answer this question here.

thanks for help
keong
0
Comment
Question by:hckhiu
2 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 170 total points
Comment Utility
I am not sure about the JPEG, but you can do this to get the BMP:
1. LoadLibrary to load the dll.
2. FindResource to get the resource handle
3. LoadResource to load the resource itself, to get the handle to the bitmap
4. CreateDC and SelectObject with the returned handle to select the bitmap into the new device context.
5. BitBlt to output it

Tell me if you need any help
0
 
LVL 15

Expert Comment

by:ameba
Comment Utility
The best way is to use .RES format in Resource Workshop, and add .RES file to your VB project.
There is VB example in your vb5\samples\PGuide\ATM directory.
It shows how to load picture, cursor, sound or string from your Resource file.

For dlls, it is not that simple. LoadResource is complicated (you must also use LockResource and UnLockResource...). There are easier API functions for each type of resource (e.g. LoadBitmap, LoadIcon, LoadCursor...)

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now