-
April 20th, 2010, 02:29 PM
#1
Error C3767 Visual Studio
Hi, I have written a small dll with the /clr option that contains the following:
base.h
typedef cliext::map<String^, UInt16> CommandMap;
typedef cliext::list<String^> CommandList;
---------------------------------------------------------------------
base.cpp
public: CommandMap^ GetOpCodesMap() { return OpCodesMap; }
public: CommandList^ GetOpCodesList() { return OpCodesList; }
However from the client when I use the 'getters' above, I get the C3767 error during the build saying:
Error 1 error C3767: 'ATA::ATA_Core::GetOpCodesMap': candidate function(s) not accessible c:\documents and settings\my documents\visual studio 2010\projects\ata_base\ata_gui\Form1.h 30 1 ATA_Gui
I looked at the MSDN article on the error, but wasn't very helpful to me.
I've always thought just by writing a getter you could access private data.
I just don't understand where I am going wrong.
TY
-
April 27th, 2010, 11:24 PM
#2
Re: Error C3767 Visual Studio
Hello. According to MSDN article
http://msdn.microsoft.com/en-us/libr...t(VS.80).aspx:
"
Another thing that seems to generate this error is using a native type in the signature of a public method, and then trying to call that method from a different assembly.
The solution here is to add a #pragma make_public on the native type, after defining the native type but before defining the managed method that uses it. The docs for #pragma make_public imply you're supposed to get a compiler warning when a non-public native type is exposed by a public managed type, but (at least with the default warning levels) that does not seem to be the case.
"
As far as I understand 'cliext' - kind of STL version for CLI, but it still can be native + Core components seems to be in another asembly than Form1.h so this notice can be aplicable to your situation.
-
May 1st, 2010, 06:10 AM
#3
Re: Error C3767 Visual Studio
Sorry for the delay. I appreciate your response and I really should get back to that personal project in which I want to send commands to the hard drive itself (I am hoping to get deeper into data recovery/forensics).
I enjoy C#, I guess I underestimated some of the difficulty in learning it's C++.net counterpart.
TY.
-
May 1st, 2010, 07:10 PM
#4
Re: Error C3767 Visual Studio
I look at C++/CLI as a smart wrapper provider for native code that you want to use in C#. From my point of view C++/CLI is powerful but it extend complexity of C++ itself. It is good language but for specific goals. Assembler/C/C++/CLI/C# is great combination that allows to do whatever you want to do using smartly all layers you required.
Good luck in your work!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|