473,411 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to call functions in another namespace from a dll

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 <statisticsneeds to reach some
of the classes/functions in <MyTest01>. An example:

<MyTest01holds a class called <clsCalculations>. this class holds a
public functions called <calculate_MyScorereturning an integer.

How can the dll <Statisticsreach the function <calculate_MyScore???

From before the the dll is a part of the <MyTest01references.

Appreciate any help
Best regards
Hans Årsjö
Mar 2 '07 #1
7 2588
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.
Mar 2 '07 #2
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

"Adrian <" wrote:
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.
Mar 2 '07 #3
In your Visual Studio Help -Shell ->launching exe files

Adrian.

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:5E**********************************@microsof t.com...
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

"Adrian <" wrote:
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.


Mar 2 '07 #4
Well, after shared libraries we can have shared executables too.
Just add the reference to the exe, and press CTRL+W+J.
"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comha scritto
nel messaggio news:5E**********************************@microsof t.com...
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

"Adrian <" wrote:
>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.

Mar 2 '07 #5
bob
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

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:FF**********************************@microsof t.com...
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 <statisticsneeds to reach
some
of the classes/functions in <MyTest01>. An example:

<MyTest01holds a class called <clsCalculations>. this class holds a
public functions called <calculate_MyScorereturning an integer.

How can the dll <Statisticsreach the function <calculate_MyScore???

From before the the dll is a part of the <MyTest01references.

Appreciate any help
Best regards
Hans Årsjö

Mar 2 '07 #6
In your Visual Studio Help -Shell ->launching exe files

Adrian.

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:5E**********************************@microsof t.com...
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

"Adrian <" wrote:
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.


Mar 2 '07 #7
Hi bob!

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

Best regards
Hans Årsjö

"bob" wrote:
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

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:FF**********************************@microsof t.com...
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 <statisticsneeds to reach
some
of the classes/functions in <MyTest01>. An example:

<MyTest01holds a class called <clsCalculations>. this class holds a
public functions called <calculate_MyScorereturning an integer.

How can the dll <Statisticsreach the function <calculate_MyScore???

From before the the dll is a part of the <MyTest01references.

Appreciate any help
Best regards
Hans Årsjö


Mar 4 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: cheeser | last post by:
Hello all, Please see the question in the code below... Thanks! Dave #include <iostream>
12
by: Leon | last post by:
Hi all. For my application I'm using a third-party library which is supplied as a library file (.lib) and an associated header file to prototype the functions defined in the library. Important...
10
by: sjbrown8 | last post by:
I have the piece of code below, and when i try compiling with the line g++ 753075304.cpp I get the following error message: 753075304.cpp: In function 'int main()': 753075304.cpp:29: error:...
44
by: bahadir.balban | last post by:
Hi, What's the best way to implement an overloaded function in C? For instance if you want to have generic print function for various structures, my implementation would be with a case...
3
by: dotNETDavid | last post by:
We've broken our app into various assemblies. The WinForm assembly provides the user interface, other assemblies provide various I/O services. I'd like to be able to call...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
10
by: bienwell | last post by:
Hi, I have a question about file included in ASP.NET. I have a file that includes all the Sub functions (e.g FileFunct.vb). One of the functions in this file is : Sub TestFunct(ByVal...
5
by: Digital Puer | last post by:
Hi, I've inherited a bunch of C code that needs to be called from a C++ framework, so I thought it would be good to put these C functions into C++ classes for better organisation. What are best...
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
6
by: Marco | last post by:
One of the things I like about C++ is that it doesn't force you to create fake "objects" in the OO sense. We had a debate at the office about the "right" way to encapsulate related utility...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.