开发者

Using DotnetZip with Visual Studio C++/CLR

I tried to use DotNetZip with C++/CLR B开发者_JAVA百科ut I found everyfile i downloaded contain no .h file, in the example code, there is "using namespace Ionic::Zip;"

How can I get that to work in my code?


You need to add a reference to the DotnetZip DLL. Once the reference to the DLL is added the compiler will process the metadata in the DLL and make the types and methods available to you in the same way it does by processing a header file. To add a reference do the following

  • Right click on the project in "Solution Explorer" and select "References"
  • Click the "Add New Reference" button
  • Select the "Browse" tab and navigate to the DotnetZip DLL


Another solution that don't need to use Visual Studio GUI is to add directly a #using directive in each CPP source file that uses Ionix.zip.

Example:

#using <Ionic.Zip.dll>

using namespace Ionic::Zip;

If using namespace is not used, #using is interesting to document which sources are using Ionix.Zip. If using namespace is used, it is more interesting to put this directive in Project's reference as proposed by JaredPar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