wyrd Posted November 12, 2003 Posted November 12, 2003 I was wondering if there was a way to embed user referenced .dlls into your executable, rather than just having it copied to your local bin folder. It'd be nice to have a single .exe, rather than an .exe + .dlls. :P Quote Gamer extraordinaire. Programmer wannabe.
bri189a Posted November 12, 2003 Posted November 12, 2003 I'm not sure if I follow you. Your saying you have a DLL (a bunch of classes compiled together) that someone else made and want to put in your executable? Don't think that could be done - least not that I can figure, the DLL's would have to be decompiled, added as individual classes to your project and then recompiled with the project to make a single EXE. Now if the DLL was yours then just take the root classes and add them to your project, but I don't think that's what your saying. Quote
wyrd Posted November 12, 2003 Author Posted November 12, 2003 You can add resources to your project, such as text documents and images. I don't see why a .dll would be any different. Quote Gamer extraordinaire. Programmer wannabe.
*Gurus* divil Posted November 13, 2003 *Gurus* Posted November 13, 2003 Because a dll has to be loaded in to memory, entry points found and all sorts of other issues like that. I see this question a lot and always find myself wondering what benefit a 1mb exe has over a 100k exe and a few dlls? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Administrators PlausiblyDamp Posted November 13, 2003 Administrators Posted November 13, 2003 (edited) I suppose you could add them as a resource and on execution write them out to disk.... Wouldn't that defeat the point of DLLs - easier updating, better reuse etc? Edited February 21, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wyrd Posted November 14, 2003 Author Posted November 14, 2003 Because a dll has to be loaded in to memory, entry points found and all sorts of other issues like that. I see this question a lot and always find myself wondering what benefit a 1mb exe has over a 100k exe and a few dlls? With small apps, people like a single executable. Makes it easier to share with friends.. and just more convenient. Quote Gamer extraordinaire. Programmer wannabe.
*Experts* Nerseus Posted November 14, 2003 *Experts* Posted November 14, 2003 You could create a simple setup program or use Winzip to create a self-extracting EXE. Otherwise, no, there's no way to get a DLL embedded into your EXE without some work. You could, theoretically, embed the DLL. At runtime you could get the DLL as a resource and write it to disk. I'm not sure if that would work 100% or if you'd need to also load the DLL yourself. if you're using C++ you're a bit luckier as you can use LoadLibrary to load a standard DLL yourself, though I don't think a .NET managed DLL would work like that. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
*Gurus* divil Posted November 14, 2003 *Gurus* Posted November 14, 2003 Surely anyone who wanted a single exe with no dependancies would have chosen the appropriate language and compiler, i.e. MSVC++, to start off with? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
JumpsInLava Posted November 14, 2003 Posted November 14, 2003 Something like this might work for you: http://www.molebox.com/ Quote
Moderators Robby Posted November 14, 2003 Moderators Posted November 14, 2003 seems to be a dead link. Quote Visit...Bassic Software
wyrd Posted November 16, 2003 Author Posted November 16, 2003 Surely anyone who wanted a single exe with no dependancies would have chosen the appropriate language and compiler, i.e. MSVC++, to start off with? Programming in unmanaged C++ just so you could have everything in a single .exe would be nutty. Quote Gamer extraordinaire. Programmer wannabe.
*Experts* Volte Posted November 16, 2003 *Experts* Posted November 16, 2003 Since that's the only way to do it effectively, it's not really nutty. More like "required". :-\ What does this program do, anyway? If it's so small, creating it in C++ should be no problem (assuming you're familiar with C++). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.