0

I have a Windows app that is sending string and float data to a class via a public property. The same DLL assembly is loaded into Maxscript (3dsmax) while the Windows app is running. I would expect that if I try to access a class property, that I'd get in both apps the same data but it's not. Apparently, the data is being passed to and from the instanced class at runtime but when the same data is accessed by Maxscript, the data is undefined.

The Windows app is creating an instance of the class. Maxscript is "loading the assembly" as a dotNetObject. Is is the data being sent/received by the Windows app only being done so in the local instance and not in the myClass.dll file itself? I know it's possible to interface a C# application with 3dsmax via Maxscript at runtime. Anyone help explain what might be wrong here?

JohnMills
  • 3
  • 1
  • 1
    `I would expect that if I try to access a class property` your assumption is wrong, just because the same .Net assembly is loaded in different processes does not mean they share data. They are independent and in a different address space – TheGeneral Jan 12 '19 at 17:00
  • @TheGeneral Thanks for clearing that up. I'm not trying to just access the property like you would in the same app. I do have a callback structure in place for both apps. I need to learn more basics about sharing data between apps but I don't know where to start looking. – JohnMills Jan 12 '19 at 17:03
  • [What is the simplest method of inter-process communication between 2 C# processes?](https://stackoverflow.com/questions/528652/what-is-the-simplest-method-of-inter-process-communication-between-2-c-sharp-pro) – TheGeneral Jan 12 '19 at 17:05
  • @TheGeneral Thanks! – JohnMills Jan 12 '19 at 17:06
  • Inter-Process communication (IPC) is what you want to research – TheGeneral Jan 12 '19 at 17:09

1 Answers1

0

Windows Communication Foundation also called WCF is a great API to use. I successfully used it when I worked for AutoDesk on 3dsmax. I used it to send maxscript commands to the app (i.e. 3dsmax) to drive automation testing.

Last but not least, the comment above from 'TheGeneral' is entirely correct.

If you want a more 'native' way to share data between processes, then I'd suggest using memory maps. https://learn.microsoft.com/en-us/windows/desktop/memory/file-mapping

C.J.
  • 15,637
  • 9
  • 61
  • 77
  • The functionality to send maxscript commands to 3dsmax is still in the product, and has been in place for at least the last 6 years. I'll see if I can find some documentation for it. – C.J. Jan 30 '19 at 17:11