|
Sorry, but I post it here because I'm evaluating the possibility to use c# or c++, if you see the content of this post is a bit different from the other, but maybe I should have changed the name..sorry
Thx
skabo - Robots are a dynamic work of art...
|
|
|
|
|
The basic issue is the same whichever language you decide to use.
|
|
|
|
|
ok, sorry I´m going to consider for my next post
skabo - Robots are a dynamic work of art...
|
|
|
|
|
In .Net you can use the SerialPort class, you don't have to use unmanaged resources (any more) to talk to external devices.
|
|
|
|
|
Yes I know that, but I'm writing a native win32 dll in c#, and what I wanted to know is where to define the serialport variable, thanks
skabo - Robots are a dynamic work of art...
|
|
|
|
|
Uh, why would you do that? You can't compile C# to a form that doesn't require the .Net Framework (as far as I know), as that's what the language is built for (and it implicitly relies on framework things like the CLR type system, the garbage collector etc).
If you want to write a native DLL, do it in a language that compiles to native code (e.g. C/C++, Delphi/Pascal, etc). If you want to write in C#, make a .Net component (with an exported type library if you need it from native code) and use the managed API to the serial port.
|
|
|
|
|
Hello Everybody,
I have a Blank WPF Window. In which i want to add button at the time of Window load.
How can i add Button in WPF form by using C# Code.
Thanks
If you can think then I Can.
|
|
|
|
|
This would be better asked in the WPF/Silverlight forum.
|
|
|
|
|
Maybe it is an option to add the control in design time and set visibility to false. In the onload event of your window you set thatproperty to visible.
V.
|
|
|
|
|
Hello Everybody,
How can i know that size of Object at the time of declaration of object.
If you can think then I Can.
|
|
|
|
|
That's what sizeof()[^] is for.
Use it with the type of your object and it will tell you, how much memory will be used to create an instance.
Ciao,
luker
|
|
|
|
|
sizeof() is only good for value types. What happens if the OP wants to measure a reference type, such as a custom class or List etc?
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Wayne Gaylard wrote: What happens if the OP wants to measure a reference type, such as a custom class or List etc?
Marshal.SizeOf[^]
Bastard Programmer from Hell
|
|
|
|
|
In .net you can never know how much memory an instance of a random class will require. In fact the memory required by different instances of the same class can vary and the memory required by one instance can vary during its lifetime.
|
|
|
|
|
How large can bitmaps be in C# VS2010 W7 64 bit?
Thanks to all for the replies.
modified on Thursday, September 15, 2011 7:36 PM
|
|
|
|
|
Depends on the memory (capacity) of your system.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
Depends on several factors, but in general, no single object (Bitmap or no) can be larger than 2GB.
|
|
|
|
|
Can you define single object in this context?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Any single instance of anything in .NET is restricted to 2GB.
No class instance can exceed this, but an array is a separate object, so you could have an array of 2GB bitmaps without problems (as the array is just a list of references - you know this but I thought I'd spell it out for the Q&A crowd who might have got lost).
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Yah missed the restriction of c#, I was thinking I have images, files, MDFs all somewhat larger than 2gb
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Really? My vhd is 16GB in one file...
V.
|
|
|
|
|
Files are fine - but you can't load the whole thing into any single object as that would exceed the .NET 2GB limit.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
|
|
In addition to the answers about single object, there is also a difference between 32 and 64 bit applications in how much memory they can address. I am not sure how this works out for .NET, but for a general Windows application a 32 bit program will have, at best, around 3 GB's of memory in its address space. This is then filled up even more with loaded DLL's, file handled, objects, etc, so it could be considerable less than that.
For 64 bit, you have relatively unlimited addressable memory available. However, the actual amount you can use is still limited by physical memory, page file and other factors. Also, the 2 GB per-object limit probably still applies. Furthermore, it is always easier to allocate a lot of small chunks than to allocate one big chunk, so creating 4 512 MB objects has more chance of succeeding than one 2 GB object.
|
|
|
|