我是c ++的新手,我想在c#程序中使用C ++ dll(有头文件)。
请在下面找到头文件。
#pragma once
#define DAILY_PERIOD 24*60
#define MIN_PERIOD 1
#ifdef API_DLL
#define METHOD_TYPE __declspec(dllexport)
#else
#define METHOD_TYPE __declspec(dllimport)
#endif
struct Quote {
unsigned long Date;
float Price;
float Open;
float High;
float Low;
float Volume;
float OpenInterest;
};
class METHOD_TYPE CMinuteApiCallback
{
public:
virtual int quote_notify( const char* symbol, int interval, int nMaxSize, Quotation *pQuotes, unsigned long echo)=0;
};
class METHOD_TYPE CMinuteApi
{
public:
CMinuteApi(void);
int Initialise(char *serialkey, CMinuteApiCallback* callback);
int GetQuote(char * symbol, int periodicity, unsigned long lasttimeupdate, unsigned long echo);
int DeleteQuote(char * symbol, int periodicity);
~CMinuteApi(void);
};
所以,请让我知道如何在我的c#程序中调用所有这些方法。