Hello,
I am sure that I am missing something simple. After creating an example plugin with Visual Studio 2008 (Windows 7, Xojo Windows IDE), I cannot run the program and get the following error: This item does not exist, and the TestClass code is highlighted as follows:
[code] dim x as double
x = TestClass.DivideBy2(5)
msgbox "x = " + CStr(x)[/code]
Here is the code for the C++ Plugin
[code]// Example6-1.cpp
#ifdef _MSC_VER
#include “WinHeader++.h”
#endif
#include “rb_plugin.h”
#include “Example6-1.h”
#include <windows.h>
//The functions math
double DivideBy2(double x)
{
return x/2;
}
REALmethodDefinition testClassMethods[] = {
{ (REALproc)DivideBy2, REALnoImplementation, “DivideBy2(x as double) As Double” },
};
REALconstant testClassConstants[] = {
{ “Pi = 3.141592654” },
};
REALclassDefinition TestClass = {
kCurrentREALControlVersion,
“TestClass”,
0, // superName
0, // data size
0, // reserved for system use
NULL, // initializer
NULL, // deinitializer
NULL, // properties
0, // property count
testClassMethods, // methods
sizeof(testClassMethods) / sizeof(REALmethodDefinition), // method count
NULL, // events
0, // event count
NULL, // event instances
0, // event instance count
“TestInterface”, // interface(s)
NULL, // bindings
0, // bindings count
testClassConstants, // constants
sizeof( testClassConstants ) / sizeof( REALconstant ), // constant count
};
void PluginEntry(void)
{
REALRegisterClass(&TestClass);
}[/code]
[code]//Example6-1.h code
//Creates functions for the DLL Application
#include “WinHeader++.h”
#include “rb_plugin.h”
extern “C” {
double DivideBy2(double x);
}[/code]
When the example plugin code shipped with Xojo for VS2005 is compiled, the code works. My attempt is to make a class with a constant and a simple method.
Any helpful suggestions?
Thank you,
Eugene