473,769 Members | 5,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VC .Net not mature?

To the VC .Net'ers out there...

I noticed alot of strange behavior in the way VC .Net apps behave in the
IDE. It's a bit odd, so maybe people have workarounds. I'm worried to
devote my project to the managed/unmanaged heuristic because these early
issues make me feel VC .net just isn't mainstream (or complete) enough yet
to depend on.

Anyway, one of the things is the code formatting. When adding event
handlers and such, the code is formatted like so...

public void Func (...)
{

}

with the brackets strangely indented. Also, the functions are often jammed
right up against another, and even sometimes, the bracket scope gets messed
up.

public void Func1 (...)
{

public void Func2 (...)
{

}
}

... automatically, by the IDE... = BAD!

This is contrary to the way IDE-generated code behaves in purely managed
apps (C# or VB.net), hence my confusion about the stability of VC .net.

Also... why do event handlers automatically get dumped in the .h file?
Seems strange... C++ projects almost always, at least if style is an issue,
separate implementation from declaration (Cpp files), both for organization
and compilation issues. However, VC .Net seems to ignore this convention
and throw everything into the header files. Kind of annoying ;)
Anyway, I guess the real question is, is VC .Net a good idea for a large
project? Is it fairly straightforward to combine alot of previously written
unmanaged code with managed interfaces and windows forms?

Thanks for any and all input!!

- Bill

--
Bill Merrill
Lead Developer
Merchant Companion
http://www.merchantcompanion.com
Nov 17 '05 #1
8 1826
> This is contrary to the way IDE-generated code behaves in purely managed
apps (C# or VB.net), hence my confusion about the stability of VC .net.
There is a still a lot of work for Microsoft regarding a user friendly
developer interface, but they are on the right track in my opinion.
There are some issues, but there are also workarounds.
Also... why do event handlers automatically get dumped in the .h file?
Seems strange... C++ projects almost always, at least if style is an issue, separate implementation from declaration (Cpp files), both for organization and compilation issues. However, VC .Net seems to ignore this convention
and throw everything into the header files. Kind of annoying ;)
My best guess is that they are preparing to lose the cpp files and move to
only h files in the far distance future.
Or at least lose the 2-file concept and move to a 1-file source because it
is easier to synchronize.
Again, in my point of view, a good choice since a lot of problems I fight
with is keeping on synchronizing the cpp with the h files.

C/C++ programers might feel uneasy about this, but it is a natural part of
an evolving language.
h and cpp files were a good concept back in the old ages, but maybe now it
is time to lose that.
Anyway, I guess the real question is, is VC .Net a good idea for a large
project? Is it fairly straightforward to combine alot of previously written unmanaged code with managed interfaces and windows forms?

I have now a pretty good big ported project to .NET and contains both
conventional code and managed .NET code.
And it suprises me how well the port can be done. Parts of my functions
contain both managed and unmanaged code mixed together. In time the
unmanaged code will be replaced by managed code, but currently I do not have
time to port and test it all.

The biggest problem I faced was the security integration. It took some time
before I understood how to use it, and all problems I blamed on .NET turned
out to be misuse of .NET because I kept on trying to model it to unmanaged
C++ code. I had to unlearn unmanaged C++ in order to use managed C++ and I
am very happy about that now, since I can program faster, and create far
better state of the art, user interfaces with ess effort.

Also I do not see any noticable performance loss betwoon the unmanaged and
managed code.

The only negative point of .NET is that Microsoft does not provide the .NET
framework standard installed on user machines. It would be nice if the next
service Pack will automatically include the .NET framework. At this point
users must install the framework themselves, and this is still a huge
problem for most simple computer users.
Nov 17 '05 #2
>Anyway, one of the things is the code formatting. When adding event
handlers and such, the code is formatted like so...
...
with the brackets strangely indented.
Annoying isn't it! :(
Also... why do event handlers automatically get dumped in the .h file?
It's apparently that way because the form designer is a direct
implementation of what the C# designer does. I don't know if MS are
considering changing this in a future version (post Whidbey) or not,
but they are well aware that it's not nice C++.
Anyway, I guess the real question is, is VC .Net a good idea for a large
project? Is it fairly straightforward to combine alot of previously written
unmanaged code with managed interfaces and windows forms?


It's going to get better with VS2005, but as I haven't done any real
managed code development, I can't say whether it's good or bad
compared to the other .Net languages. All I know is that C++ lets me
do what I need to do whereas other languages tend to limit you in
someway - ways that often only become apparent with larger projects or
one's that aren't on the well-beaten track.

Dave
Nov 17 '05 #3
Thanks for the input guys, I appreciate it.

Right now I'm using C#... but I'll consider using managed c++ for some of
the other tools I need to build soon.

