|
That is more than possible, though I do have the hairline and male pattern baldness of a sixty year old man.
Still, the internet has a funny way of making things come across as cynical. Thanks for your response, if I had just remembered the term private backing field it would have helped. So apparently I have the memory of a sixty year old man as well.
Cheers, --EA
|
|
|
|
|
Hi, I'm developing a win32 dll, I'm a c# programmer without a lot of experience in c++. So I decide to do this dll in c#.My dll have to expose a few functions and also has to communicate with a serial port, I resolved pretty well the export functions in the same way as in c++ like win32 API, and about the serial port I will manage it like a safe code object (SerialPort object). But my question is, if one of these functions that the dll export is like "WriteCommMsg(MsgStr * msg)", I don't know were to declare the necesary variables, for example if I'd have to save the last send msg, were this variable would be declared?, I mean, my doubt is what is the lifetime of the variables in a dynamic win32 dll.
For example, try to consider these situation: the user application will call a function of my dll, for example OpenPort()....here my dll has to initialize the port and open it (not only but the basic..), and for doing these create an object of SerialPort....but what happened with the object whe the call to the functions end?....
Hope someone could help me..
thanks
skabo - Robots are a dynamic work of art...
|
|
|
|
|
Please post your questions in one forum only.
|
|
|
|
|
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."
|
|
|
|