I'm trying to use a DLL written in C++. In the example of the DLL, there is a header (.h) with the following code:
#ifndef CODEGEN_H
#define CODEGEN_H
// Entry point for generating codes from PCM data.
#define VERSION 3.15
#include <memory>
#include <string>
#ifdef _MSC_VER
#ifdef CODEGEN_EXPORTS
#define CODEGEN_API __declspec(dllexport)
#pragma message("Exporting codegen.dll")
#else
#define CODEGEN_API __declspec(dllimport)
#pragma message("Importing codegen.dll")
#endif
#else
#define CODEGEN_API
#endif
class Fingerprint;
class CODEGEN_API Codegen
{
public:
Codegen(const float* pcm, uint numSamples, int start_offset);
string getCodeString(){return _CodeString;}
int getNumCodes(){return _NumCodes;}
float getVersion() { return VERSION; }
private:
string _CodeString;
int _NumCodes;
};
#endif
How can I access the dll and use their methods? I know I'll have to use the [DllImports("codegen.dll")]
but as I use the constructor of the same form given the example?