  | | | dotNet | dotNet 2005-04-06 - By Brad Friedman
Back 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.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Brad Friedman wrote: <blockquote cite="mid42531100.5080804@(protected)" type="cite"> <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type"> <title></title> <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> </body> </html>
|
|
 |