Creating a dll from C source files in Visual C++ for PSoC 3/5 Bootloader

Question: 1) How to create the Bootloader dll(BootLoad_Utils.dll) for PSoC 3/5 Bootloader host? 2) How to create a dll from a set of C source files using Visual C++ ?

 

Answer:

Follow the procedure below to create a dll for Bootloader Host or in general to create a dll from C source files:

  1.   Click File --> New Project.
  2.   Select Win32 as the Project type.
  3.   From the Templates pane, select Win32 Console Application.
  4.   Provide a suitable name to the project and the solution (BootLoad_Utils).
  5.   Click OK to start the Win32 Application Wizard.  From the Overview page of the Win32 Application Wizard dialog, press Next.
  6.   From the Application Settings page of the Win32 Application Wizard, under Application type, select DLL if it is available or Console application if DLLis not available. Under Additional options, select Empty project. Press Finish.
  7.   In the Solution Explorer, Right Click Header Files --> Add --> New Item. Add the Header files using this procedure:
  •   cybtldr_command.h
  •   cybtldr_parse.h
  •   cybtldr_api.h
  •   cybtldr_api2.h

 

 

 

 

 

 

  •         8.  In the Solution Explorer, Right Click Header Files --> Add --> New Item. Add the Source files using this procedure:
  •  

     

     

     

     

     

    •   cybtldr_command.c
    •   cybtldr_parse.c
    •   cybtldr_api.c
    •   cybtldr_api2.c

          9.  To build the project into a DLL, from the Project menu, select Project Properties. From the left pane, under Configuration Properties, select General.From the right pane, change the Configuration Type to Dynamic Library (.dll). Press OK to save the changes.

          10.  Compile the project by clicking Build --> Build Solution. This will create the necessary dll file(BootLoad_Utils.dll).

     

    The dll created using the above procedure is attached (BootLoad_Utils.dll).