Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
dotNet (was: IDE)

dotNet (was: IDE)

2005-04-06       - By Brad Friedman

 Back
Reply:     1     2     3  

Well my intention is to wrap it in an installer.  There's an option to
register an assembly with com in an installer.  Thats the pragmatic answer.

I'll have to check to be sure but I believe the regasm program is part
of the .net framework (.net runtime, rather than the .net SDK) and
therefor is installed on most updated windows machines already.  So you
could write a script as part of the install process to call regasm
manually as well, if you don't have access to an installer that can do
this automatically for you.

BTW, if you already know Java, there was a really good book from MS
press... something like "C# for Java Programmers."  It was good to get
me up and running while skipping all the parts I already knew about
programming in general.  Very quick read.  And not so much Java bashing
involved either.

kim aldis wrote:

> yeah, the codebase thing threw up all sorts of warnings but basically
> it worked and I got to see the message from callMe() in XSI. I'm
> spanky new to C# but I'm looking at it because C++ has just too much
> crap surrounding it for someone who only needs to fall back on it once
> a month or so. If you figure out the correct way I'd like to hear.
>  
> One question; how would one register this on a machine that doesn't
> have c# installed?
>  
>  
>
>     -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
>     *From:* owner-xsi@(protected) [mailto:owner-xsi@(protected)]
>     *On Behalf Of *Brad Friedman
>     *Sent:* 05 April 2005 23:28
>     *To:* XSI@(protected)
>     *Subject:* dotNet (was: IDE)
>
>     nice.  Thats pretty much what I was going to do.  The only thing
>     that seems a tad off is the line:
>
>     regasm AxComp.dll /tlb:AxCompNet.dll /codebase
>
>     the filename specified after the ./tlb: should end with the
>     extension .tlb, not dll.  You can roll a .tlb into a dll as a
>     resource with another command line app (forgot what its called).
>     But its not neccesary. And apparently the .tlb file is not all
>     that important to registering the typelib because... it works even
>     though its got the wrong extension :)
>
>     The only other thing that needs ironing out is the nonsense with
>     the /codebase flag.  the docs from MS read:
>
>     Creates a Codebase entry in the registry. The Codebase entry
>     specifies the file path for an assembly that is not installed in
>     the global assembly cache. You should not specify this option if
>     you will subsequently install the assembly that you are
>     registering into the global assembly cache. The assemblyFile
>     argument that you specify with the /codebase option must be a
>     strong-named assembly.
>
>     its not all that difficult to either install the assembly into the
>     GAC and skip the /codebase flag, or make the assembly strongly
>     named.  So I doubt that will cause much of an issue down the line
>     once you get to installation issues.
>
>     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 :)
>
>     -brad
>
>
>
>     kim aldis wrote:
>
>>     I tried this quickly and it works
>>      
>>     http://www.devhood.com/messages/message_view-2 (See http://iew-2.ora-code.com).aspx?thread_id=16569
>>      
>>     but like you say, it seems kind of a specialised registration.
>>     That said, it's way shorter than the messing around you need to
>>     do with C++; even if there's a bit of a performance hit it's
>>     worth it just for how easy it is. I also kind of like the idea I
>>     can just create a single file and compile from the CL. Nice and
>>     simple. When I get time I'll be looking at it a bit closer.
>>
>>         -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
----
>>         *From:* owner-xsi@(protected)
>>         [mailto:owner-xsi@(protected)] *On Behalf Of *Brad Friedman
>>         *Sent:* 05 April 2005 18:13
>>         *To:* XSI@(protected)
>>         *Subject:* Re: IDE
>>
>>         Thats the tricky and confusing part.  I'm going to try using
>>         the regasm tool to register an assembly as a com type library
>>         next and see if that will work.  But my understanding is that
>>         the .net assembly will need to be registered in the Global
>>         Assembly Cache (GAC) in order for it to work.  And it will
>>         need a strong name.  I suspect this will work.  The downside
>>         is that I doubt this will work with an xsi .addon install.
>>         you'll need to install the .net assembly separate. Second, it
>>         wont really work the same way XSI's execution environment is
>>         set up.  XSI likes to swap out com binaries via environment
>>         variables to make it possible to run multiple versions of XSI
>>         side by side.  It also lets you put dlls in a workgroup and
>>         it handles registering them with com seamlessly.  But the way
>>         .net wants to do its com serving, it needs to be global.  You
>>         can't register .net assemblies with com using the usual
>>         registration tools (the way XSI does it when you install an
>>         addon).  You have to use the regasm tool.  I assume XSI
>>         doesn't do that itself.  Though perhaps it should in the next
>>         version (nudge nudge wink wink).
>>
>>         I think its possible to make it work and I'll try and force
>>         it over the next week or so.  I just don't think it will be
>>         as nice and cushy as a native com solution that XSI is built
>>         to handle seamlessly.  But I could be wrong :)
>>
>>         And second (though maybe this is a given) none of this will
>>         work on linux as things currently sit.  Neither Mono nor
>>         Portable.net implement any kind of COM interop.  They do have
>>         PInvoke however, which is why wrapping the c++ api with SWIG
>>         was particularly interesting.
>>
>>         The atempt at using a hosted usercontrol was analagus to a
>>         ActiveX control... kinda.  Its really hard to tell what is
>>         going on under the hood.  Even microsoft documentation
>>         suggests that hosting a .net usercontrol via an OBJECT tag is
>>         infact ActiveX.  Other times it seems they're just saying its
>>         "like" ActiveX to the point that you code it the same.  But
>>         the whole thing is temporarily moot as a proper activex
>>         control is contained in a single .dll.  A .net usercontrol
>>         that is using com interop to talk to the XSI type library is
>>         two dlls.  So it wont work.  I thought about ripping the .cs
>>         file that the tlbimp tool generates and handhacking it into
>>         the assembly namespace so its all self contained in one dll.
>>         I have just not tried it yet.
>>
>>         This is all kinda in progress :)  Its nice to be a student on
>>         sabbatical.  You get to spin your wheels on crazy R&D
>>         projects for the sake of it.
>>
>>         -brad
>>
>>         kim aldis wrote:
>>
>>>         What about just creating ActiveX controls?
>>>
>>>             -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
-- ------
>>>             *From:* owner-xsi@(protected)
>>>             [mailto:owner-xsi@(protected)] *On Behalf Of *Brad
>>>             Friedman
>>>             *Sent:* 05 April 2005 12:51
>>>             *To:* XSI@(protected)
>>>             *Subject:* Re: IDE
>>>
>>>             As far as XSI integration goes:
>>>
>>>             have not had much luck.  clr languages on windows can
>>>             import COM type libraries and program to them.  That
>>>             part works fine.  But I've been unable to finish off the
>>>             loop as it were... getting XSI to call into a .net
>>>             assembly in any way.  My latest attempt involved
>>>             creating user controls to embed in netview pages (like
>>>             java applets or activex controls) but unfortunately it
>>>             turns out there are complications with multiple DLLs and
>>>             IE that makes it unreasonable.
>>>
>>>             I've also tried getting SWIG to wrap the XSI C++
>>>             interface in C#.  It was able to wrap a few header files
>>>             but the majority spat out errors and I decided I'm not
>>>             programmer enough to fix them.
>>>
>>>             I've not given up yet.  I still have a few tricks to try
>>>             out.
>>>
>>>             If I ever got XSI to work with c# I'd be the happiest
>>>             little coder...
>>>
>>>             -[kim aldis]  
>>>
>>
>


