Jump to content

Problem translating input plugin API to C++


Recommended Posts

Hello,

I'm coding a input plugin using C++, unfortunately I couldn't find a C++ sample and my C++ knowledge is rather poor. I've pasted the signatures of the docs, my code looks as follows:

 

#include "stdafx.h"

extern "C" {

char* __stdcall Copyright()
{
return "stax";
}

char* __stdcall Version()
{
return "1.0.0.0";
}

char* __stdcall LibTyp()
{
return "input";
}

char* __stdcall PluginName()
{
return "MceRemote";
}

typedef (__stdcall *TInputCallback) (char *Sender;char *Event); // error occurs here

//void __stdcall SetCallback(int Handle; TInputCallback Callback);

//void __stdcall Showsettings(int handle);

}

 

I'm getting the following error:

 

1>d:\projekte\DVBViewer\mceremote\mceremote.cpp(25) : error C2143: syntax error : missing ')' before ';'
1>d:\projekte\DVBViewer\mceremote\mceremote.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\projekte\DVBViewer\mceremote\mceremote.cpp(25) : error C2059: syntax error : ')'

 

I've uploaded the entire project created with VS 2008 Express:

 

http://www.mediafire.com/?gzzqpztmlzw

 

What am I doing wrong?

 

thx

stax

Edited by stax
Link to comment

After refreshing my C++ knowledge and playing around I was now able to compile it with following changes:

 

typedef void (__stdcall *TInputCallback) (char *Sender, char *Event);

void __stdcall SetCallback(int Handle, TInputCallback Callback)
{

}

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...