[C/C++] Build a Windows Explorer Extension without ATL (Part III)

Discussion in 'Mixed Languages' started by Michaela Joy, Mar 28, 2015.

  1. Michaela Joy

    Michaela Joy MDL Crazy Lady

    Jul 26, 2012
    4,071
    4,651
    150
    #1 Michaela Joy, Mar 28, 2015
    Last edited: Mar 28, 2015
    Hi All,
    Now that we understand how a Shell Extension works, let's set up a build environment and create one. To do this, I'll use Code::Blocks and TDM-GCC w64. I'll assume that you have installed Code::Blocks and TDM-GCC. If you have, You should be able to run Code::Blocks and choose the default tool chain.

    Code::Blocks is a little tricky to set up. First, you must set up an environment so that TDM-GCC can work as a C compiler. To do this, choose "Compiler..." from the settings menu.
    gcs1.jpg

    After pressing "Copy", rename the new tool chain to TDM-GCC - C. Now, you must change the executable files used in the "Toolchain executables" pane. The finished changes should look like this:
    gcs2.jpg


    Now we're ready to create a new DLL project. So, we go into "File\New\Project...", choose "Dynamic Link Library from the Icons, and follow the wizard to create a new project. Lo and Behold, our new project is set up with Main.cpp. (Exactly what we do -not- want) So, remove main.cpp from the project. Create a new C file, and call it Main.c. Now, you can start adding files and code to the project.

    If you enter all of the code in My example and press <Ctrl> F11 (Build all) You will get a face full of errors from the compiler. That is because you need to set the project up. To do this, go to "Project\Properties..."

    You will see this dialog box.

    gcs3.jpg

    Press the button indicated by the red arrow. Choose the "Linker settings" tab and enter the information as it is shown.

    gcs4.jpg


    Now, enter the information on this pane.

    gcs5.jpg


    If all went well, You should be able to compile your project.

    :MJ
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...