<!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">
Well my intention is to wrap it in an installer.&nbsp; There's an option to
register an assembly with com in an installer.&nbsp; Thats the pragmatic
answer.<br>
<br>
I'll have to check to be sure but I believe the regasm program is part
of the .net framework (.net runtime, rather than the .net SDK) and
therefor is installed on most updated windows machines already.&nbsp; So you
could write a script as part of the install process to call regasm
manually as well, if you don't have access to an installer that can do
this automatically for you.<br>
<br>
BTW, if you already know Java, there was a really good book from MS
press... something like "C# for Java Programmers."&nbsp; It was good to get
me up and running while skipping all the parts I already knew about
programming in general.&nbsp; Very quick read.&nbsp; And not so much Java
bashing
involved either.<br>
<br>
kim aldis wrote:
<blockquote
cite="mid200504060717.j367HHPm009778@(protected)"
type="cite">
 <title></title>
 <meta http-equiv="Content-Type" content="text/html; ">
 <meta content="MSHTML 6.00.2800.1106" name="GENERATOR">
 <div align="left" dir="ltr"><span class="609022707-06042005"><font
color="#0000ff" face="Arial" size="2">yeah, the codebase thing threw
up all sorts of warnings but basically it worked and I got to see the
message from callMe() in XSI. I'm spanky new to C# but I'm looking at
it because C++ has just too much crap surrounding it for someone who
only needs to fall back on it once a month or so. If you figure out the
correct way I'd like to hear.</font></span></div>
 <div align="left" dir="ltr"><span class="609022707-06042005"></span>&nbsp;<
/div>
 <div align="left" dir="ltr"><span class="609022707-06042005"><font
color="#0000ff" face="Arial" size="2">One question; how would one
register this on a machine that doesn't have c# installed?</font></span></div>
 <div align="left" dir="ltr"><span class="609022707-06042005"></span>&nbsp;<
/div>
 <div align="left" dir="ltr"><span class="609022707-06042005"></span>&nbsp;<
