I remembered thinking that I was going to tell you that J.EXE <> J.DLL ... but 
I forgot too (must have had more than 7 items in the brain).

Another difference that you have to look out for is that J.EXE provides the WD 
interfaces. For my projects, this is critical because I tend to retrieve data 
from archaic hardware (machines that cut cloths, hand held devices that track 
production tags, worker efficiency through serial ports, etc) which provides 
interface through COM (most of the time written in VB6 with no source code). I 
don't normally bother with JDLLServer since the JEXEServer is essentially a 
wrapper to it. ;)


On Oct 15, 2010, at 7:04 AM, Martin Pelletier wrote:

>  Well, I'm flabbergasted.
> 
> Apparently, JDLLServer (for 64-bit) behaves very differently from 
> JEXEServer.
> 
> The error I got with ErrorText after using SetM was: "not supported in 
> EXE server".
> 
> So, I tested SetB and GetB with JDLLServer and lo and behold, they work!
> 
>     int[] intArray = { 4, 8, 15, 16, 23, 42 };
>     object intArrayObj = intArray;
>     jObject.SetB("IntArray", ref intArrayObj);
>     object jIntArray;
>     jObject.GetB("IntArray", out jIntArray);
>     Console.WriteLine(IntArrayToString(intArray));
>     Console.WriteLine(IntArrayToString((int[])jIntArray));
>     jObject.Do(@"IntArrayStr =: "": IntArray");
>     object jIntArrayStr;
>     jObject.GetB("IntArrayStr", out jIntArrayStr);
>     Console.WriteLine(jIntArrayStr);
>     Console.ReadLine();
> 
> This is our base code. Ugly, but this is the minimal stuff to make it work.
> 
> Now, with J-64bit registered, declare jObject thus:
> 
> JEXEServerClass jObject = new JEXEServerClass();
> 
> The output will be:
> 
> 4 8 15 16 23 42
> 4 8 15 16 23 42
> 34359738372 68719476751 180388626455 0 0 0
> 
> But with this:
> 
> JDLLServerClass jObject = new JDLLServerClass();
> 
> The output is:
> 
> 4 8 15 16 23 42
> 4 8 15 16 23 42
> 4 8 15 16 23 42
> 
> I just need to test out GetM and SetM with the DLL. So clearly J.exe and 
> J.dll were compiled with a few differences. This makes debugging very 
> nasty, but it also means that J64.exe should not be used in production 
> as a COM, unless you promise not to use arrays.
> 
> Martin Pelletier
> 
> On 2010-10-14 17:50, David Mitchell wrote:
>> I have not been able to get GetM to work with C#.
>> 
>> But, when I was trying out variations based on your example, I did find that 
>> the
>> following code worked to help find out the text form of at least some of the
>> returned errors:
>> 
>> foo = jObject.SetB(name, ref value);
>> foo = jObject.ErrorText((int)foo,out jmsg);
>> 
>> Perhaps this would help with the error you are seeing.
>> 
>> Good luck,
>> --
>> David Mitchell
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to