pueromane
November 29th, 1999, 02:51 AM
Is it possible to store Data directly in a dll or exe Program.
When yes how can I do this.
mfG Pueromane
When yes how can I do this.
mfG Pueromane
|
Click to See Complete Forum and Search --> : Store Data in a dll pueromane November 29th, 1999, 02:51 AM Is it possible to store Data directly in a dll or exe Program. When yes how can I do this. mfG Pueromane Ravi Kiran November 29th, 1999, 03:54 AM Program related settings etc are usually stored in INI files (olden days), in Registry, these days. If bigger data exists, you can save it in local/ binary files, in special format etc. You can use Property bag object, specially for that purpose itself. You want to be really at the Front end of it Use XML to define your fromat, and save as XML data. But all these still save data OUTSIDE the exe. You cannot write into a exe/dll becuase , it will corrupt the program, and the sometimes the OS will keep a write-protection on the files, atleast while the program is running. RK Lothar Haensler November 29th, 1999, 04:04 AM you can use the Resource Data to store data in your EXE or ActiveX DLL in VB. You can load these data at runtime via LoadResData. You can add these data with a text editor to create an RC file. Run it against the resource compiler to create RES file that you can add to your VB project. Ravi Kiran November 29th, 1999, 04:32 AM Hi Lothar,, I forgot abt it!:-) I dont know how i assumed that "data" necesarily meant read-write at run time!!! Thanks. RK pueromane November 29th, 1999, 06:27 AM When the user closes the program the data should be written into the dll or exe, so when the user starts the program again the data is shown on the form mfG Pueromane Ravi Kiran November 29th, 1999, 10:18 PM This is what you call "Program settings" You can use Registry to write them, under some key typically your application name. VB provides two functions for this purpose SaveSetting and GetSetting. A typical "last-login" data will be written like this SaveSetting( app.exename, "Last Login","ID", gszloginid) SaveSetting( app.exename, "Last Login","Name", gszloginname) On the next time start, you want to restore the login screen to show the last login name & id by default. so you say ' in Form load may be: gszloginid = GetSetting(app.exename,"Last Login","ID", VbNullString) gszloginname = GetSetting(app.exename,"Last Login","Name", VbNullString) txtLoginid.text = gszloginid txtloginName = gszloginname --- You dont write data "into" a dll. You can save in a specific format, in a predefined file name, typically under application installation directory. If the data is large this is preferable over writing into registry. For this purpose, like i said in my prev. post, you can use Property bag. ( A small correction: You dont need a user control. PropertyBag is provided by "VBRun" time) so you can directly use Or Use INI file, or any file format, or XML. RK codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |