Re: Create C# objects from C++

Robert Jordan <[email protected]>
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <[email protected]>
On 15.03.2017 21:56, howard.rubin wrote:
> Some of the APIs I'm calling from C++ take C# objects, like
> System.Drawing.PointF and System.IO.UnmanagedMemoryStream . I can create
> them like below but I'd like to eliminate the hard coded paths to the .NET
> DLLs.
>
> Is it possible to reference the already loaded assembly or find the path to
> the on-disk assembly or create the objects differently? How can I do that?


Use the mono_assembly_load APIs. Either those which take a
MonoAssemblyName argument or mono_assembly_load_with_partial_name
which takes an (partial) assembly name specified by a string.

You may want to look up "assembly name" on MSDN. E.g, the
shortest assembly name of System.Drawing.dll is

"System.Drawing"

which you can pass to mono_assembly_load_with_partial_name (),
and call it a day.

Robert


_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.dot.net/mailman/listinfo/mono-devel-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.