Hi Martin,
I loaded your project on Visual Studio .NET 2005 Professional but my machine is
only running the 32-bit edition of Windows 7 Ultimate and my console output is:
Original single int value : 16
J returned single int value: 16
Original int array value : 4 8 15 16 23 42
J returned int array value : 4 8 15 16 23 42
My problem is access to a 64bit version of Windows so I can't replicate your
issue. I'll try to ask around the office if a team has a 64bit dev machine that
I can mess around with (no promises though). ;) :P
Just a side note, your initialize() function would fail if debug == false. It
has something to do with the requirement of J602 that a Window must be created
to initialize J properly. Hence the code:
If Me.debug Then
jScript += vbCrLf & _
"0!:0 <BINPATH,'\\profile.ijs'" & vbCrLf & _
"wd 'pn *Session Server'" //<<-- NOTE on THIS CODE
jObject.Log(1)
jObject.Show(1)
Else
jObject.Do("11!:0'pc Session;cc e editijx;'") //<<-- NOTE on THIS CODE
jObject.Log(0)
jObject.Show(0)
End If
In my sample code in
http://www.jsoftware.com/jwiki/Guides/J%20VB.NET#Initialization
Some final notes, our implementation team have deployed J in a 64bit Windows
Server environment using 32bit J and they reported no problem and requested no
support from me.
r/Alex
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Pelletier
Sent: Tuesday, October 12, 2010 10:05 PM
To: Programming forum
Subject: Re: [Jprogramming] JEXEServerLib - 64 bit problem
Basically, I took Alex Rufon's session class from
http://www.jsoftware.com/jwiki/Guides/J%20VB.NET
With a simplified initialize function:
private void initialize()
{
// Create a new copy of the J Object and make sure were in the Z locale
jObject = new JEXEServerClass();
jObject.Quit();
jObject.Do(@"BINPATH_z_=:1!:46''");
jObject.Do(@"ARGV_z_=:'oleclient';'-jijx'");
jObject.Do(@"(3 : '0!:0 y')<BINPATH,'\profile.ijs'");
if (debug)
{
// Shows a complete J console
jObject.Do("newijx_jijs_''");
}
// Get J version
object result;
jObject.DoR("9!:14 ''", out result);
jObject.Do("18!:4 <'z'");
}
And here is the program (main function and a little helper function):
using System;
namespace JSoftware
{
class Program
{
static void Main()
{
Session jSession = new Session(true);
int singleInt = 16;
jSession.Variable("SingleInt", singleInt);
object singleIntObj = jSession.Variable("SingleInt");
//This should work fine
Console.WriteLine("Original single int value : " + singleInt);
Console.WriteLine("J returned single int value: " +
((int)singleIntObj));
//Verify manually SingleInt in your J Session, value should be
identical
int[] intArray = { 4, 8, 15, 16, 23, 42 };
jSession.Variable("IntArray", intArray);
object intArrayObj = jSession.Variable("IntArray");
//This should also work fine
Console.WriteLine("Original int array value : " +
(IntArrayToString(intArray)));
Console.WriteLine("J returned int array value : " +
(IntArrayToString((int[])intArrayObj)));
//But break here and look at IntArray in J 64bit
Console.ReadLine();
}
private static string IntArrayToString(int[] array)
{
string result = "";
foreach (int single in array)
{
result += single + " ";
}
return result.Trim();
}
}
}
The code is a tiny bit different from the project, but is essentially the same.
I just thought providing a ready-made project would be easier, but I'm more
than willing to adapt to get to the bottom of this issue.
Martin Pelletier
On 2010-10-12 09:41, bill lam wrote:
> I am afraid not too many of us want to install visual studio express
> in order to open your project. May be you can just post some relevant
> code by email for discussion.
>
> Втр, 12 Окт 2010, Martin Pelletier писал(а):
>
--
Martin Pelletier
Informatique / Software Development
Infodev Electronic Designers International Inc.
Tel : +1 (418) 681-3539, poste /ext. 114 Fax : +1 (418) 681-1209
Confidentiality Note: This e-mail may contain confidential information
belonging to Infodev Electronic Designers Inc. If you are not the intended
recipient, be aware that any disclosure, copying, distribution or use of the
contents of this e-mail is strictly prohibited. If you have received this
e-mail in error, please delete this e-mail and notify the sender immediately.
Note de confidentialité: Ce courriel peut contenir des informations
confidentielles qui appartiennent à Infodev Electronic Designers Inc. Si vous
avez reçu ce courriel par erreur, veuillez l'effacer et aviser l'expéditeur
immédiatement. Toute diffusion, utilisation ou copie de ce message ou des
renseignements qu'il contient par une personne autre que le (les)
destinataire(s) désigné(s) est strictement interdite.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm