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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:44:11+00:00 2026-06-13T18:44:11+00:00

I currently have a dll which helps me with some operations, and i would

  • 0

I currently have a dll which helps me with some operations, and i would like that my dll can modify a variable of the main thread. Do I somehow send the class(the variable has a typename of a class) to the dll, should i also make the dll include the file where the class is defined(.h file).

So basically, how can i make a dll modify a variable from another thread(In this case, the main thread)?

Edit:

The variable i want to change is like this:

Group< UMesh > InstancedMesh

Group is a template class and UMesh is another class.

  • 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-06-13T18:44:12+00:00Added an answer on June 13, 2026 at 6:44 pm

    Do I somehow send the class(the variable has a typename of a class) to
    the dll, should i also make the dll include the file where the class
    is defined(.h file).

    No, you shall not make your library depends on some application type. How this library would be then usable for other applications?


    Your library shall only accept objects of types known to this library.

    So, you have the type in your application:

    template <class T>
    class Group;
    

    And you want some library function accepting objects of this type.

    There are two typical solutions:

    First solution, let name it ObjectOriented solution, Make an interface in your library and function accepting objects implementing this interface:

    class SomInterface {
    public:
      virtual void foo1() = 0;
      virtual void foo2() = 0;
    };
    
    void doSomething(SomeInterface& object);
    

    Then to use doSomething in your application, either your class shall derive from this interface:

    template <class T>
    class Group : public SomeInteface {
    public:
      virtual void foo1() {...}
      virtual void foo2() {...}
    };
    Group<UMesh> object;
    doSomething(object);
    

    Or (I prefer this) make an adapter from your class to this interface:

    template <class T>
    class GroupSomeInterface : public SomeInteface {
    public:
      GroupSomeInterface(Group<UMesh& object) : object(object) {}
      virtual void foo1() {...}
      virtual void foo2() {...}
    private:
      Group<UMesh& object;
    };
    Group<UMesh> object;
    GroupSomeInterface<UMesh> adapter(object);
    doSomething(adapter);
    

    Second solution, let name it generic solution, Since you have template class, it should be better for this particular case. Make a function template in your library accepting any type of some interface:

    template <class T>
    void doSomething(T& object);
    Group<UMesh> object;
    doSomething(object);
    

    If your Group<T> does not have the interface this method requires, then make an adapter like in first solution – but this time without explicit interface class and with no virtualism:

    template <class T>
    class GroupSomeInterface  {
    public:
      GroupSomeInterface(Group<UMesh& object) : object(object) {}
      void foo1() {...}
      void foo2() {...}
    private:
      Group<UMesh& object;
    };
    Group<UMesh> object;
    GroupSomeInterface<UMesh> adapter(object);
    doSomething(adapter);
    

    BTW, by object interface I mean all its public functions and all global functions operating on this object (like operator << (ostream,Object) for example)

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

Sidebar

Related Questions

Currently have password protection on my main and sub directories, however I'd like to
Good afternoon, i am currently wrestling with an old .dll which functionality I have
I have a DLL which takes care of custom drawing for some special glass
I have an unmanaged DLL which I'm currently calling from C# using a COM
I have a WPF application which is hooking into a DLL that I am
Currently have a drop down menu that is activated on a hover (from display:none
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
I currently have a table of concentrations, which are linked to a table of
I currently have one project that currently contains multiple packages. These packages make up
I currently have a deployed app (fortworth.herokuapp.com) that I am attempting to sort movies

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.