![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Registered User Join Date: Mar 2008
Posts: 57
| How does ebook to exe application compile to self-contained executable |
| umen242 is offline | |
| | #2 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> various ebook applications "ebook" is a broad term. What particular application(s) are you referring to? >> self-contained executable file with no dependencies when you run the exe. How can it be done? Do they use real embedded compiler? Define "no dependancies". As in "running depends.exe shows no dependancies"? |
| Sebastiani is offline | |
| | #3 |
| Unregistered User Join Date: Jul 2007
Posts: 925
| Compile a program (this will be your generated app), and make it read one of it's resources for instructions on what to do. Put this program within your parent program's resources. Now, to 'generate' your application, extract the resource to an exe file, and update the extraction's resources via UpdateResource(), giving the generated application it's uniqueness.
__________________ GCC 4.4.0, Code::Blocks 8.02, Fedora 11, x64 |
| Yarin is offline | |
| | #4 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> Compile a program (this will be your generated app), and make it read one of it's resources for instructions on what to do. Oh that makes sense. I thought he was talking about "dll dependencies", but he probably was referring to the actual book data. |
| Sebastiani is offline | |
| | #5 |
| Registered User Join Date: Mar 2008
Posts: 57
| Yarin does it creates one single exe file ? with no configurations or data files that this exe depends on it ? can you please give me links for examples? Thanks allot |
| umen242 is offline | |
| | #6 |
| Guest Join Date: Aug 2001
Posts: 4,923
| >> does it creates one single exe file ? Yes, using Windows resources, you can store just about anything in the executable. Most compilers come with a resource compiler. |
| Sebastiani is offline | |
| | #7 |
| Registered User Join Date: Mar 2008
Posts: 57
| does it load it on run time ? one thing i dont understand here .. lts say i build the exe in my compiler then i direct it to load resource file . now i like to be able to give the users to make there own content and then my application ( that dont contains compiler ) will save it as single exe. who does it work ? |
| umen242 is offline | |
| | #8 |
| Unregistered User Join Date: Jul 2007
Posts: 925
| >> who does it work ? I already told you. When the user wants to "create" their own app. Just extract the one you have in the program's resources. Then make the same program update the resources of the extraction right away. Inside your 'custom' program, you'll have code that does different things depending on the resources that got updated. In reality, each "created" app would be the same thing, (with different resources) but the end user wouldn't notice. This way, no embedded compiler, or anything else super-complicated, would be required.Very often, programming is all about trickery.
__________________ GCC 4.4.0, Code::Blocks 8.02, Fedora 11, x64 |
| Yarin is offline | |
| | #9 |
| Registered User Join Date: Mar 2008
Posts: 57
| Thanks for the fast reply can you please point me to some tutorials or links Thanks |
| umen242 is offline | |
| | #10 |
| Guest Join Date: Aug 2001
Posts: 4,923
| Assuming that you have, at this point, a resource compiler handy and have already added a resource to your application, you just need to call FindResource and LoadResource to retrieve it. To do that, you're going to need a few pieces of information: 1) Your applications HMODULE value. You can use GetModuleHandle(NULL), or simply your application's HINSTANCE to fetch this value. 2) The name or ID of the resource. If it's an ID, you'll need to use the MAKEINTRESOURCE macro to "convince" the compiler that it's a string (it's just a Windows kludge, don't worry about the details, for now). 3) The type of resource (eg: RT_ACCELERATOR, RT_ANICURSOR, RT_ANIICON, RT_BITMAP, RT_CURSOR, RT_DIALOG, RT_FONT, RT_FONTDIR, RT_GROUP_CURSOR, RT_GROUP_ICON, RT_ICON, RT_MENU, RT_MESSAGETABLE, RT_RCDATA, RT_STRING, or RT_VERSION) 4) The value returned by FindResource. Now just pass #1, #2, and #3 to FindResource, and then #1 and #4 to LoadResource. That's basically it. EDIT: It looks like you can simply use the value NULL for #1. Either way should work, though. |
| Sebastiani is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does C# compile to an exe? | thetinman | C# Programming | 7 | 11-21-2008 11:17 AM |
| Help: how to compile a console application which can run pure Dos/Win32/Win64 | chenayang | C++ Programming | 5 | 07-13-2008 08:16 PM |
| Compile Error that i dont understand | bobthebullet990 | C++ Programming | 5 | 05-05-2006 09:19 AM |
| No compile time errors, exe crashes. | RealityFusion | C++ Programming | 13 | 09-06-2005 12:34 PM |
| Linking problems trying to compile QT application | Maragato | C++ Programming | 1 | 08-19-2005 09:08 PM |