|
Agree, but what about using other OCXes, or using DLLs or unsafe code. Should we totally avoid using them and stick only with managed code?
Jerzy
|
|
|
|
|
JerzyPeter wrote:
Should we totally avoid using them and stick only with managed code?
Not at all! The .NET framework is still incomplete in various areas. There is nothing wrong in invoking the API
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hello,
I am starting to learn the .NET stuff and I have the following questions:
1. Are the executables produced by .NET native code are they binary interpretated (like java .class files)
2. How much overhead does the garbage collection produce? (in terms of speed and memory)
3. If I am using Managed C++ can I manually delete pointers from an unmanaged code?
Thanks!
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexpro wrote:
1. Are the executables produced by .NET native code are they binary interpretated (like java .class files)
A little of both. .NET code is run through a JIT compilation, where the MSIL is converted into x86 code. This can happen in two different ways. First is when you just run the application, it will compile each method as its executed (each method is only compiled once). Second there is an install-time JIT utility called ngen . ngen will do the compile on the client system.
The reason it is called install time is the way that it works, the x86 code isn't placed in the binary but in a special location in the system; so you can't run ngen on your program then ship it, you have to do it when the program is installed on the client system.
Alexpro wrote:
2. How much overhead does the garbage collection produce? (in terms of speed and memory)
That all depends on the type of application you are writing. A typical database frontend application won't see any difference; a raytracing application will probably see a large difference. There is an article on CP in the .NET section that goes into very good detail about the garbage collection algorithm.
Alexpro wrote:
3. If I am using Managed C++ can I manually delete pointers from an unmanaged code?
YES! You have to Anything that is unmanaged you must take care of yourself, that includes system resources too (files, sockets, handles, etc). .NET provides wrappers for many system resources, and each one of those implements IDisposable so that you can free the resources ASAP.
HTH,
James
Simplicity Rules!
|
|
|
|
|
Hello everybody!
I'm just wandering what one needs to do to distribute an application written in C# to a client machine which hasn't got the .NET installed.
Do you have a link to where I can learn more about this or does anybody have experiences in distributing the .Net framework?
Thx a lot!
Matthias
|
|
|
|
|
Matthias Steinbart wrote:
I'm just wandering what one needs to do to distribute an application written in C# to a client machine which hasn't got the .NET installed.
No,This is not possible.You have to install it there.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hi Mazy,
sorry for not being precise enough with my question. What I'd like to know is what is required to install the .NET framework on the target computer. How do you do this. Is there a ready packed .NET setup from Microsoft which you just include with your setup? Or do you have to roll your own?
Thx again!
|
|
|
|
|
Matthias Steinbart wrote:
Is there a ready packed .NET setup from Microsoft which you just include with your setup? Or do you have to roll your own?
No,you have to install it yourself seprately from your software.You can download it from M$ site(its free;) )
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Do you have a link?
<being lazy="" to="" search="">
Thx,
Matthias
|
|
|
|
|
I think this is what you want.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
There should be a merge module somewhere which you can use if you have a Windows Installer based setup. This will let you install the framework from within your setup program.
On my computer this file is located at c:\program files\common files\merge modules\dotnetfxredist_x86_enu.msm
HTH,
James
Simplicity Rules!
|
|
|
|
|
How do you add the module in the setup project?
|
|
|
|
|
There is a way in a deployment project in VS.NET that you can specify the framework must be installed before you install your app. Check the help for doc & syntax
Andrew Connell
IM on MSN
andrew@aconnell.com
|
|
|
|
|
Using Deployment projects in Visual Studio.net you can pack de dotnet framework in your setup application. The Compiled installation application will take care of the install order.
Reality.sys is corrupted!
Reboot the universe Y/N?
|
|
|
|
|
Thanks James and Mazy for the help. Now I got everything I need.
|
|
|
|
|
I am writing a program that will use remoting, and I don't know which protocol to use. I understand that TCP/IP is faster, but to what extent (1.1x, 2x, 10x)? And how much more secure is HTTP?
|
|
|
|
|
Sort of apples and oranges.
HTTP is built on top of TCP.
HTTP is a client/server protocol (request/response).
TCP is bidirectional after a connection is made.
TCP provides no security.
HTTP provides very primitive security.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
Sort of apples and oranges.
HTTP is built on top of TCP.
Would I be right in saying that while HTTP is built on top of TCP/IP, HTTP can cross firewalls easilier than TCP/IP in the sense that the port for HTTP is almost always open.
Or maybe I should say: If I use TCP/IP directly as a comms protocol in an app will it be blocked "more" than HTTP, or, because HTTP is built on TCP/IP, there is no difference?
Or am I talking apples and oranges? Just thinking of some ideas and wondering what protocol to use for text messaging type comms.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Tim Smith wrote:
Over here in the third world of humor (a.k.a. BBC America),
peterchen wrote:
We should petition microsoft to a "target=_Paul" attribute.
|
|
|
|
|
I can compile my project fine, but everytime I go to run my program from within the VS.NET IDE I get the messagebox that says
These project configuration(s) are out of date:
"ProjectName - Configuration Name"
Would you like to build them?
It says this for any build config. If I hit yes it'll recompile the resources, relink then start my program. I don't understand why this always happens even after just rebuilding my project. It doesn't happen with all my projects, and I haven't been able to find an option or anything to try changing.
Anyone have any ideas?
-Lunchy
|
|
|
|
|
You'll get that messagebox if a file has been modified since the last compile. So this means one of several things, you have a post-build step that is modifying one of the files (version incrementer?), a virus which is embedding itself in a file once a file has closed, or its just a random bug.
Sorry I can't be of more help,
James
Simplicity Rules!
|
|
|
|
|
Hrmmm, SourceSafe wouldn't being doing anything would it? I wouldn't think so, but that's the only other thing I could think of. Shouldn't be a version incrementer as I'm not using one. And as far as a virus, I'd think it's a longshot. I've recreated the project and I get the same results. Unless it's attatched to a source file and not a project type file. Maybe it has something to do with wxWindows inards... who knows.
Thanks much for the reply!
-Lunchy
|
|
|
|
|
SourceSafe might be doing something; but it seems odd. If you create a project not using SourceSafe do you get the same problems? I don't have SourceSafe here so I can't vouch for its innocence.
James
Simplicity Rules!
|
|
|
|
|
Oh yea, good point. I'm pretty sure I wasn't using sourcesafe on that new project. Must be something else...
-Lunchy
|
|
|
|
|
Hi there !
I have a tricky little problem. First I have to elaborate on my custom application architecture.
I am desigining a highly extensible game engine which gets almost all functionality out of plugins which are implemented as .NET assemblies.
I have a class called "Node" which wraps dynamically loaded classes via their object base class and supports invocation of methods via reflection as well as other things..
Nodes are organized in a hierarchy . Every Node contains a SortedList storing all child nodes, as well as a Node Reference pointing to the
Parent node of a given node, as well as an object reference pointing to the wrapped class ( which was imported from the plugin assembly )
Now i want to save the hierarchy to a file via serialization. However i only want to save parts of the hierarchy from a given node. However since there is a parent reference , always the whole hierarchy gets serialized since the serializer walks both ways automatcially.
So i want to restrict the serialization of the parent reference in certain cases dynamically. I can'T just add "Noserialze" attribute to the parent reference, since all classes are wrapped in Nodes and there can't be derived classes.
Because of that i want to support ISerialize on the Node class to control what gets serialized and stop at a given node.
However i do not seem to get that working. In particular how do i have to serialize the SortedList for the child nodes ?
This is what i have so far:
public void Node.GetObjectData( SerializationInfo info,StreamingContext context )
{
info.AddValue("Id",m_identifier ); // Store the node id
foreach( Node n in m_children.Values )
{
string name = n.Name;
info.AddValue ( "Name",name );
info.AddValue ( "Node",n );
}
if ( m_parentSerialize )
info.AddValue("Parent",n.Parent );
}
However this does not seem to work
I also tried calling GetObjectData for the child nodes..
Seems not to work either.. .
Any clues ?
|
|
|
|
|
The way the default serializer works, is it will not serialize an object if it is already serialized, but it will store a value so that when deserialized it will point to the proper object. So you shouldn't have to implement ISerializable .
Anyway, in your code the problem is the foreach loop. You are adding the node names and the nodes, but they have the same name each time; so you are adding the data but when you go to deserialize it, you are getting the same data back each time.
James
Simplicity Rules!
|
|
|
|