Skip to content

Usage with Visual Studio 2022

sneakyevil edited this page Feb 25, 2025 · 1 revision

Requirements

  • Visual Studio 2022 with C++
  • Cloned repository of the SDK.
  • Download the template for Visual Studio 2022.
  • Place template zip file in to the folder that's located at: %USERPROFILE%\Documents\Visual Studio 2022\Templates\ProjectTemplates\Visual C++.
    • If you're having an issue getting the template working check this page.

Creating Project

  • Open Visual Studio 2022
  • Click on Create a new project
  • Search for template called: SDModding SDK.
  • Then just create the project.

Setup VC++ Directories

  • Inside the project select menu option at top called Project and then Properties.
  • Inside properties you have configuration property called VC++ Directories, select that.
  • Now you will need to modify Include Directories and Library Directories to the folder that contains current SDK folder from this repository.
  • You will need to do this for both Debug and Release configuration.

Compiling

  • After you did everything above, you should be ready to be compile the example dllmain.cc
  • When it compiles and you load it to the game you should have in top-left corner debug text as shown below:

image

Debugging

  • Same as before in VC++ Directories you will open the Project Properties.
  • Select Debugging property.
  • Modify Command to the game executable path and also modify Working Directory to the game folder.
  • Now you simply can run the game from visual studio debugger.

Loading Compiled DLL

  • You can use program such as Process Hacker 2 to inject DLL directly to the game, but you will need to do that each game launch.
  • Best way is to use ASI Loader and then just moving compiled dll to the game folder or plugins folder and having your compiled dll automatically loaded on the game launch.
    • If you want your compiled DLL be automatically moved to the game folder as .asi file you can use Build Events inside Project Properties and using Post-Build event that for example executes batch script as: echo f | xcopy /y "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\SleepingDogsDefinitiveEdition\MyProject.asi"

Clone this wiki locally