Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>(This may come 3 years late, but it still shows up near the top on a google search, and the information is still valid today as it was 3 years ago).</p> <p>First, yes you are correct, with C++/CLI you don't use .h files EXCEPT for native C++ classes, structures, etc.</p> <p>The first question that may come to mind is how do I reference my class if I don't <code>#include "someheader.h"</code> file? There are two answers to this: 1) for classes OUTSIDE your project; 2) for classes WITHIN you project.</p> <p>1) Add a reference to the .DLL (or to another project within the solution) in your .VCPROJ (Common Properties / Framework and References in the project property pages). </p> <p>2) Add a <code>#using otherclass.obj</code>, thats right #using on an object file! </p> <p>Within your project, assuming each class has its own source file, when you want to reference it in another class we make use of the <code>#using "a_compiled_file"</code> which can be a .dll or a .obj file. </p> <p>In your Project Property Pages, under the C/C++ / General you will see: Resolve #using References, just add the MACRO string <code>$(IntDir)</code>. This resolves to the intermediate directory for compiled source code.</p> <p>The compiler reads the metadata within the .obj file (just like the metadata within a .dll file) and uses that for all the information it needs, no .h header file!</p> <p>We do this because the C++/CLI compiler is TOO STUPID to remember our classes within the same project the way the C# compiler does.</p> <p>NOTE: you may run in to <strong>sharing violations</strong> when using <code>$(IntDir)</code>, in which case, pre-compile the files and put them in their own directory. The compiler nedds ONLY the meta data, so unless you are changing the class structure (think of .h stuff) it doesn't need to be compiled every time.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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