|
Sandeep Akhare wrote: I don't see any good reason to use value types in the class ?
As value types are going to be over head (as GC will Deallocate them)
A value type as a member of a class is more efficient than a reference type.
A value type just takes up space, which will just be part of the space new/gcnew
allocates for the object. Reference types need to be allocated and collected
separately, adding more overhead.
Sandeep Akhare wrote: Any way can you give any article link ?
Common Type System Overview[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hopefully you found what you were looking for
I don't like my last post - it seems irrelevant. The
most important thing IMO is how objects are passed around.
By reference means just a reference to an object is passed, so
any changes to the object effect everywhere a reference is held.
Value types are passed by value, so there's always a new unique copy
passed. That can be important to know.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey Mark,
I am aware of these concepts, My real concern was we use value types in the code because those are light weight (as GC wont come into picture and will get diallocated automatically from Stack when their life span is over).
But when we use value types in class we lost these advantages as GC will have to remove them and will remain in memory even though their life span is over.
I hope, i was able to explain this properly
Its really very nice to see that MVP like you is looking back and sees what should and what shouldn't have posted
Thanks Mark keep it up
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: But when we use value types in class we lost these advantages as GC will have to remove them and will remain in memory even though their life span is over.
I see what you mean, but there's really not a way around it in
a managed/garbage-collected environment.
C++/CLI (and C# maybe a little) gives you more flexibility in
deterministic finalization if it's really an issue.
There can also be a benefit to forcing a garbage collection at certain
points in an app's lifetime.
It just depends on the situation - It's definitely something to think about
in performance applications.
Cheers!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: see what you mean, but there's really not a way around it in
a managed/garbage-collected environment.
Yes you are right, Actually i had issue with this one only
Mark Salsbery wrote: C++/CLI (and C# maybe a little) gives you more flexibility in
deterministic finalization if it's really an issue.
In C#, we will ovveride the Finalization if object is using some sysytem resources and GC can't realase them
Mark Salsbery wrote: There can also be a benefit to forcing a garbage collection at certain
points in an app's lifetime.
This is what i read in many books " GC is slef tuning don't mess with it "
Its good to call GC if you know best time to call (End of game application .. etc )
Mark Salsbery wrote: It just depends on the situation - It's definitely something to think about
in performance applications.
Very true,
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
from javascript i am opening one window using window.open(),in dat window i m displaying one web page.in that page after clicking on one link i m opening one more window using window.showmodaldialog().
in showmodaldialog window i m doing some validation.if validation is successful i should close only showmodaldialog window.if validation fails i need to close both showmodaldialog window and parent window.
I m able to close the showmodaldialog window if the validation is successful.I m facing the problem to close the parent window if validation fails.
can anybody help me?
regards
vidhya
|
|
|
|
|
vidhyap wrote: I m facing the problem to close the parent window if validation fails.
how did you try to close the parent window ?
Try with document.opener this will help.
cheers,
Abhijit
|
|
|
|
|
Dear All,
I am unable to find Microsoft DotNet 2.0 Framework for Windows Mobile, that I can actually install to my IMate (KJAM)
Any help in this regard is highly appericated.
Best regards,
Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
I have declared an instance of a class called Application and named the variable ‘app’. Application has a method called Process() which throws a BadDataException on failure. Write the code to call this method.
|
|
|
|
|
Done.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello.
I was wondering if someone can help me with some ideas around creating usefull logging information in an .Net Compact Framework environment. All articles I can find use the Stackframe class from System.Diagnostics but the .CF does not have that so I was wondering what my alternatives are. Do I even have any?
Thanks..
W
|
|
|
|
|
HI All,
Can any one tell or provide links, whether Exbedded supports .Net Framework 2.0
Thanks,
Urs Friend
|
|
|
|
|
Which specific features do you want to support?
Best regards,
Jaime.
|
|
|
|
|
hi folks,
A SP in sql server is not returning a string variable as output variable ..can any1 let me know how to return a string variable from SP in sql server?A function returns a string variable whereas a SP doesnt return.y?
for e.g I have created a SP
create procedure SP_abc(
@a INT
@b out VARCHAR(10)
)
as
begin
set @b = 'ABCD'
end
How to get the value of b in the front end?
T.Balaji
|
|
|
|
|
If you fire the SP with SqlCommand.ExecuteNonQuery(), then you can retrieve the parameter with SqlCommand.Parameters collection as:
SqlCommand command = new SqlCommand("SP_abc");
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@a", SqlDbType.Int);
command.Parameters["@a"].Value = somevaluehere;
command.ExecuteNonQuery()
string b = (string)command.Parameters["@b"];
Best regards,
Jaime.
|
|
|
|
|
hi,
But im getting a value as 1 and 0 and im not getting the value of though im usign LINQ.Can u tell me whether it is possible to return a string value as output in the front end using SP?
T.Balaji
|
|
|
|
|
|
Technically it is possible to emulate them with the graphic libraries, but their is no native support for graphing. You can either create your own custom controls or look into a third-party control that may have what you are looking for.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi,
I am developing a demo application using Microsoft Composite UI Application Block and Smart Client Software Factory. I am using Access as the database & want to show the one of the tables in the DataGridView.
I have no clue as how I should do this. Can any one help in the same?
Thanks in advance,
HR
|
|
|
|
|
There are several Database beginner level tutorial type articles here on CodeProject. I suggest you take a look at one or more of them.
See in the site menu bar CHAPTERS section and the subsection Database
led mike
|
|
|
|
|
I want to write a voice response system with C#.NET. But I don't know where I should start? Which component is better and easier to use (why?) and What is the difference between them? Also please say the differences between kdtele , tapi , tapiex?
Please help me.
|
|
|
|
|
Not sure which is better. Have you researched the different components and weigh out the pro's and con's?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
I already added an image button in Edit Item Template.
I created calendar in Edit Item Template, i make it invisible.
How to show calendar whenever image button clicked in datagrid????
Thanks,
usha
|
|
|
|
|
A possibility:
Investigate using AJAX and embed an UpdatePanel in the EditItemTemplate containing the calendar with it's visible property set to false . When the image click event is fired, set the calendar's visible property to true to show the calendar.
Good luck...
/F - .NET Developer
|
|
|
|