473,588 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a question about communication between C# and C++

Dear friends,
I have a question about the communication between C# and
C++.
Can anyone help me ??
I have written a C# dll fies named "TestFordll2.dl l",as
fllow:

using System;
namespace TestForDll2
{
public class TestForDll
{
private int result ;
public TestForDll()
{
result = 0;
}
public TestForDll(int a , int b)
{
result = 0;
result = a + b;
}
public int Out()
{
return result;
}
}
}

And I also wrote a C++ file named "Call.cpp" to call the
C# dll file "TestForDll2.dl l",as follow:

#include <iostream.h>
#using <TestForDll2.dl l>
#using <mscorlib.dll >
using namespace System;
using namespace TestForDll2;
int main()
{
int i = 0;
TestForDll2::Te stForDll *a = new
TestForDll2::Te stForDll(1,2);
i = a->Out();
cout<<"the result is"<<i<<endl;

}
And I also set the properties of the C++ file by using the
follwo:
1. Open the project's Property Pages dialog box.
Properties.
2. Click the C/C++ folder.
3. Click the General property page.
4. Modify the Resolve #using References property making
it pointing to the "TestForDll2.dl l" file
when I build the project ,everyting is ok.But when I run
the project ,an error occured :can not

find file or assembly "TestForDll2",o r can not find one of
its relier"
why??
Can anyone hlep me? Thanks

reagrds,
Liu Guidong
Nov 13 '05 #1
0 1246

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

Similar topics

0
431
by: Srinivas B.S.S | last post by:
Hi, I am using MyODBC 3.51.06 on solaris. When a ODBC call fails to execute due to communication problems with database server, according to ODBC reference, sqlstate should be set to 08S01 (Communication link failure). But myodbc driver is setting it to HY000 in case of communication errors.
0
1285
by: Michael.Coll-Barth | last post by:
Actually, the continuous complaining and ranting about Xah's 'postings' are far worse than Xah's actual postings. I can filter his stuff to /dev/null. The drivel that follows is almost as bad as the moronic effluent about how extra-python things should be done or not be done or the legal notices that one's company tacks on at the end of messages. for x in ( 'Grow up', 'Shut up', ' and get a life' ): print 'Life could be good' ...
1
3796
by: xixi | last post by:
i have catalog a remote database on my local db2 server, but now the remote database server with same machine name but the ip address changed, so i remove the old one, and try to catalog again under control center --- all cataloged systems, then i use discover search button, find the sysetm name, but gives me error SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being...
3
43185
by: Tim Reynolds | last post by:
I support a .Net application running on a SERVER accessing MF Db2 data. Occasionally, we have some type of connection problem that we have been unable to debug up to this point. We typically receive one of these IBM.Data.DB2.DB2Exception messages: ERROR SQL30081N A communication error has been detected. Communication protocol being used: ‘TCP/IP'. Communication API being used: ‘SOCKETS'. Location where the error was detected:...
1
9008
by: Praveen | last post by:
Hi, I have installed WebSphere Portal on AIX and connected to DB2 on a remote machine, Getting the followin errors when trying to get the values from database thru applications installed on Portal. Any Help Appreciated. Thanks in advance. Praveen Singh
2
1558
by: xeyder | last post by:
Hi everyone.. I need help about graph theory ( network problems) .. I have below problem . Does anyone know any existence algorithms or solutions to this problem ?? The Problems is: " We can use graphs to represent a communication network. In such graphs, the vertices
1
2987
by: Liu Guidong | last post by:
Dear friends, I have a question about the communication between C# and C++. Can anyone help me ?? I have written a C# dll fies named "TestFordll2.dll",as fllow: using System; namespace TestForDll2 {
21
1930
by: dast | last post by:
Hi, I'm having trouble letting my background thread tell my main thread what to do. I'm trying to tell my main thread to open a form, but when my background thread ends, the form that I thought my main thread had opened disappears. Obviously there's something that I don't understand here. The background thread is run in another class on another form. How do I,
2
1761
by: xeyder | last post by:
Hi everyone.. I need help about graph theory ( network problems) .. I have below problem . Does anyone know any existence algorithms or solutions to this problem ?? The Problems is: " We can use graphs to represent a communication network. In such graphs, the vertices represent communication stations and the edges represent communication
1
1177
by: Tony | last post by:
Hello! This is the scenario that we want to implement. Assume we have three computers called client1, client2 and client3 that must be able to register itself on server A. Meaning telling server A about its existence so other computers can ask server A for the identification for client2 for example so a computer x can establish communication with client2.
0
8220
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7981
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8222
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6632
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5723
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2367
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1457
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1194
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.