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

  • SEARCH
  • Home
  • 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 3311392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:52:18+00:00 2026-05-17T21:52:18+00:00

I have a new problem with my C++ DLL… I have tried exporting the

  • 0

I have a new problem with my C++ DLL… I have tried exporting the entire class instead of only one method. But the program doesn’t want to compile now because of that the global scope has no GetUrl

Here is my “UrlConnector.h”:

#define ConnectMe __declspec( dllexport )

namespace ConnectHttps { class ConnectMe { void GetUrl(char *url, unsigned int bufferLength); }; }



and here is the part of my UrlConnector.cpp that isn’t compiling:

#include "UrlConnector.h"
#include "MyConnectionClass.h"
#include 
using namespace std;

namespace ConnectHttps { void ConnectMe::GetUrl(char* url, unsigned bufferLength) { MyConnectionClass initSec; string response = initSec.GetResult(); strncpy_s(url, bufferLength, response.c_str(), response.length()); } }


Now, I would like to be able to create an DLL from this, and I would like to make a test program to call the class and the method GetUrl from a dll. I’m using Visual Studio 2010 with Visual C++ DLL.

I’ve also managed to read this from the MSDN and this tutorial as well, but I just can’t seem to get it to work!
I would really appreciate any help!

  • 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-17T21:52:18+00:00Added an answer on May 17, 2026 at 9:52 pm

    Unless I’m mistaken, you don’t seem to be giving your class a name.
    You made ConnectMe not a class name but a macro to export your class, but your class should have a name

    Maybe try

    #define EXPORT_IT __declspec( dllexport )
    
    namespace ConnectHttps
    {
        class EXPORT_IT ConnectMe
        {
            void GetUrl(char *url, unsigned int bufferLength);
        };
    }
    

    Also I’m not 100% sure of this because I don’t have access to a compiler at the moment, but typing:

    namespace ConnectHttps {
        ...
    }
    

    In your .cpp file isn’t correct. Instead you should have:

    void ConnectHttps::ConnectMe::GetUrl(char* url, unsigned bufferLength)
    {
        MyConnectionClass initSec;
        string response = initSec.GetResult();
        strncpy_s(url, bufferLength, response.c_str(), response.length());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have new problem. My code: .method public static void Main() cil managed {
I have the problem I just installed the new Monodevelop 2.2.2 on Windows but
I am new to C# programming and I have a problem with dll creation.
I have similiar problem as was presented here , but with opencv_imgproc231.dll (opencv_core231.dll is
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I am having a new little problem; I have a little pointer called: int
I'm new to Vim (almost new) and have some questions. The problem came from
i have a problem to add a new attribute to an existing html string.
I have some problem with my open new window popup which it can read
I have a problem in running a new project which I downloaded from github.

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.