开发者

C++ Reads/Writes XML without CLR

I know this is a very 开发者_Go百科stupid question and I'm very new to C++.

I'm developing Starcraft AI, it is DLL file. I'm trying to use XML to gather some data to the bot, however whenever I build the DLL with /clr option. The bot doesn't load properly. So, my question is what is CLR and is there a way to read/write XML without using /clr build option.

Thanks so much.


The /clr flag means that you're building it as a C++/CLI app which means that it'll be managed code (using the the .Net framework etc). See here for more information.

You probably want to do native code so I'd suggest that you use something like MSXml or Xerces XML library to read the XML and make sure that you don't use any .Net classes. There's probably other XML libraries, but those are the only two I've used from C++.


If you want to use Microsoft's solution and you are familiar with COM interfaces, you can try MSXML. As an easy to use open-source alternative I'd recommend libxml2 (I use it in some of my Windows apps and find it satisfying).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