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 6642705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:57:45+00:00 2026-05-25T23:57:45+00:00

This question is an extension of a previous question: Return an object in VBA

  • 0

This question is an extension of a previous question: Return an object in VBA

Now, I’d like to know how to declare and initialize the object in VBA. It seems like I’d do it like so:

Declare Function ConnectMe Lib "C:\Windows\System32\cm.dll" (ByVal Arg1 As String) As ConnectMe
Declare Function login Lib "C:\Windows\System32\cm.dll" (ByVal Arg1 As String, ByVal Arg2 As String) As Boolean

Then, below this line, I could use this code:

dim cm as new ConnectMe

cm.ConnectMe("216.239.51.99")

cm.login("username","password")

However, when I do this, it gives me a “User-defined type not defined” error. How can I declare this C++ class appropriately so that I can create and use an instance in VBA?

Thanks.

  • 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-25T23:57:45+00:00Added an answer on May 25, 2026 at 11:57 pm

    This code is never going to work as it is. If you want to create a class in C++ under Windows and use it in any other programming language that is not C++, (VB for example) the “normal” approach is to create a COM class or an ActiveX control if you need to draw graphics.

    You may also find this answer in SO helpful.

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

Sidebar

Related Questions

this question is an extension to a previous question i asked (and was answered).
Hello every one this is extension to my previous question.Here is the link File
This is an extension of a previous question I asked. I ran into some
This is an extension to a previous question which was answered. But have a
(Note: This is an extension of a previous question .) I am having some
This is a question that is an extension of my previous Free 3 of
This is an extension of my previous question, Application crash with no explanation .
As an extension to my previous question , I would like to automatically select
this is an extension to a previous question I asked , today .... which
this question is an extension of my previous question that you can find here:

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.