473,394 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Load .dll data outside of Initial run time?

Samishii23
246 100+
Ok. So. I have this project going right now that the data I have, being alot of images, some text data, and methods in a .dll.

But since the data I have is constantly changing, while maybe only once or twice in a month span, since this is a "Fan" program from a game.

I am making my .exe basicly being a static .exe, which will call up the Version .dll file with all that versions data in it, but only when called from the .exe while running.

Like this:

Program -> Select Version to use: 3.2, 3.1, 3.0 Exc... (This is basicly like archiving the data)


How would I go about calling in the data from each .dll without having loading them into the .exe during run time so I don't have a memory hog of a program??
Oct 2 '09 #1

✓ answered by tlhintoq

Instead of putting images and text in a DLL, wouldn't it just a whole lot easier to put those items in a directory in the application directory or the user documents directory... anyplace you can find easily?

Once or twice a month the image of "myTeam.jpg" changes but retains the same name. Same with the text file when it gets new statistics.

Your methods always look for "myTeam.jpg", "myLogo.gif" or whatever.

This has the advantage of not needing to load in ALL the graphics at once when you load in the DLL. You only have to load the graphics needed for a given screen, thus reducing the memory consumption at any given time.

8 2992
GaryTexmo
1,501 Expert 1GB
Maybe this will help...

http://www.codeproject.com/KB/cs/pluginsincsharp.aspx

It's an excellent tutorial on plugins, which is similar to what it sounds like you want to do. Your approach is definitely different, but that tutorial should provide you with a solid understanding of how to load dlls on the fly, as well as ideas on how you might wish to set up your class structure.

Good luck!
Oct 2 '09 #2
tlhintoq
3,525 Expert 2GB
Instead of putting images and text in a DLL, wouldn't it just a whole lot easier to put those items in a directory in the application directory or the user documents directory... anyplace you can find easily?

Once or twice a month the image of "myTeam.jpg" changes but retains the same name. Same with the text file when it gets new statistics.

Your methods always look for "myTeam.jpg", "myLogo.gif" or whatever.

This has the advantage of not needing to load in ALL the graphics at once when you load in the DLL. You only have to load the graphics needed for a given screen, thus reducing the memory consumption at any given time.
Oct 2 '09 #3
For me it seems Samishii23 has already planned on the method.

It seems that you refer a set of Win32 DLLs. (not ActiveX DLLs). Is that right?

In this case, you can simply Load each DLL and unload them to free memory.

LoardLibrary and FreeLibrary are the API functions to do so. Using these APIs, you will not be wasting memory to load all at once.

Best Regards

Neo
Oct 3 '09 #4
Samishii23
246 100+
Thank you Gary for the tutorial. I skimed over it real quick, and it looks like it'll give me a basis on what to build into my project. Thanks.

tlhin, I have the data stored in the .dll's so I don't have to have (in my case actually) hundreds if not a 1k files roaming around the users end. Its cleaner on the eyes, especially since the people that will most likely use it will be power users... So I doubt they would want a cluster-f*ck of files on their end.

Neo, I don't believe I would be calling in any win32 dlls. Just all of my own creation. =)
Oct 3 '09 #5
Plater
7,872 Expert 4TB
Would a resource file not be a better choice for storing data such as that?
Pretty sure you can load/unload resource files similar to DLL files?
Oct 5 '09 #6
Samishii23
246 100+
Plater - Thats what the dll's are basicly. Their holding the data / images i'll be using in my application. Its just there'll be multiple versions, and I'll be archiving for people to be able to look back at the old, and check it out.
Oct 5 '09 #7
Plater
7,872 Expert 4TB
I was just thinking that as far as using different "versions" go, i think the mechanism for dealing with different resource files is setup better then using differing DLLs.

This whole concept has me curious. If/when I get some free time I want to play around with this concept.
Oct 5 '09 #8
Samishii23
246 100+
Plater - You have me curious as well. Feel free to explain if you get a chance, as I am still way new to the language, and could use a nudge in the right direction. =)
Oct 6 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

35
by: Troll | last post by:
Hi, I need to write a script which reads some data and reports the findings. Just to give you an idea the structure is similar to the following. Data input example: HEADING 1 **********...
0
by: Peter | last post by:
When I issue call sqlj.install_jar('file:///f:/jars/mail.jar','MAIL'); I get the messages SQL4301N Java or .NET interpreter startup or communication failed, reason
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
6
by: B B | last post by:
Okay, here is what's happening: I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz P4) doing .net development. Running Windows XP pro, SP2 IIS is installed and running...
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
5
by: mike_dba | last post by:
I am looking for comments on experience using a Load from Cursor across multiple db's databases. I have a multi-terrabyte database across many partitions that includes a large table (1 Tb+). The...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
1
by: Chris | last post by:
Hi Folks- I'm using a treeview to display a table of contents for a book. There are chapters, subchapters, sub-sub chapters, etc. Since there are a few levels, I've set up threads to handle...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.