|
-
Apr 3rd, 2005, 10:04 AM
#1
Thread Starter
Member
LoadResData [RESOLVED]
I made a resource file and added it to an activex dll and compiled it. The dll contains mainly gif images. I know the code would be something like this if the resource file was in the exe of the program.
b = LoadResData(101, "Custom")
But how do I load the dll and then pull that data out of the dll? I can't seem to find an example coding that shows how to do this from an dll. Only from withing the exe of a program. I think I can do the rest after I pull that resource data from the dll, but I need help getting that data first.
Thanks for any help in advance.
Last edited by simgirl; Apr 3rd, 2005 at 09:08 PM.
Reason: Resolved
-
Apr 3rd, 2005, 10:21 AM
#2
Re: LoadResData
You would still use the same code but within a class in the DLL. You would then have to create some kind of method that would return the data.
-
Apr 3rd, 2005, 10:29 AM
#3
Thread Starter
Member
Re: LoadResData
Would that only been needed to be coded then in the dll to return an loadres data and how would you do that? I'm already able to pull bmp's, icon's, and string's from an resource stored in an dll but not anything in the Custom section of a resource.
-
Apr 3rd, 2005, 10:36 AM
#4
Re: LoadResData
VB Code:
Public Function GetCustomData(Index As Variant) As Byte()
GetCustomData = LoadResData(Index, "Custom")
End Function
-
Apr 3rd, 2005, 11:41 AM
#5
Thread Starter
Member
Re: LoadResData
If thats put into a class within the activex dll, how would you then called that function from your program?
Lets say I have an activex dll called: images.dll
It contains 1 gif in customs (101, "Customs").
How would I need to write the code to get that gif?
Last edited by simgirl; Apr 3rd, 2005 at 11:44 AM.
-
Apr 3rd, 2005, 11:52 AM
#6
Re: LoadResData
You would of course need to set a reference to your DLL. Then create an object from the class you wrote.
VB Code:
Dim oPic As TheClassName
Dim bArr() As Byte
Set oPic = New TheClassName
bArr = oPic.GetCustomData(101)
You now have a byte array representing the custom data. You can write that to a file and then load it using LoadPicture.
-
Apr 3rd, 2005, 11:57 AM
#7
Thread Starter
Member
Re: LoadResData
Thank you so much.
I'll give that a try.
-
Apr 3rd, 2005, 12:27 PM
#8
Thread Starter
Member
Re: LoadResData
Do you always have to set a reference to the dll just to get custom data? I seem to be able to get bmp's, icon's, and string's without setting a reference to the dll ok.
-
Apr 3rd, 2005, 12:33 PM
#9
Re: LoadResData
 Originally Posted by simgirl
Do you always have to set a reference to the dll just to get custom data? I seem to be able to get bmp's, icon's, and string's without setting a reference to the dll ok.
If the res file is in the dll you will not be able to access it without setting a reference. But if you have a project group in VB your standard EXE project will probably have a reference set automatically.
-
Apr 3rd, 2005, 09:07 PM
#10
Thread Starter
Member
Re: LoadResData
I found a piece of code that shows me how to do it now exactly the way I wanted to do it. You don't even have to reference the dll using this code. I'll post a link on here, once I find the link again, so others can try the code if they want.
-
May 8th, 2007, 02:48 PM
#11
Hyperactive Member
Re: LoadResData [RESOLVED]
Got it, I fixed it. Its working now
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|