Thanks for the reply!

I broke down the errorhandling, and found out that it was the cast from XmlTextReader::Create(stm) that did not return an XmlTextReader, but another class inheriting from XmlReader. Just assigning it to a XmlReader pointer solved the problem!

Kind of off-topic, but since you seem to be a wiz, would you have any idea about this problem:

The program above works if I input an address to a XML-file. But if the address is to a server, which would have returned a XML-file if I pasted it into a web browser, this doesn't seem to work. For example:

In a web browser

http://api.arbetsformedlingen.se/pla...a/yrkesomraden

returns an XML-file.

In my program it returns (400) Bad Request.