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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:28:42+00:00 2026-05-11T20:28:42+00:00

I am currently writing an application that will serve a similar purpose for multiple

  • 0

I am currently writing an application that will serve a similar purpose for multiple clients, but requires adaptations to how it will handle the data it is feed. In essence it will serve the same purpose, but hand out data totally differently.

So I decided to prodeed like this:
-Make common engine library that will hold the common functionalities of all ways and present the default interface ensuring that the different engines will respond the same way.
-Write a specific engine for each way of functioning….each one compiles into its own .dll.

So my project will end up with a bunch of libraries with some looking like this:
project_engine_base.dll
project_engine_way1.dll
project_engine_way2.dll

Now in the configuration file that we use for the user preferences there will an engine section so that we may decide which engine to use:

[ENGINE]
Way1

So somewhere in the code we will want to do:

If (this->M_ENGINE == "Way1")
  //load dll for way1
Else If (this->M_ENGINE == "Way2")
  //load dll for way2
Else
  //no engines selected...tell user to modify settings and restart application

The question is…How will I import my dll(s) this way? Is it even possible? If not can I get some suggestions on how to achieve a similar way of functioning?

I am aware I could just import all of the dlls right at the start and just choose which engine to use, but the idea was that I didn’t want to import too many engines for nothing and waste resources and we didn’t want to have to ship all of those dlls to our customers. One customer will use one engine another will use a different one. Some of our customer will use more than one possibly hence the reason why I wanted to externalize this and allow our users to use a configuration file for engine switching.

Any ideas?

EDIT:
Just realized that even though each of my engine would present the same interface if they are loaded dynamically at runtime and not all referenced in the project, my project would not compile. So I don’t have a choice but to include them all in my project don’t I?

That also means they all have to be shipped to my customers. The settings in the configuration would only dictate with class I would use to initialize my engine member.

OR

I could have each of these engines be compiled to the same name. Only import one dll in my main project and that particular engine would be used all the time. That would render my customers unable to use our application for multiple clients of their own. Unless they were willing to manually switch dlls. Yuck

Any suggestions?

EDIT #2:
At this point seeing my options, I could also juste make one big dll containing the base engine as well as all the child ones and my configuration to let the user chose. Instead of referencing multiple dlls and shipping them all. Just have one huge one and ship/reference that one only. I am not too fond of this either as it means shipping one big dll to all of my customers instead of just one or two small ones that suit there needs. This is still the best solution that I’ve come up with though.

I am still looking for better suggestions or answers to my original question.
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-11T20:28:42+00:00Added an answer on May 11, 2026 at 8:28 pm

    The solution I came to is the following:

    Engine_Base^  engine_for_app;
    Assembly^ SampleAssembly;
    Type^  engineType;
    
    if (this->M_ENGINE == "A")
    {
        SampleAssembly = Assembly::LoadFrom("path\\Engine_A.dll");
    
        engineType = SampleAssembly->GetType("Engine_A");
        engine_for_app = static_cast<Engine_Base^>(Activator::CreateInstance(engineType, param1, param2));
    }
    else
    {
        SampleAssembly = Assembly::LoadFrom("path\\Engine_B.dll");
    
        engineType = SampleAssembly->GetType("Engine_B");
        engine_for_app = static_cast<Engine_Base^>(Activator::CreateInstance(engineType, param1, param2, param3, param4));
    }
    

    I used the answer from Daniel and the comments that were made on his answer. After some extra research I came across the LoadFrom method.

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

Sidebar

Related Questions

At the office we are currently writing an application that will generate XML files
I am current writing an application that will require multiple inserts, updates and deletes
I am currently writing an application that will allow a user to install some
I am currently writing an application that needs to pull data from an XHTML
I'm currently writing an iPhone application that uses a UITabBarController with more than 5
I'm currently writing a C# application that does a lot of digital signal processing,
I'm writing an application that is currently a pure QT4 app. It is designed
I'm currently writing a data access layer for an application. The access layer makes
I'm currently writing a C#-class in my ASP.NET (3.5) application to handle all database-queries.
I'm currently writing a class to handle all database-activity in my application, and so

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.