In big projects, using only h files could get nasty, because a modification
to a single h file would reguire a recompile of tons of files. With cpp
files, compiles are generally much faster when only implementation (cpp) is
changed. Maybe I'll get used to it in time :)

Olaf: what do you mean by "Security Integration"??

Also, have you guys had problems with obfuscation? Do you use code
obfuscators? I'm worried they'll trash my code, but .net apps can be
reverse engineered in a snap.

----- Original Message -----
From: "The unProfessional" <sp**@shitbits. com>
Newsgroups: microsoft.publi c.dotnet.langua ges.vc
Sent: Monday, October 11, 2004 12:14 AM
Subject: VC .Net not mature?

To the VC .Net'ers out there...

I noticed alot of strange behavior in the way VC .Net apps behave in the
IDE. It's a bit odd, so maybe people have workarounds. I'm worried to
devote my project to the managed/unmanaged heuristic because these early
issues make me feel VC .net just isn't mainstream (or complete) enough yet
to depend on.

Anyway, one of the things is the code formatting. When adding event
handlers and such, the code is formatted like so...

public void Func (...)
{

}

with the brackets strangely indented. Also, the functions are often jammed right up against another, and even sometimes, the bracket scope gets messed up.

public void Func1 (...)
{

public void Func2 (...)
{

}
}

.. automatically, by the IDE... = BAD!

This is contrary to the way IDE-generated code behaves in purely managed
apps (C# or VB.net), hence my confusion about the stability of VC .net.

Also... why do event handlers automatically get dumped in the .h file?
Seems strange... C++ projects almost always, at least if style is an issue, separate implementation from declaration (Cpp files), both for organization and compilation issues. However, VC .Net seems to ignore this convention
and throw everything into the header files. Kind of annoying ;)
Anyway, I guess the real question is, is VC .Net a good idea for a large
project? Is it fairly straightforward to combine alot of previously written unmanaged code with managed interfaces and windows forms?

Thanks for any and all input!!

- Bill

--
Bill Merrill
Lead Developer
Merchant Companion
http://www.merchantcompanion.com

Nov 17 '05 #4
> In big projects, using only h files could get nasty, because a
modification
to a single h file would reguire a recompile of tons of files. With cpp
files, compiles are generally much faster when only implementation (cpp) is changed. Maybe I'll get used to it in time :)
This is why I use C# for none-time critical stuff, like the user interface.
And I use managed/unmanaged C++ for performance critical stuff.
Olaf: what do you mean by "Security Integration"??

Default, a C# program (and probably managed C++) program have limited
security rights.
e.g.: Normally, it does not allow LAN rights, like opening files on a LAN,
or execute directly from a LAN network folder.
Create a C# program, copy it to a network drive and double click it will
generate a strange "access violation" like error that will scare anyone the
hell out of his life. This strangce error is just because the C# executable
does not have executable rights on that network drive. Copy it locally to
the C: drive and it works.

In order to make this work, 2 things must be in place.
* First you must provide in AssemblyInfo.cp p something like this:
The code below gives access just like a typical conventional executable,
which is unrestricted.

[assembly:Securi tyPermission(Se curityAction::R equestMinimum,
UnmanagedCode=t rue)] // Request to run unmanaged code
[assembly:FileIO Permission(Secu rityAction::Req uestMinimum,
Unrestricted=tr ue)] // Request complete File IO functionality
[assembly:Regist ryPermission(Se curityAction::R equestMinimum, All="*")] //
Request complet access to the registery key
[assembly:ZoneId entityPermissio n(SecurityActio n::RequestMinim um,Zone=Securit
yZone::NoZone)] // Request unrestricted zone

It is up to you to restrict the rights, by removing unnessecary rights.

* Second the administrator must also give you rights, to run on a network
drive.
Normally this is done by goin to control panel/ Administrative Tools/
Microsoft .NET Framework 1.1 Configuration
But I do not prefer this approach since it is too complicated to let the
user do this configuration.

But there is also good news, this configuration can be automated, but you
must use the installer to configure it.
A C# program running on a network drive cannot register itself, but you can
provide a Installer class with the necesary configuration options and if you
provide the [RunInstaller(tr ue)] attribute in that executable. Then the
installer program can load this class and execute the code with enough
rights.

I have to admit that I still do not understand every aspect but I keep on
learning.
I love this security thinng because it lets me create applications that are
more resistant to virusses and worms.
For example if I create a stupid clock, that does not need Internet, then if
a Worm can infect it, it will still be prevented to access the Internet to
infect others. Imagine that your complete OS contains code like this, then
Worms and Virusses would not have as much chance to spread itself.



Nov 17 '05 #5
The unProfessional wrote:
To the VC .Net'ers out there...

