xFunction

G

garyh

Will xFunction work in an internet multiuser load balanced windows
server environment?
 
Joined
Nov 13, 2006
Messages
1
Reaction score
0
A problem with XFunction

I wrote the following program in C++ 6.0:-

#include <stdio.h>

typedef struct{
int arr[8];
} MY_STRUCT;

__declspec(dllexport) void display_values(MY_STRUCT *my){

int i;

for(i=0;i<8;i++){
int val= my->arr;
printf("%d ", val);
printf("\n");
}
}

And I saved this code in a .c file and the project was built successfully and I put the resulting DLL in system32 folder.

Then I made a program in NetBeans 5.0 as follows:-

import com.excelsior.xFunction.*;
public class Main {

public Main() {
}
public static void main(String[] args) throws xFunctionException{
xFunction f=new xFunction("mydll","void display_values(int *)");
int[] arr={1,2,3,4,5,6,7,8};
MY_STRUCT my = new MY_STRUCT();
my.arr=arr;
Pointer arg = Pointer.createPointerTo(my);
f.invoke(arg);
System.out.println("\nOK");
}

}
class MY_STRUCT extends Structure{

int[] arr;

public String defineLayout(){
return "int[8] arr";
}

public MY_STRUCT(){
arr = new int[8];
}
}
then there was an error says:-

com.excelsior.xFunction.IllegalSignatureException: Class 'MY_STRUCT' not found

at com.excelsior.xFunction.ArgType.<init>(ArgType.java:169)

at com.excelsior.xFunction.ArgType.getArgType(ArgType.java:110)

at com.excelsior.xFunction.xFunction.parseSignature(xFunction.java:222)

at com.excelsior.xFunction.xFunction.<init>(xFunction.java:41)

So please some one help me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top