Referencing Additional Components from a Managed Application
At various times, a managed application will need to reference other managed components. The TilePuzzle sample demonstrates this concept by referencing two other managed projects in the same solution. TilePuzzle adds these references to additional managed projects (using the following procedure) from the
To add additional managed components to a managed solution
- Load your managed solution into Visual Studio.
- In Solution Explorer, right-click the project node that needs to reference additional components.
- On the shortcut menu, click Properties.
The Property Pages dialog box appears.
- In the left pane, click the C/C++ folder.
- Click the General folder under C/C++.
- In the Resolve #using References edit box, add all paths to any managed DLLs you reference from your managed project.
- Click OK.
Note Once you make these changes to the project, there is no need to specify the absolute path for any #using statements in your project.
In addition to this procedure, you can also construct a pre-build event that copies any referenced DLLs to the same directory containing the .exe file of your Managed Extensions for C++ application. For more information, see Specifying Build Events.