.net in C++

Schadenfroh

Elite Member
Mar 8, 2003
38,416
4
0
If I make use of .net functions, like this code sample in VC++, is it possible to set VC++ up in such a way that it can compile and then run without the .NET framework installed on the target system?

Thanks
 

Cogman

Lifer
Sep 19, 2000
10,286
147
106
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.
 

nickbits

Diamond Member
Mar 10, 2008
4,122
1
81
Originally posted by: Cogman
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.

LOL
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: Cogman
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.

This same technique will allow you to run windows programs without windows! ;)
 

Cogman

Lifer
Sep 19, 2000
10,286
147
106
Originally posted by: Markbnj
Originally posted by: Cogman
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.

This same technique will allow you to run windows programs without windows! ;)

:) Its amazing what you can accomplish with a little elbow grease and determination :D
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: Cogman
Originally posted by: Markbnj
Originally posted by: Cogman
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.

This same technique will allow you to run windows programs without windows! ;)

:) Its amazing what you can accomplish with a little elbow grease and determination :D

Ask RedSquirrel how his mySQL library is working out! :laugh:
 

Red Squirrel

No Lifer
May 24, 2003
71,306
14,082
126
www.anyf.ca
Originally posted by: Crusty
Originally posted by: Cogman
Originally posted by: Markbnj
Originally posted by: Cogman
Originally posted by: nickbits
No. You use .NET classes, you need the .NET runtime.

Well... You COULD, if you rewrite every .Net class called in your program. However, this is the correct answer without a lot of code rewriting.

This same technique will allow you to run windows programs without windows! ;)

:) Its amazing what you can accomplish with a little elbow grease and determination :D

Ask RedSquirrel how his mySQL library is working out! :laugh:

I gave up on it as i had touble finding detailed documentation on the protocol and the password hash functions then put another couple hours of troubleshooting and ended up getting mysql++ working.

I did rewrite lot of .net stuff such as DateTime so that it's portable though. Basically anything I find myself rewriting each time i make a program, I just write a base header for it so I can use it on any platform. My DateTime is actually similar to php's time and uses the same formatting for time, so that it is "standard" to an existing implimentation.

For mysql I ended up writing a mysql++ wraper class though, as mysql++ is sensitive to crashes, so I have error checking built in the class.

One of these days I really want to write a thread class as well, but pthreads is fairly simple on it's own so probably no point in having a wraper for it.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
Kind of an interesting question as the .net classes for registry access are probably wrappers for advapi.dll calls.