Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm looking to have a .dll define a datatype, return a HashTable of the DataType, and a method to populate the hashtable. populating it will be pretty much like hardcoding a lot of variables.

 

This would be downright simple to do.

 

But I want to do it dynamically.

 

I want to have a form, let the user insert data, then click "Update Data Source" and the program creates a single string (or textdocument) from the code and then compiles it into a .dll

 

say this is the data section:

    AddData(DataString, cType(DataDate, Date), cType(DataInt, Integer))

    AddData(DataString, cType(DataDate, Date), cType(DataInt, Integer))

    AddData(DataString, cType(DataDate, Date), cType(DataInt, Integer))

 

To add more entries you just need to get all of the text currently in the .dll, and append more lines of

 

" AddData(DataString, cType(DataDate, Date), cType(DataInt, Integer))"

 

in the procedure that adds all of the data. This isn't something that would be done every time the program was used and maybe never. Maybe only as an Admin Feature.

 

I see a plus side of it as the data already being precompiled (as much as .net is) and not having to open connections.

 

This might just be a feature/applet for me, so I can easily append data.dll's to be redistributed.

 

I know Divil has a tutorial on this, which is where I'm going to check it out at.

 

The only thing I'm worrying about is that if I'm using the .dll, will it let me write over it? if so, is there a way to unload the .dll from the app on runtime to save over it, then load it back in right after?

 

Anyone have any advice, opinions or thoughts on this sort of thing?

  • Administrators
Posted

Would the DLL also define the data type or would that be defined elsewhere? If the DLL defines the data type would the user be expected to also design this as part of the DLL creation process?

If you just want to store data then simply putting it into an XML file may be an easier job. Unloading Dlls at runtime can get interesting clicky 1 clicky 2 as you cannot do it without unloading an entire AppDomain.

 

It may be worth posting a bit more information about exactly what these Dlls would be used for and what level of customisability would be required at run time.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
I might use XML. I was going for speed for once instead of that amateurishly long wait while it reads the file. Maybe I can just use some sort of shift encryption to keep people from viewing the xml or something.

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...