Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4000570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:47:52+00:00 2026-05-20T07:47:52+00:00

I’m testing a simple DLL, I wrote using C++/CLI, in a CLR console application.

  • 0

I’m testing a simple DLL, I wrote using C++/CLI, in a CLR console application. The DLL has only one function I’m trying to use. I’m referencing the DLL and set the Resolve #using Reference in the project property page, but I cannot see the function I wrote. I’m guessing I may have missed an access modifier somewhere, but I’m not sure. Here is a breakdown of my code:

DLL Code Header:

// LogDLL.h

#pragma once
#using <mscorlib.dll>
using namespace System;


namespace LogDLL {

    public ref class LogFuncs
    {
        // TODO: Add your methods for this class here.
        LogFuncs(){;};
        ~LogFuncs(){;};
        void log_to_file ( System::String ^file, bool overwrite, System::String ^text );
    };
}

DLL Code Source:

#include "stdafx.h"
#include "LogDLL.h"
using namespace System::Globalization;

void LogDLL::LogFuncs::log_to_file ( System::String ^file, bool overwrite, System::String ^text )
{
    //Do Stuff
}

And the test code I’m using:

#include "stdafx.h"
#using <LogDLL.dll>
using namespace System;

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    LogDLL::LogFuncs^ a;
    a::LogDLL::LogFuncs:: //<-- Intellisense doesn't show the function from the DLL
    return 0;
}

Again, I’m not sure what I’m missing. It’s been awhile since I’ve worked with C++/CLI so I’m pretty rusty.

UPDATE:

I went ahead and changed the class to a struct per Peter’s advice.

Modified DLL Header Code:

// LogDLL.h

#pragma once
#using <mscorlib.dll>
using namespace System;


namespace LogDLL {

    public ref struct LogFuncs
    {
        // TODO: Add your methods for this class here.
        LogFuncs(){;};
        ~LogFuncs(){;};
        void log_to_file ( System::String ^file, bool overwrite, System::String ^text );
    };
}

What I still don’t understand is why the class would still default to private even though I specify it as public. Is there some fundamental reason why this is the case? Would it be any different if I was using unmanaged C++??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:47:53+00:00Added an answer on May 20, 2026 at 7:47 am

    The default access for class is private. Either add “public:” for the members you want to be public or change to a ref struct, which has default access of public.

    With respect to IntelliSense, I’m assuming you’re using Visual Studio 2005 or Visual Studio 2008; Visual Studio 2010 does not support IntelliSense for C++/CLI code (this is because the parser was replaced with EDG and they didn’t retrofit the C++/CLI parsing capabilities into it for 2010’s release).

    I doubt IntelliSense would auto-complete with the syntax you’re using anyway. You’d want “a->” instead (of course, gcnew it before running this code).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.