CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    5

    Unhappy 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

  2. #2
    Join Date
    Sep 2009
    Posts
    23

    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.

  3. #3
    Join Date
    Apr 2010
    Posts
    5

    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.

  4. #4
    Join Date
    Sep 2009
    Posts
    23

    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
  •  





Click Here to Expand Forum to Full Width

Featured