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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:52:23+00:00 2026-05-30T14:52:23+00:00

I have written a code in native C++ for a computationally expensive numerical analysis

  • 0

I have written a code in native C++ for a computationally expensive numerical analysis so program speed is a important factor. I would like to develop a GUI for a simple input instead of using a console version. I have very little experience with GUI development, but a Visual C++ Windows Forms seems easy enough with it is graphical interface. The problem is that writing the back-end of my code in managed CLR slows down the code by a factor of 3 which is of course a big factor. So i am wondering if it is possible to create a native dll from my unmanaged code and include it with the GUI developed with Windows Forms. Basically the calculations will be done by the native library will handle the computations and the front end is the Windows form created with managed code. This way the speed factor is not changed
I think I should be able to do that. However, i did not find much information on that on the net like the steps involved and the correct syntax (I am not too good with visual studio, i typically use GCC to compile my code).
The following is a sample C++ class that solves a quadratic equation, . I guess the obvious questions, does the dll have to be built a certain way, how do you include it in a project, how do you pass the parameters to the dll and call the functions…

#include <cmath>

using namespace std;

class QuadraticEquation  // ax^2+bx+c=0
{
 public:
QuadraticEquation();
void set(double A, double B, double C); //mutator function
void solve();
double get1stRoot(); //accessor function for first solution
double get2ndRoot(); //accessor function for second solution
 private:
double a; 
double b;
double c;
double x1; // first solution
double x2; // second solution
 };

 QuadraticEquation::QuadraticEquation()
 {
a = 0, b = 0, c = 0, x1 = 0, x2 = 0;
 }


 void QuadraticEquation::set(double A, double B, double C)
 {
a = A, b = B, c = C;
 }


 void QuadraticEquation::solve() // member function to solve the equation
 {
double D = pow(b, 2.0) - 4 * a * c;
if(D>=0) // only then we get real solutions and not imginary ones
    x1 = (-b + sqrt(D)) / (2*a), x1 = (-b - sqrt(D)) / (2*a);
 }

 double QuadraticEquation::get1stRoot()
 {
return x1;
 }

 double QuadraticEquation::get2ndRoot()
 {
return x2;
 }

Thanks in advance

  • 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-30T14:52:24+00:00Added an answer on May 30, 2026 at 2:52 pm

    Last time i worked with windows Forms, i had a hell of a time using dll’s. You can include them with your project, and access them, but my experience doing so was not pleasant. That’s all i got

    [edit]
    i believe the answer to your question is yes, you can access a dll file of your own creation or whatnot. And from what i know, it doesnt have to be built a certain way.

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

Sidebar

Related Questions

Using the ndk I have compiled a code written in C. The program is
I have an application written in native C++ which I'd like to get running
I have an application which is mostly native code written in C: Simon Tatham's
Suppose I have an application written in native C++ (over 500k lines of code)
I have written code that automatically creates CSS sprites based on the IMG tags
I have written code that opens 16 figures at once. Currently, they all open
I have written code in Java to access web cam,and to save image... I
I have written some code in my VB.NET application to send an HTML e-mail
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file
I have written some code for playing a .wav through my application. Now I

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.