-
Notifications
You must be signed in to change notification settings - Fork 0
/
CppInterface.h
38 lines (30 loc) · 1012 Bytes
/
CppInterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Include this file in native code to interface with the .NET library
#pragma once
#include <string>
// Sets the interface function's decoration as export or import
#ifdef DOTNET_EXPORTS
#define EXPORT_SPEC __declspec( dllexport )
#else
#define EXPORT_SPEC __declspec( dllimport )
#endif
namespace DotNetInterop
{
// Calls .NET library Attach.
// Called when DLL is loaded.
// Returns true on success.
EXPORT_SPEC bool Attach(const char* dllPath, bool useCustomDLL);
// Calls .NET library Initialize.
// Called when the mission is first loaded.
// Returns true on success.
EXPORT_SPEC bool Initialize();
// Calls .NET library Update.
// Called every update cycle.
EXPORT_SPEC void Update();
// Used to get a buffer for storing data for saved game files
EXPORT_SPEC void* GetSaveBuffer();
EXPORT_SPEC int GetSaveBufferLength();
// Calls CLR Detach.
// Called when DLL is unloaded.
EXPORT_SPEC void Detach();
//EXPORT_SPEC std::string GetDisplayString(const char * pName, int iValue);
}