Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing Object as parameter in c /CLI Wrapper Function to be exported to native Win32 dll
    primarykey
    data
    text
    <p>I've been working recently in COM interop thing.Read some Good books about it C++/CLI in Action By Nishant Shivakumar. I also went through this link by <a href="https://sites.google.com/site/srinivasnzd/csincppviacpp-cli" rel="nofollow">Srinivas</a> wherein he has explained beautifully how to Consume C# libraryin native C++ using C++/CLI.I downloaded the code present at the bottom of the page..Read it..And loved it.My application is loosely based on it. I have a question though in that example(which you can download it there). In C# Library "Worker.cs",If I have a method in the Worker class with a signature like this::</p> <pre><code>public void GetStudent(ManagedStudent student,int ){....} </code></pre> <p>FYI:: I need the object parameter because I would be accessing a method from that class in the Worker Class.</p> <p>In C++/CLI wrapper project, NativeInterface.h, I wanted to export a method which gets this managed object as a parameter unlike the example. </p> <pre><code>__declspec dllexport void GetStudent(ManagedStudent^ obj) </code></pre> <p><strong>What is the equivalent of an object in C++/CLI?</strong></p> <p>And later I want to access this method by importing this method by passing an object in my native Win32 Application/DLL. I am including the "NativeInterface.h" file in my native dll/App . But an error comes while building the dll/App..<strong>managed targeted code requires \clr option</strong>.</p> <p>FYI:: 1. My WIN32 dll/app is being compiled with no \clr support and my wrapper with \clr support 2. I believe the error comes because of the handle used as a parameter? I want to access UnmanagedStudent(Object obj) in native app/dll; Is that possible</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload