How to call functions in another namespace from a dll

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have a WinFrom solution with variouse forms and classes. Lets name the
namespace to <MyTest01>.

I've developed a dll <statistics>. The dll <statistics> needs to reach some
of the classes/functions in <MyTest01>. An example:

<MyTest01> holds a class called <clsCalculations>. this class holds a
public functions called <calculate_MyScore> returning an integer.

How can the dll <Statistics> reach the function <calculate_MyScore> ???

From before the the dll is a part of the <MyTest01> references.

Appreciate any help
Best regards
Hans Årsjö
 
When you want to call a class in another library
you should reference that library in the dll you are calling from
click References, click Add, click Projects, double click the dll to be
consulted
in the class that is doing the calling you shoud have "using" whatever; at
the top
Hope this is the info you were after.
Adrian.
 
Hi Adrian!

Thank you for your reply. I'm sorry I didn't made my self clearly.
It isn't another library it is a windows application called MyTest01.exe

/Hans
 
Well, after shared libraries we can have shared executables too.
Just add the reference to the exe, and press CTRL+W+J.
 
Hi Hans,
Unless I have misunderstood you, I can't help feeling there is a fundamental
design problem here.
The DLL should be self contained and any interaction should be achievable
through its input and output parameters.
The function in the form (calculate_myscore) that the DLL would like to use
should be in the DLL. Anything on the form that wants to use the function
should access the DLL otherwise you are coupling the DLL to the form.
In which case why have a DLL at all?
regards
Bob
 
Hi bob!

Your reply is the answer on my problem and comming challenges. Thank you

Best regards
Hans Årsjö
 
Back
Top