Using SDK in Visual Basic C++ 2010

Questions about MultiCharts and user contributed studies.
pschriber2
Posts: 36
Joined: 24 Apr 2012
Has thanked: 6 times
Been thanked: 2 times

Using SDK in Visual Basic C++ 2010

Postby pschriber2 » 26 Jul 2012

Hi, I'm trying to develop a simple program to perform various operations (add, subtract, divide, multiply). This is just something I'm trying to get a idea of how the whole SDK and PLKit.dll works. I'm getting the following errors:

>c:\dlltest\testing\testing\testing.cpp(12): error C2065: 'IEasyLanguageObject' : undeclared identifier

1>c:\dlltest\testing\testing\testing.cpp(12): error C2065: 'pELObj' : undeclared identifier

1>c:\dlltest\testing\testing\testing.cpp(12): error C2062: type 'double' unexpected

1>c:\dlltest\testing\testing\testing.cpp(13): error C2143: syntax error : missing ';' before '{'

Here is my code:

Code: Select all

#import "C:\Program Files\TS Support\MultiCharts\PLKit.dll"
#include <stdexcept>
#include <iostream>

using namespace std;

extern "C" double _stdcall Add(IEasyLanguageObject *pELObj, double a, double b)
{
return (a + b);
};

extern "C" double _stdcall Subtract(IEasyLanguageObject *pELObj, double a, double b)
{
return (a - b);
};

extern "C" double _stdcall Multiply(IEasyLanguageObject *pELObj, double a, double b)
{
return (a * b);
};

extern "C" double _stdcall Divide(IEasyLanguageObject *pELObj, double a, double b)
{
if (b == 0)
{
throw new invalid_argument("b cannot be zero!");
};

return (a / b);
};

pschriber2
Posts: 36
Joined: 24 Apr 2012
Has thanked: 6 times
Been thanked: 2 times

Re: Using SDK in Visual Basic C++ 2010

Postby pschriber2 » 26 Jul 2012

I was able to fix the error. I forgot to add "no_namespace" after the #import statement.


Return to “MultiCharts”