473,387 Members | 3,684 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,387 software developers and data experts.

How to Mix .NET library with MFC Application ????

Hi All,
I have created a classic MFC Dialog application ( statically linked
to MFC Library) which can run on any windows platform, without any
library dependencies.

Now, In this application I want to use .NET library say I want to use
sockets provided by .Net

using namespace System::Net::Sockets;

TcpClient* tl = new TcpClient("192.168.0.241",9001);
NetworkStream* nw = tl->GetStream();

bla.. bla...

I want to make a static link to the .Net libraries, so that my
application can run on any Windows platform, without any library
dependencies.

Is there any way I can acheive this??

Thanks for your earliest attention.

Regards,
Manjesh

Nov 17 '05 #1
3 1693
There is no static version of .NET.
Always need your users to install the .NET FrameWork.
Though .NET is nice I doubth it it worth the problems introducing .NET just
for socket support.

Cheers
Ditlef
"Skandaja" wrote:
Hi All,
I have created a classic MFC Dialog application ( statically linked
to MFC Library) which can run on any windows platform, without any
library dependencies.

Now, In this application I want to use .NET library say I want to use
sockets provided by .Net

using namespace System::Net::Sockets;

TcpClient* tl = new TcpClient("192.168.0.241",9001);
NetworkStream* nw = tl->GetStream();

bla.. bla...

I want to make a static link to the .Net libraries, so that my
application can run on any Windows platform, without any library
dependencies.

Is there any way I can acheive this??

Thanks for your earliest attention.

Regards,
Manjesh

Nov 17 '05 #2
"Skandaja" <ma******@world2web.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
I have created a classic MFC Dialog application ( statically linked
to MFC Library) which can run on any windows platform, without any
library dependencies.

Now, In this application I want to use .NET library say I want to use
sockets provided by .Net

using namespace System::Net::Sockets;

TcpClient* tl = new TcpClient("192.168.0.241",9001);
NetworkStream* nw = tl->GetStream();

bla.. bla...

I want to make a static link to the .Net libraries, so that my
application can run on any Windows platform, without any library
dependencies.

Is there any way I can acheive this??


That's not the way .Net was intended to be used and there is no support from
MS for doing that. There are a couple of third party products which purport
to be able to do that. This is one

http://www.remotesoft.com/linker/

about which by the way, I know nothing.

Frankly, your approach seems a high price to pay for socket support.

Regards,
Will
Nov 17 '05 #3
In addition to that, you will not be able to use the static MFC any more if
you are moving to CPPCLI.

In CPPCLI object files created with /clr, /clr:pure, or /clr:safe always
depend on the DLL version of the CRT: Only /MD and /MDd is allowed - /MT and
/MTd are explicitly disallowed. If you are using the DLL version of the CRT,
you must use the DLL version of MFC, too.

Static linking could give you on-file-copy deployment - that's why I liked
this option, too. But with runtime environments like .NET, this dream is
over anyway and since MFC is deployed in WinSxS at least most versioning
problems are solved.

Marcus

"William DePalo [MVP VC++]" <wi***********@mvps.org> wrote in message
news:eA**************@TK2MSFTNGP14.phx.gbl...
"Skandaja" <ma******@world2web.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
I have created a classic MFC Dialog application ( statically linked
to MFC Library) which can run on any windows platform, without any
library dependencies.

Now, In this application I want to use .NET library say I want to use
sockets provided by .Net

using namespace System::Net::Sockets;

TcpClient* tl = new TcpClient("192.168.0.241",9001);
NetworkStream* nw = tl->GetStream();

bla.. bla...

I want to make a static link to the .Net libraries, so that my
application can run on any Windows platform, without any library
dependencies.

Is there any way I can acheive this??


That's not the way .Net was intended to be used and there is no support
from MS for doing that. There are a couple of third party products which
purport to be able to do that. This is one

http://www.remotesoft.com/linker/

about which by the way, I know nothing.

Frankly, your approach seems a high price to pay for socket support.

Regards,
Will

Nov 17 '05 #4

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

Similar topics

6
by: Patrick | last post by:
Following earlier discussions about invoking a .NET class library via ..NET-COM Interop (using regasm /tlb) at...
44
by: Jeff | last post by:
Hi I have a library mde that is used with some customer databases and I found out that another developer discovered it while doing some maintenance work on an old database for the same customer...
4
by: Chris F Clark | last post by:
Please excuse the length of this post, I am unfortunately long-winded, and don't know how to make my postings more brief. I have a C++ class library (and application generator, called Yacc++(r)...
6
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a...
20
by: J de Boyne Pollard | last post by:
MThe library functions which are included to allow process Mlaunch, forking, and termination, imply that it is both Mpossible and desirable for a process to fork itself. This is Ma fundamental...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.