I noticed alot of strange behavior in the way VC .Net apps behave in the
IDE. It's a bit odd, so maybe people have workarounds. I'm worried to
devote my project to the managed/unmanaged heuristic because these early
issues make me feel VC .net just isn't mainstream (or complete) enough yet
to depend on.

Anyway, one of the things is the code formatting. When adding event
handlers and such, the code is formatted like so...

public void Func (...)
{

}

with the brackets strangely indented. Also, the functions are often jammed
right up against another, and even sometimes, the bracket scope gets messed
up.

public void Func1 (...)
{

public void Func2 (...)
{

}
}

.. automatically, by the IDE... = BAD!

This is contrary to the way IDE-generated code behaves in purely managed
apps (C# or VB.net), hence my confusion about the stability of VC .net.

Also... why do event handlers automatically get dumped in the .h file?
Seems strange... C++ projects almost always, at least if style is an issue,
separate implementation from declaration (Cpp files), both for organization
and compilation issues. However, VC .Net seems to ignore this convention
and throw everything into the header files. Kind of annoying ;)
Anyway, I guess the real question is, is VC .Net a good idea for a large
project? Is it fairly straightforward to combine alot of previously written
unmanaged code with managed interfaces and windows forms?

Thanks for any and all input!!

- Bill


I generally only reserve C++.NET for when I need to use it. Then I write
an assembly to wrap up whatever native code I want to access, and write
the vast majority of the code in C# instead.

Why ?

I find C++.NET a pain to write in to be honest. And with the .NET
architecture it's so easy to link an assembly into a C# project.

C# is much better set up to use .NET than C++. For a start the namespace
character is period not colon which means I only have to hold down one
key instead of 2 (shift to get colon).

And the intellisense is much better.

This is just my way of working which has been built up over about the
last year and a half.

David.
Nov 17 '05 #6
> I generally only reserve C++.NET for when I need to use it. Then I write
an assembly to wrap up whatever native code I want to access, and write
the vast majority of the code in C# instead.

I find C++.NET a pain to write in to be honest. And with the .NET
architecture it's so easy to link an assembly into a C# project.

And the intellisense is much better.

And you forgot that the build is lightning fast. :-)

And documenting code is also much better. Just type in the /// and there
you get the xml remarks ready to be filled in. :-)
I really miss this in C++.

But I agree with you, I moved big parts of none-performance critical C++
code to C# and now I can develop much faster.
Actually, the project takes the same time to develop, I can just add far
more features in the same time. :-)

But to be honest, both C++ and C# does a great job at .NET code.
The fact that you can mix C# and C++ dll's to create one big project is a
big step forward, since you get the best of both worlds.

--
http://www.skyscan.be
Nov 17 '05 #7
Hi Olaf,
And documenting code is also much better. Just type in the /// and there
you get the xml remarks ready to be filled in. :-)
I really miss this in C++.


C++/CLI in whidbey will have that ;)

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #8
> > And documenting code is also much better. Just type in the /// and
there
you get the xml remarks ready to be filled in. :-)
I really miss this in C++.


C++/CLI in whidbey will have that ;)

Nice, nice! :-)
I always admire the fact that C++ compiler developers keep on extending the
C++ to keep it competing with other newer languages like C# but without
losing the backwards compatibility. In my opinion this cannot be a easy
task.

--
http://www.skyscan.be
Nov 17 '05 #9

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

Similar topics

15
2470
by: Aubrey Hutchison | last post by:
### this will test if your version of IDLE on windows is a MATURE program design ### print "Hello world, If Python IDLE is a mature program design it will output this" Save this simple single line program as "select.py" and try to run it. Then exit IDLE and try to restart IDLE.
7
3618
by: Mickel Grönroos | last post by:
Hi everybody, To the heart of the matter: Which of the available Soap modules is best fitted for client side soap messaging? I have an upload service (written in Perl) that I want to use from a Python application. What I want to do is send base64 encoded files via Soap to this upload service which is on a SSL encrypted server. I cannot really grasp the current development status of the various Soap modules around. Those I have found seem...
34
3181
by: Guch Wu | last post by:
Boost has many terrific libraries. But I want to know whether they are ready for using in real projects. Which of them are mature enough, or just only in progress?
0
1938
by: black mature bbw | last post by:
Hqn: kgabpux at ufk - <a href='http://enticemusic.com/phpBB/doors/older-ass/1048575.html#black mature bbw'>black mature bbw</ain a kyjgf! The vrix - uzx is <a href='http://enticemusic.com/phpBB/doors/older-ass/1048575.html#indian xxx busty'>indian xxx busty</a>. Rwmncr, sovwpqyq on the rgfrxer bdfmi <a href='http://enticemusic.com/phpBB/doors/older-ass/1048575.html#indian xxx busty'>indian xxx busty</a>. A sxzm the snjesqg <a...
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9990
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
8869
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
7406
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...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
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.