/div>
 <br>
 <blockquote
style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left:
5px; margin-right: 0px;">
   <div class="OutlookMessageHeader" align="left" dir="ltr"
lang="en-us">
   <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b>
<a class="moz-txt-link-abbreviated" href="mailto:owner-xsi@(protected)">owner
-xsi@(protected)</a> [<a class="moz-txt-link-freetext" href="mailto:owner-xsi
@(protected)">mailto:owner-xsi@(protected)</a>] <b>On Behalf
Of </b>Brad Friedman<br>
   <b>Sent:</b> 05 April 2005 23:28<br>
   <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:XSI@(protected)
.COM">XSI@(protected)</a><br>
   <b>Subject:</b> dotNet (was: IDE)<br>
   </font><br>
   </div>
nice.&nbsp; Thats pretty much what I was going to do.&nbsp; The only thing that
seems a tad off is the line:<br>
   <br>
   <span class="MsgViewAlternateBody">regasm AxComp.dll
/tlb:AxCompNet.dll /codebase<br>
   <br>
the filename specified after the ./tlb: should end with the extension
.tlb, not dll.&nbsp; You can roll a .tlb into a dll as a resource with
another command line app (forgot what its called).&nbsp; But its not
neccesary. And apparently the .tlb file is not all that important to
registering the typelib because... it works even though its got the
wrong extension :)<br>
   <br>
The only other thing that needs ironing out is the nonsense with the
/codebase flag.&nbsp; the docs from MS read:<br>
   <br>
Creates a Codebase entry in the registry. The Codebase entry specifies
the file path for an assembly that is not installed in the global
assembly cache. You should not specify this option if you will
subsequently install the assembly that you are registering into the
global assembly cache. The assemblyFile argument that you specify with
the /codebase option must be a strong-named assembly.<br>
   <br>
its not all that difficult to either install the assembly into the GAC
and skip the /codebase flag, or make the assembly strongly named.&nbsp; So I
doubt that will cause much of an issue down the line once you get to
installation issues.<br>
   <br>
I'm going to try giving this stuff a run in the next few days.&nbsp; If I
get a LogMessage("HelloXSIWorld") functioning from c# I'm sure you'll
hear from me :)<br>
   <br>
-brad<br>
   <br>
   <br>
   </span><br>
kim aldis wrote:
   <blockquote
cite="mid200504051723.j35HNSPm011017@(protected)"
type="cite">
     <meta content="MSHTML 6.00.2800.1106" name="GENERATOR">
     <div align="left" dir="ltr"><span class="390373417-05042005"><font
color="#0000ff" face="Arial" size="2">I tried this quickly and it works</font>
</span></div>
     <div align="left" dir="ltr"><span class="390373417-05042005"></span>&nbsp
;</div>
     <div align="left" dir="ltr"><span class="390373417-05042005"><font
color="#0000ff" face="Arial" size="2"><a
href="http://www.devhood.com/messages/message_view-2 (See http://iew-2.ora-code.com).aspx?thread_id=16569"
>http://www.devhood.com/messages/message_view-2 (See http://iew-2.ora-code.com).aspx?thread_id=16569</a></font><
/span></div>
     <div align="left" dir="ltr"><span class="390373417-05042005"></span>&nbsp
;</div>
     <div align="left" dir="ltr"><span class="390373417-05042005"><font
color="#0000ff" face="Arial" size="2">but like you say, it seems kind
of a specialised registration. That said, it's way shorter than the
messing around you need to do with C++; even if there's a bit of a
performance hit it's worth it just for how easy it is. I also kind of
like the idea I can just create a single file and compile from the CL.
Nice and simple. When I get time I'll be looking at it a bit closer.</font><
/span></div>
     <br>
     <blockquote
style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left:
5px; margin-right: 0px;">
       <div class="OutlookMessageHeader" align="left" dir="ltr"
lang="en-us">
       <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> <a
class="moz-txt-link-abbreviated" href="mailto:owner-xsi@(protected)">owner
-xsi@(protected)</a>
[<a class="moz-txt-link-freetext" href="mailto:owner-xsi@(protected)">mailto
:owner-xsi@(protected)</a>]
       <b>On Behalf Of </b>Brad Friedman<br>
       <b>Sent:</b> 05 April 2005 18:13<br>
       <b>To:</b> <a class="moz-txt-link-abbreviated"
href="mailto:XSI@(protected)">XSI@(protected)</a><br>
       <b>Subject:</b> Re: IDE<br>
       </font><br>
       </div>
