Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi there
its a multi question
im working on gameengine project and i want to know
how my application can create new exe file from existing exe which can run the game
i mean i want my application can change icon of exe and application name and company name and etc and put some extra data to end of that and read it
(i mean fix access denid error to open running exe)
i never want make a compiler to make exe its realy hard
this is one of my question i put code below
this project try to open gameengine.exe which "gameengine.exe" is name of my execution game engine

C++
#pragma once
#include <stdio.h>

namespace gameengine {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;

    /// <summary>
    /// Summary for Form1
    ///
    /// WARNING: If you change the name of this class, you will need to change the
    ///          'Resource File Name' property for the managed resource compiler tool
    ///          associated with all .resx files this class depends on.  Otherwise,
    ///          the designers will not be able to interact properly with localized
    ///          resources associated with this form.
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: Add the constructor code here
            //
        }

    protected:
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }

    private:
        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent(void)
        {
            this->SuspendLayout();
            //
            // Form1
            //
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(284, 262);
            this->Name = L"Form1";
            this->Text = L"Form1";
            this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
            this->ResumeLayout(false);

        }
#pragma endregion
    private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
                 FILE *p=fopen("gameengine.exe","rb");//this is my problem
             }
    };
}

thanks everyone
Posted
Updated 24-May-13 6:54am
v5
Comments
joshrduncan2012 24-May-13 11:44am    
not a well-formed question...
"I want" doesn't mean anything. Do you want someone to do the work for you?
MJokar 24-May-13 11:51am    
hi im not english
please forgive me for bad typing
joshrduncan2012 24-May-13 11:52am    
Do you want someone to do the work for you? We can't help you unless we see some effort on your part first. It sounds like you haven't attempted this yet.
MJokar 24-May-13 11:57am    
im working on interpreter for my engine but i want just change icon of my geme runner
lets think i have a exe file and i want just change icon of file programmatically
and another question is when i want open my exe througe its own ( get error access denid)
JackDingler 24-May-13 12:28pm    
You can't open a running executable.

Here's a good place to start if your goal is to update the taskbar icon.

http://www.codeproject.com/search.aspx?q=taskbar+icon+C%2B%2B&x=0&y=0&sbo=kw

I have no idea how this particular engine works, but I'm pretty certain that it does use compilation. Here is the thing: some compilers, along with MSBuild.EXE come with .NET (redistributable) network. And, by the way, it means that Visual Studio is not needed to build projects; a solution with C# and VB.NET projects can be built with MSBuild. Studio itself does not compile those projects. And the presence of those compilers is required by .NET FCL, because it includes Code DOM which allows, in particular, to compile .NET code from source of from code DOM tree, load and execute it during runtime.

And it does not mean self-modification of the program. Self-modifying code is the conception which goes quite far from dominating modern programming paradigms. For more detail, please see: http://en.wikipedia.org/wiki/Self-modifying_code[^].

In .NET, in Windows (in Linux, *NIX and a lot more), the code native to these platforms is never modified. The lack of the possibility to modify already loaded code is usually supported by the most CPUs, so it is physically impossible.

Adding some code in the process during runtime is not modification of existing loaded code. This feature can be used to build plug-in architecture where the plug-ins are loaded (preliminary built during the same runtime or not) dynamically during runtime. Unloading of them is specifically difficult though (in .NET), but this problem is solved through unloading of whole Application Domains. If you are interested, I can reference a good number of my past very detailed answers on this topic. Do you need that?

—SA
 
Share this answer
 
thank you very much my friends
so the game engine have a compiler yes?
the real problem is when i release my first game engine to game developers
they want build a game with that and game engine copy precompiled executable file to game folder but icon of exe is my icon and they must open exe file with visual stadio resource editor and change icon and save.i want when engine copy the exe file then change icon to game deverlopers favorite icon.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900