Author Topic: .NET mix managed code support  (Read 7943 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7054
  • AKA Daniel
.NET mix managed code support
« on: November 01, 2006, 12:29:11 PM »
When setting up a new ObjectARX project and using the wizards there is an option for  .NET mix managed code support. I see this on both VS2002 and VS2005. What is this used for? Why would one choose this option?  I am just doing research on ObjectARX so any information would be helpful. 

Thanks a Ton
Daniel

LE

  • Guest
Re: .NET mix managed code support
« Reply #1 on: November 01, 2006, 01:09:37 PM »
Yes;

I have seen it, but not used that option, I guess you need to do a search about this, into the adesk ARX and find out what Cyrille Fauvel has posted about it (.net mixed managed code support).

HTH

Draftek

  • Water Moccasin
  • Posts: 1501
Re: .NET mix managed code support
« Reply #2 on: November 01, 2006, 01:15:40 PM »
You can wrap your object (or code) so it's exposed to .net basically making it a managed class.

I suspect that's exactly how the objectarx .net managed classes were created.
Soli Deo Gloria

MickD

  • Gator
  • Posts: 3471
  • (x-in)->[process]->(y-out)
Re: .NET mix managed code support
« Reply #3 on: November 01, 2006, 02:38:21 PM »
basically what Draftek said above, you can wrap existing classes or functions into managed classes for use with .net.
You can also call native code from your managed classes (this is how you wrap them after all), say you want to use winforms in mc++, you can call native functions from event handlers say all in the same module.
If you want to study up more on this have a search in the help doc's for 'It Just Works', this was done for this very reason, to integrate and help port existing native code into managed code.
There should also be a sample mixed arx project in the help I think, maybe if you include the necessary file you can do a 'go to definition/declaration' and see how some marshaling is being handled.
hth.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: ďTo attain knowledge, add things
every day; to obtain wisdom, remove things every day.Ē

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7054
  • AKA Daniel
Re: .NET mix managed code support
« Reply #4 on: November 04, 2006, 12:34:19 PM »
Thanks for the replies. It does seem the main purpose is for porting applications. I just wanted to know if could have the best of both worlds As Mick touched on using winforms.

Thanks

Nikolay Poleshchuk

  • Mosquito
  • Posts: 10
Re: .NET mix managed code support
« Reply #5 on: November 08, 2006, 12:58:15 AM »
Here is an example of .NET mixed mode support for using Windows Forms in C++ (ARX): http://poleshchuk.spb.ru/cad/2006/TrSplashe.htm
You can download sample projects from http://poleshchuk.spb.ru/cad/Downloade.htm
The sample application creates temporary splash screen window.

Chuck Gabriel

  • Guest
Re: .NET mix managed code support
« Reply #6 on: November 08, 2006, 07:54:51 AM »
Welcome to the swamp Nikolay.

LE

  • Guest
Re: .NET mix managed code support
« Reply #7 on: November 08, 2006, 09:13:17 AM »
Welcome to the swamp Nikolay.

Ditto ^^ x 2

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7054
  • AKA Daniel
Re: .NET mix managed code support
« Reply #8 on: November 08, 2006, 12:23:04 PM »
Hey thatís fantastic. I will have to study the samples :)
Welcome to the Swamp Nikolay! Hey youíre the author!
Where can I buy your books? I canít read Russian but I can learn from the examples 

Daniel

Edit I need to learn to spell too /edit
« Last Edit: November 08, 2006, 01:04:07 PM by Danielm103 »

Nikolay Poleshchuk

  • Mosquito
  • Posts: 10
Re: .NET mix managed code support
« Reply #9 on: November 08, 2006, 12:52:37 PM »
Hey thatís fantastic. I will have to study the samples :)
Welcome to the Swamp Nikolay! Hey youíre the author!
Where can I by your books? I canít read Russian I can learn from the examples 

Daniel
Hi friends! Thank you.
Daniel, you can buy my books in the Russian Internet shop: http://www.ozon.ru/english

mjguzik

  • Newt
  • Posts: 30
Re: .NET mix managed code support
« Reply #10 on: November 20, 2006, 08:18:46 PM »
One thing that I haven't been able to overcome with .net is using winforms from a network share.  Everything from the autocad command prompt works fine from a share, yet introduce a winform and you get prompted for security.  Therefore it will have to be a local or on a trusted share.  Otherwise it seems much more powerful than lisp and VBA.  Just my two cents.

Nikolay Poleshchuk

  • Mosquito
  • Posts: 10
Re: .NET mix managed code support
« Reply #11 on: November 21, 2006, 02:16:20 AM »
Everything from the autocad command prompt works fine from a share, yet introduce a winform and you get prompted for security. 

Yes, I found this problem too.

Chuck Gabriel

  • Guest
Re: .NET mix managed code support
« Reply #12 on: November 21, 2006, 08:02:45 AM »
One thing that I haven't been able to overcome with .net is using winforms from a network share.  Everything from the autocad command prompt works fine from a share, yet introduce a winform and you get prompted for security.  Therefore it will have to be a local or on a trusted share.  Otherwise it seems much more powerful than lisp and VBA.  Just my two cents.

Look in Control Panel -> Administrative Tools.  There should be a .NET Framework Configuration control panel in there.  Open it and browse down to "Runtime Security Policy."  Click on "Adjust Zone Security."  Select whether you want your changes to apply to the local machine or the current user.  In the next dialog, select "Local Intranet," and set the trust level to "Full Trust."

Now any assembly loaded from a share on the LAN (or a web page on your Intranet) will have the same security privileges as if it were located on your local machine.

[edit]
Now that I've written all that out and re-read your original post, I think I probably haven't told you anything you didn't already know.
[/edit]
« Last Edit: November 21, 2006, 08:05:18 AM by Chuck Gabriel »

Aerdvark

  • Guest
Re: .NET mix managed code support
« Reply #13 on: June 01, 2010, 07:52:20 AM »
Here is an example of .NET mixed mode support for using Windows Forms in C++ (ARX): http://poleshchuk.spb.ru/cad/2006/TrSplashe.htm
You can download sample projects from http://poleshchuk.spb.ru/cad/Downloade.htm
The sample application creates temporary splash screen window.

I know this is an old topic, but since it appears on top of the list, when I reply to it, and it is all new to me I guessed it would be no problem to post...

The link (above to Nikolays code) got my attention. I like the idea of creating a splash screen of my own. Leave AutoCAD's splas screen as it is but once the program is loaded, it would be nice to show a custom splash screen "Aerdvark" for I made a lot of menu's in AutoCAD. This would give a nice personal touch for me.

But anyway, there is so much that I do not get, the real basic stuff on C# / C++ / VB.NET etc.

Is somebody interested in helping me to understand the code or maybe to help me create what I need? My goal in the end would be as I said: a personal splash screen. Not too Difficult.... like the transparent green one but with my text in there "Aerdvark".

THanks in advance for those who are willing to help me out.
« Last Edit: June 01, 2010, 07:55:43 AM by Aerdvark »

Nikolay Poleshchuk

  • Mosquito
  • Posts: 10
Re: .NET mix managed code support
« Reply #14 on: June 01, 2010, 09:01:10 AM »
Replace the line in Splash16.cpp:

pTxt1->Text = S"Book16";

to

pTxt1->Text = S"Aerdvark";