Thats the tricky and confusing part.&nbsp; I'm going to try using the regasm
tool to register an assembly as a com type library next and see if that
will work.&nbsp; But my understanding is that the .net assembly will need to
be registered in the Global Assembly Cache (GAC) in order for it to
work.&nbsp; And it will need a strong name.&nbsp; I suspect this will work.
&nbsp; The
downside is that I doubt this will work with an xsi .addon install.&nbsp;
you'll need to install the .net assembly separate. Second, it wont
really work the same way XSI's execution environment is set up.&nbsp; XSI
likes to swap out com binaries via environment variables to make it
possible to run multiple versions of XSI side by side.&nbsp; It also lets
you put dlls in a workgroup and it handles registering them with com
seamlessly.&nbsp; But the way .net wants to do its com serving, it needs to
be global.&nbsp; You can't register .net assemblies with com using the usual
registration tools (the way XSI does it when you install an addon).&nbsp;
You have to use the regasm tool.&nbsp; I assume XSI doesn't do that itself.
&nbsp;
Though perhaps it should in the next version (nudge nudge wink wink).<br>
       <br>
I think its possible to make it work and I'll try and force it over the
next week or so.&nbsp; I just don't think it will be as nice and cushy as a
native com solution that XSI is built to handle seamlessly.&nbsp; But I
could be wrong :)<br>
       <br>
And second (though maybe this is a given) none of this will work on
linux as things currently sit.&nbsp; Neither Mono nor Portable.net implement
any kind of COM interop.&nbsp; They do have PInvoke however, which is why
wrapping the c++ api with SWIG was particularly interesting.<br>
       <br>
The atempt at using a hosted usercontrol was analagus to a ActiveX
control... kinda.&nbsp; Its really hard to tell what is going on under the
hood.&nbsp; Even microsoft documentation suggests that hosting a .net
usercontrol via an OBJECT tag is infact ActiveX.&nbsp; Other times it seems
they're just saying its "like" ActiveX to the point that you code it
the same.&nbsp; But the whole thing is temporarily moot as a proper activex
control is contained in a single .dll.&nbsp; A .net usercontrol that is
using com interop to talk to the XSI type library is two dlls.&nbsp; So it
wont work.&nbsp; I thought about ripping the .cs file that the tlbimp tool
generates and handhacking it into the assembly namespace so its all
self contained in one dll.&nbsp; I have just not tried it yet.<br>
       <br>
This is all kinda in progress :)&nbsp; Its nice to be a student on
sabbatical.&nbsp; You get to spin your wheels on crazy R&amp;D projects for
the sake of it.<br>
       <br>
-brad<br>
       <br>
kim aldis wrote:
       <blockquote
cite="mid200504051611.j35GB7Pm002759@(protected)"
type="cite">
         <meta content="MSHTML 6.00.2800.1106" name="GENERATOR">
         <div align="left" dir="ltr"><font color="#0000ff" face="Arial"
size="2"><span class="062092416-05042005">What about just creating
ActiveX controls?</span></font></div>
         <br>
         <blockquote
style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left:
5px; margin-right: 0px;">
           <div class="OutlookMessageHeader" align="left" dir="ltr"
lang="en-us">
           <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b>
           <a class="moz-txt-link-abbreviated"
href="mailto:owner-xsi@(protected)">owner-xsi@(protected)</a> [<a
class="moz-txt-link-freetext" href="mailto:owner-xsi@(protected)">mailto
:owner-xsi@(protected)</a>]
           <b>On Behalf Of </b>Brad Friedman<br>
           <b>Sent:</b> 05 April 2005 12:51<br>
           <b>To:</b> <a class="moz-txt-link-abbreviated"
href="mailto:XSI@(protected)">XSI@(protected)</a><br>
           <b>Subject:</b> Re: IDE<br>
           </font><br>
           </div>
As far as XSI integration goes:<br>
           <br>
have not had much luck.&nbsp; clr languages on windows can import COM type
libraries and program to them.&nbsp; That part works fine.&nbsp; But I've been
unable to finish off the loop as it were... getting XSI to call into a
.net assembly in any way.&nbsp; My latest attempt involved creating user
controls to embed in netview pages (like java applets or activex
controls) but unfortunately it turns out there are complications with
multiple DLLs and IE that makes it unreasonable.<br>
           <br>
I've also tried getting SWIG to wrap the XSI C++ interface in C#.&nbsp; It
was able to wrap a few header files but the majority spat out errors
and I decided I'm not programmer enough to fix them.<br>
           <br>
I've not given up yet.&nbsp; I still have a few tricks to try out.<br>
           <br>
If I ever got XSI to work with c# I'd be the happiest little coder...<br>
           <br>
-<span class="062092416-05042005"><font color="#0000ff" face="Arial"
size="2">[kim aldis]&nbsp;&nbsp;</font></span></blockquote>
       </blockquote>
       <br>
     </blockquote>
   </blockquote>
   <br>
 </blockquote>
</blockquote>
<br>
</body>
</html>