473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C++ CLI - Candidate functions not accessible with STL

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

Jan 20 '06 #1
0 1253

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Adriano Coser | last post by:
I'm getting the following error: error C3767: PictureSource - candidate function(s) not accessible when accessing a public member function of a managed class, either from managed or unmanaged...
3
by: Steve Jaworski | last post by:
Using VS2005Beta 2 I have VC++/CLI class defined in a Class Library DLL as: #foo.h namespace foo { public ref class Convert { public: static Obj^ ToObj(UnmanagedObj* uObj);
1
by: teds | last post by:
Hi, As a newbie to .Net, I am interested in wrapping a library's C functions to be accessible from .Net. These C functions take strings as input and output parameters and may reallocate strings...
0
by: Edward Diener | last post by:
When trying to call a __gc class static function in an assembly which has CLR and non-CLR types in its signature, I get a Candidate function(s) not accessible error. In an assembly, using...
1
by: Wolfgang | last post by:
Hi all, I've started to write some functions but I have some problems with common variables in that functions. So I have some variables which should be accessible by all my functions but not...
2
by: ajtaylor | last post by:
Hello, Sorry another question on mixed code assemblys. I have a static class library containing a lot of unmanged code. I have created a mixed code assembly which I am attempting to use in a...
2
by: Iwanow | last post by:
Hello! I have a single class without any inheritance over there, and I get that error on its constructor which is an empty function: LabelProcessor::LabelProcessor() { } The full error...
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
11
by: Nadeem | last post by:
Hello all, I'm trying to write a function that will dynamically generate other functions via exec. I then want to be able to import the file (module) containing this function and use it in other...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.