Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I have a dll that as part of its functionality throws a form up, the form has a picbox that has a bmp as a logo - the problem is that once deployed (the test app using the dll) an error is thrown because the ultimate path to the bmp file is not right. I have experimented with a bunch of ways to point to the dll directory (which is the same as the exe dir) but to no avail. everything works fine in a non-deployed scenario. How can I reference "The bitmap located wherever the dll is located" - from withing the form code within the dll?

 

tis prolly summin silly, eh?

 

EDIT: In other words, whats a dll's equivalent of a forms "Application.StartupPath" property?

Edited by CattleRustler

mod2software

Home of the VB.NET Class Builder Utility - Demo and Full versions available now!

Posted
Where is the picture? Can you just use a path like "\images\yourpicture.jpg" which would be "location of your dll\images\yourpicture.jpg"
Posted

scratch that- I added the file as an embedded resource but am still trying to tell my form_load where to find it....

 

 

I will keep trying. any insight welcome, thanks!

mod2software

Home of the VB.NET Class Builder Utility - Demo and Full versions available now!

Posted

@PlausiblyDamp

 

Turns out I am a dummy :)

from my main dll code I can reference the Application.StartUpPath & "\myimage", and then set the form's PicBox.Image property prior to showing the form. Since the image file has to be distributed even when its set as an embedded resource in the project, I changed the code to use whats above. The compiled dll ends up being smaller, and I save a few lines of code.

 

Thanks anyway tho - I saved that project (the one that link points to) as a reference that I am sure will come in handy.

 

Thanks again

James

mod2software

Home of the VB.NET Class Builder Utility - Demo and Full versions available now!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...