Results 1 to 4 of 4

Thread: [RESOLVED] how to add dll with bad file name on my codes

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Location
    Brunei Darussalam
    Posts
    50

    Resolved [RESOLVED] how to add dll with bad file name on my codes

    This dll file is on my resource file
    and basically i use this code to access my resources

    Code:
     System.IO.File.WriteAllBytes("C:\eYESTRA1N\mydll.dll", My.Resources.mydll)
    now my problem is the dll i am using right now isnt mine, its from the exe that i embeded on my program,
    and its name cause an error on my codes

    this is the dll libgcc_s_dw2-1.dll

    and when i put it on my codes the "dw and 2 will have and space between them and the number 1 on its name will also separated automatically...

    how to fix it?

    this is the error

    Code:
    System.IO.File.WriteAllBytes("C:\eYESTRA1N\APKINSTALLER\libgcc_s_dw2-1.dll", My.Resources.libgcc_s_dw2 - 1)
    thanks in advance
    System.IO.File.WriteAllBytes("C:\eYESTRA1N\APKINSTALLER\libgcc_s_dw2-1.dll", My.Resources.libgcc_s_dw2 - 1)

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how to add dll with bad file name on my codes

    I think that it's a poor idea to embed that file in the first place but, assuming you are, there's no need for a resource to use the same name as the original file. You could name your resource just X if you wanted to. Simply rename the resource to something else. Just "libgcc" would be the first thing that came to my mind. As you can see from your own code, the file name you save it to has no direct connection to the resource name either.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2007
    Location
    Brunei Darussalam
    Posts
    50

    Re: how to add dll with bad file name on my codes

    thanks sir jm for the past reply
    yeah you are right i can rename it to anything BUT IT SHOULD BE name which is available also on my resource file

    if i rename it to libgcc it will result to an error
    so i rename it to a name of my other resource file which is on my resource also and it works

    i should have done that before i post (lazy me)
    thanks so much sir

    expect me to ask another question again this day, until i finish this project
    again thank you
    regards

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2007
    Location
    Brunei Darussalam
    Posts
    50

    Re: how to add dll with bad file name on my codes

    by the way sir,
    you said its poor idea to embed this file

    can you give me another good option to do it?
    although its working now i just want to ask a better one

    regrds

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