CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: Config.xml

  1. #16
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: Config.xml

    sher what about forgeting XML like config file and writing it to a simple text file because your configuration is not so complicated.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  2. #17
    Join Date
    Apr 2004
    Posts
    265

    Re: Config.xml

    Quote Originally Posted by toraj58 View Post
    sher what about forgeting XML like config file and writing it to a simple text file because your configuration is not so complicated.
    I too prefer something simple rather than going for complicated coding. What do you suggest about a .ini file?

  3. #18
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: Config.xml

    it think it is ok.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  4. #19
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Config.xml

    Quote Originally Posted by shers View Post
    my project name is bm. It is a dll project.
    that is your "problem"

    dlls cannot have xml settings files. The settings you create are compiled into the dll, which is why everything works on another machine without the config file.
    Think about the logic of this for a second.. Dlls are supposed to encapsulate some common functionality. Ergo, why would they have settings? Everything they need should be provided at the time of calling. You'd be annoyed if you had to create an ini file specifying the source and destiantion path every time you used the file.copy command in the .net core dll wouldn't you?
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  5. #20
    Join Date
    Apr 2004
    Posts
    265

    Re: Config.xml

    Quote Originally Posted by cjard View Post
    that is your "problem"

    dlls cannot have xml settings files. The settings you create are compiled into the dll, which is why everything works on another machine without the config file.
    Think about the logic of this for a second.. Dlls are supposed to encapsulate some common functionality. Ergo, why would they have settings? Everything they need should be provided at the time of calling.
    You must be right.

    Please see this link and read the section
    Changing the Value of a Setting Between Application Sessions
    http://msdn.microsoft.com/en-us/libr...69(vs.80).aspx

    This is for exe.


    You'd be annoyed if you had to create an ini file specifying the source and destiantion path every time you used the file.copy command in the .net core dll wouldn't you?
    So what's the solution?

  6. #21
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Config.xml

    I gave you it already.. Rethink your program so your DLL doesnt need settings! It's the program that should have settings.. DLLs should be suitably generic so that they do not need them, no?

    Tell us more about your DLL and what setting youre trying to make. You said something about "default directory the user picks"? In what context do you mean?
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  7. #22
    Join Date
    Apr 2004
    Posts
    265

    Re: Config.xml

    The app is pointed to a certain location in the shared network, as there are some images in some organised folders. The main purpose of this app is to display these images to the users like a library. This is a COM application where it is linked to AutoCAD. This dll will be loaded into AutoCAD and executed using commands. The network share drive I mentioned earlier may be subject to change in future. So if there is a config or ini file, then the person in charge can change the location without tampering the code.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured