Solved

Dynamically load file in Visual Basic 6 add-in project

Posted on 2007-03-30
4
350 Views
Last Modified: 2008-01-09
Hi there,

I've just written an add-in for Outlook in visual Basic 6 and I want this add-in, among other things, to dynamically load files (more precisely gif images intended to be put in picture boxes).
How can I do that ?

I read that the location of the add-in dll was written in the registry once the add-in is registered but I didn't find it.

Other possibility : include the gif files in the project as related documents.
But then, how can I refer to them in the code ?

Thanks in advance
0
Comment
Question by:B_B_Boris
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 18828077
I thought if you loaded them into a Image Strip they compiled with the project.

cant find ImageStrip control at the moment though.
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 18830855

or you could include them as resources, and extract at runtime :)

0
 

Author Comment

by:B_B_Boris
ID: 18842710
Thank you for your posting.

I've just tried to include an image as a resource.

The problem is that it cannot be a bitmap, it has to be a gif file : When I try to save my gif file as a bitmap, the background turns black even though it was transparent in the gif.

I tried to create a "custom" resource but when I write
    Img_phone.Picture = LoadResData(101, "CUSTOM")
in the code, I get an error message saying "Execution error 424 : An object is required"

???
0
 
LVL 13

Accepted Solution

by:
Mark_FreeSoftware earned 500 total points
ID: 18844420

loadresdata will not work in this case


you have 2 options:

1 (recommended, much easier)
extract the resource to a temporarily file, and load that file in your picturebox

2(not recommended, hard)
create a picture in memory, and copy the data into that
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

11 Experts available now in Live!

Get 1:1 Help Now