Jump to content

Recommended Posts

Posted

When I don't have classes I do this to export my entry points:

//########################

//C++

extern"C"__declspec(dllexport) int__stdcall SumUp_unmgdCPP(int a, int b, int* c)

{

*** c[0]=4; c[1]=3; c[2]=2; c[3]=1;

 

//########################

//C#

[DllImport("NameOfDLL", CallingConvention = CallingConvention.StdCall)]

publicstaticexternint SumUp_unmgdCPP(int a, int b, int[] f); publicint SumUp(int a, int b, ref int[] f)

{

*** return SumUp_unmgdCPP(a, b, f);

How do you do it in a C++ dll-project with*classes? I did this:

class FMS

{

public:

*** extern"C"__declspec(dllexport) int__stdcall SumUp_unmgdCPP(int a, int b, int* c);

private:

*** float m_WheelSpeed; // 1

}

It complains about*the string "C" above being part of the declaration above. I don't think this is the way you do it when you have classes. Just paste the equivalent of what I'm doing in at the top in a dll-project with no classes but now*instead in a C++*dll-project with classes and I will be very thankful.

 

/Lars

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...