Red Gate forums :: View topic - Using C++ dll having header file in C#
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
PInvoke.Net
PInvoke.Net forum

Using C++ dll having header file in C#

Search in PInvoke.Net forum
Post new topic   Reply to topic
Jump to:  
Author Message
chaitu18



Joined: 15 Jan 2013
Posts: 1

PostPosted: Tue Jan 15, 2013 6:45 am    Post subject: Using C++ dll having header file in C# Reply with quote

I am totally new in C++ and I want to use C++ dll (having header file) in

C# program. Please find below header file.


Code:
#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);
};



So please let me know how can I call all these methods in my C# program. c# Example of above code is highly appreciated.Thanks in advance.
_________________
Thanks,
chaitu18
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 589

PostPosted: Wed Jan 16, 2013 4:17 pm    Post subject: Reply with quote

You are *much* better off asking this question here:
http://stackoverflow.com/questions


tag it with: C# interop
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group