[IronPython] "Merlin" tutorial not working
Dino Viehland
dinov at microsoft.com
Mon Oct 13 18:02:20 CEST 2008
The tutorial will be updated for the RC. But the code should now be:
from System.Runtime.InteropServices import DispatchWrapper, UnknownWrapper
c = clr.StrongBox[object](DispatchWrapper(None))
a.GetCharacter(cid.Value, c)
c.Value.Show(0, reqid)
c.Value.Think("IronPython Tutorial", reqid)
That's more complicated then it was before (with the new COM interop support) but I'm told Merlin has a rather odd object model that you don't see very much in COM APIs.
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Slutter
Sent: Sunday, October 12, 2008 10:20 PM
To: Discussion of IronPython
Subject: [IronPython] "Merlin" tutorial not working
I'm going through the IronPython tutorial and I'm at the COM interop
part. I'm trying to get the Merlin example working but I can't get it
past a certain part.
First of all, I had to make some changes to get the example to work, as
it doesn't appear the tuple/out param stuff works the same as it does in
the tutorial.
Here is my code:
agentServer = AgentServerClass();
characterId = clr.Reference[int]();
reqId = clr.Reference[int]();
agentServer.Load("Merlin.acs", characterId, reqId);
myMerlinCharacter = clr.Reference[object]();
agentServer.GetCharacter(characterId.Value,myMerlinCharacter);
merlinCharacter = myMerlinCharacter.Value;
merlinCharacter.Show(0);
The exception happens when calling .GetCharacter. The error is:
An unhandled exception of type 'System.ArgumentException' occurred in
Microsoft.Scripting.Core.dll
Additional information: Could not convert argument 4294967295 for call
to GetCharacter.
Any ideas?
-Jeff
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list