C++ CLI - Candidate functions not accessible with STL

  • Thread starter Thread starter quortex
  • Start date Start date
Q

quortex

Hey,

I have a problem which I have no clue how to fix. I am using the CLI
and some of the ref class constructors require a native type to be
passed in.

Obviously because the 2005 CLI now imports types by default as private
rather than public we need to specify these types as public in the
appropriate source files with

#pragma make_public.

This has been fine up until now however I have some functions that take
STL strings as parameters (for example). I receive candidate functions
not accessible on these, here is an example method, no implementation
provided as I dont think it's relevant:

String^ Interop::MarshalString(std::string& src)

Now I have played around with this and the candidate functions not
accesible error is for the std::string. Problem is that #pragma
make_public does not work with templates.

How do I get round this? I must be missing something simple, obviously
if I put the entire class in a header file and include the header
rather than using the metadata then it works fine but I don't really
want to do this as it's a bit hacky.

Any ideas?

Kind Regards,
Mark
 
Back
Top