  | | | dotNet | dotNet 2005-04-06 - By kim aldis
Back congratulations, although like I said, I've already confirmed this to work. ;-) to release the dll, go to the plugins manager and unload from there. Keep up the good work!
__ __
From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of Brad Friedman Sent: 06 April 2005 15:19 To: XSI@(protected) Subject: Re: dotNet
Brad Friedman wrote:
I'm going to try giving this stuff a run in the next few days. If I get a LogMessage("HelloXSIWorld") functioning from c# I'm sure you'll hear from me :)
You are now hearing from me :)
It works.
In otherwords... I got the following .cs file to work.
[code] /* * Created by SharpDevelop. * User: leith * Date: 4/6/2005 * Time: 8:55 AM * * To change this template use Tools | Options | Coding | Edit Standard Headers. */
using System; using System.Runtime.InteropServices; using XSI = SI3DOBJECTMODELLIB; namespace XSIHelloWorld {
public interface IXSIHelloWorld{ void callMe(); }
[ClassInterface(ClassInterfaceType.AutoDual)] public class XSIHelloWorld : IXSIHelloWorld{ public void callMe(){ XSI.CXSIApplicationClass app = new XSI.CXSIApplicationClass(); ((XSI.Application) app).LogMessage("HELLO XSI WORLD!", XSI.siSeverity.siInfo); } } } [/code]
The important thing here is that the c# code is calling into the XSI COM type libraries directly and is being called through scripting.
So umm... yea. Wow. AWESOME! WOO HOO! HOORAY!
I'm going to spend some time over the next few days trying to streamline this execution environment to make it easy to install and all that jazz. Then I'll publish it to make it accessible.
BTW, I have run into one slightly annoying problem. Once you create the activex object, XSI holds onto it and makes recompiling the DLL impossible until you close XSI. What would be the best way to force the activex object to be destroyed and get the DLL unloaded? So I can keep from having to reload XSI every time I want to compile? Or is this impossible? Any thoughts?
-brad
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE></TITLE> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD> <BODY text=#000000 bgColor=#ffffff> <DIV dir=ltr align=left><SPAN class=859162814-06042005><FONT face=Arial color=#0000ff size=2>congratulations, although like I said, I've already confirmed this to work. ;-)</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=859162814-06042005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=859162814-06042005><FONT face=Arial color=#0000ff size=2>to release the dll, go to the plugins manager and unload from there.</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=859162814-06042005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=859162814-06042005><FONT face=Arial color=#0000ff size=2>Keep up the good work!</FONT></SPAN></DIV><BR> <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> owner-xsi@(protected) [mailto:owner-xsi@(protected)] <B>On Behalf Of </B>Brad Friedman<BR><B>Sent:</B> 06 April 2005 15:19<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> Re: dotNet<BR></FONT><BR></DIV> <DIV></DIV>Brad Friedman wrote: <BLOCKQUOTE cite=mid42531100.5080804@(protected) type="cite"><SPAN class=MsgViewAlternateBody><BR>I'm going to try giving this stuff a run in the next few days. If I get a LogMessage("HelloXSIWorld") functioning from c# I'm sure you'll hear from me :)<BR><BR></SPAN></BLOCKQUOTE>You are now hearing from me :)<BR><BR>It works.<BR><BR>In otherwords... I got the following .cs file to work.<BR><BR>[code]<BR>/*<BR> * Created by SharpDevelop.<BR> * User: leith<BR> * Date: 4/6/2005<BR> * Time: 8:55 AM<BR> * <BR> * To change this template use Tools | Options | Coding | Edit Standard Headers.<BR> */<BR><BR><BR>using System;<BR>using System.Runtime.InteropServices;<BR>using XSI = SI3DOBJECTMODELLIB;<BR>namespace XSIHelloWorld<BR>{<BR><BR> public interface IXSIHelloWorld{<BR> <BR> void callMe();<BR>   ; <BR> }<BR><BR> [ClassInterface(ClassInterfaceType.AutoDual)]<BR> public class XSIHelloWorld : IXSIHelloWorld{<BR>   ; <BR> public void callMe(){<BR> XSI.CXSIApplicationClass app = new XSI.CXSIApplicationClass();<BR> ((XSI.Application) app).LogMessage("HELLO XSI WORLD!", XSI.siSeverity.siInfo);<BR> <BR> }<BR> <BR> }<BR>}<BR>[/code]<BR><BR>The important thing here is that the c# code is calling into the XSI COM type libraries directly and is being called through scripting.<BR><BR>So umm... yea. Wow. AWESOME! WOO HOO! HOORAY!<BR><BR>I'm going to spend some time over the next few days trying to streamline this execution environment to make it easy to install and all that jazz. Then I'll publish it to make it accessible.<BR><BR>BTW, I have run into one slightly annoying problem. Once you create the activex object, XSI holds onto it and makes recompiling the DLL impossible until you close XSI. What would be the best way to force the activex object to be destroyed and get the DLL unloaded? So I can keep from having to reload XSI every time I want to compile? Or is this impossible? Any thoughts?<BR><BR>-brad<BR></BLOCKQUOTE></BODY></HTML>
|
|
 |