|
sorry, i shoulda been more clear. i meant for my version of the Point struct i woulda been lazy and have public fields. nothing in the .NET framework exposes fields publicly, and so far that seems to be the only reason i can find in using properties over public fields.
|
|
|
|
|
hypermegachi wrote: i meant for my version of the Point struct i woulda been lazy and have public fields. nothing in the .NET framework exposes fields publicly, and so far that seems to be the only reason i can find in using properties over public fields.
No, there are lots of reasons for using properties over public fields. You just need to (re)read the replies I gave above to find some of them.
My: Blog | Photos
A stitch in time saves nine
|
|
|
|
|
if i didn't read your replies i wouldn't be able to give you a rebuttal for every point you mentioned.
perhaps you wanna read some articles/blogs that share my view...
http://www.devsource.com/article2/0,1759,1541911,00.asp
http://blogs.msdn.com/ericgu/archive/2003/11/12/52836.aspx
http://www.darronschall.com/weblog/archives/000149.cfm
i'm not saying that i'm right, and that you're wrong. i just don't see why people must follow such strict guidelines when other implementations which use less code satisfy the requirements, which is what ultimately matters (XP programmer at heart here).
|
|
|
|
|
We have a method which had a signature similar to the one below:
HRESULT handlebstrref(BSTR* val);
Here 'val' has [in,out] attributes.So we populate 'val' and expect the processed value being populated in 'val' when the method returns
So a COM client works fine as below
BSTR val=SysAllocString(L"value string");
if(_loader)
{
_loader->handlebstrref(&val);
char* retstr = OLE2A(val);
_loader->Release();
}
But when we try to do the same in C# interop we get "Object refrence not set to an instance of the object"
We tried the folliwng
comstringdump _c=new comstringdump();
Iobjdump _i=null;
if(_c is Iobjdump)
{
StringBuilder s=new StringBuilder();
s.Append("DEAL");
_i=(Iobjdump)_c;
_i.handlebstrref(s);
string my = s.ToString();
}
Please help us with the correct semantics to marshal the parameter
|
|
|
|
|
i want to write interrupt service routin in c# for parallel port please help me fast...please...
|
|
|
|
|
mostafa.hk wrote: i want to write interrupt service routin in c# for parallel port
I think .net is just not designed for this... try a plain C language approach that compiles x86 code directly, not il...
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
hello, i need some help with regex. i hardly ever use regex, and i dont know much about it. i have a string, and in it i have something like this:
[something]string here[end]
[somethingelse]string here[end]
[anotherthing]stuff[end] how can i retrieve the text between [somethingelse] and the first [end] after it and store it in another variable (string)?
thanks in advance,
sam kline
|
|
|
|
|
Create a Regex object with the pattern "\[somethingelse\]([\w\W]*?)\[end\]" and do a match on the string.
---
b { font-weight: normal; }
|
|
|
|
|
You might want to try this.
using System.Text.RegularExpressions;
string searchString = "[something]string here[end]"
+ Environment.NewLine
+ "[somethingelse]string here[end]"
+ Environment.NewLine
+ "[anotherthing]stuff[end]";
Regex r = Regex( "\\[somethingelse\\](.*)\\[end\\]" );
Console.WriteLine( r.Match( searchString ).Groups[ 1 ].ToString() );
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hello,
After playing a while with the new VS2005 I started to convert my existing
Windows Forms projects from .NET 1.1 in VS2003 to .NET V2.0 in VS2005.
After a few days converting and warning and bug hunting I finaly had a
succesfull build op my projects and libs but great was the desolution if I
saw that my application was still using the old style op buttons, textboxes
etc.
My new projects use the nice controls but my converted one not, what am I
missing?
Greets
Jean Paul Mertens
|
|
|
|
|
assuming the form name is form1, look for this under "static void Main()"
Application.Run(new Form1()); and add this above it:
Application.EnableVisualStyles(); hope this helps
sam kline
-- modified at 11:22 Saturday 26th November, 2005
|
|
|
|
|
Sam,
Tnx for reply, that was THE line who did it.
JPM
|
|
|
|
|
Hi,
I wanted to create report in word document. I want to insert images from c# to word document each image in diff. page in same word document. how to do this?
Hope I will solution to my query.
Thanks,
Hiral
-- modified at 12:43 Saturday 26th November, 2005
|
|
|
|
|
Hi
I want to know that how many users are currently online on my site and if they are login then i want to get their loginID also. I am new to ASP.NET. Can anybody help me about this.
Regards
Asif Hameed
|
|
|
|
|
Create a variable on the application level, and on every session start increase that variable by 1, and on the end decrease it again.
void Application_Start(object sender, EventArgs e)
{
Application.Add(numOfUsers, 0);
}
void Application_End(object sender, EventArgs e)
{
}
void Session_Start(object sender, EventArgs e)
{
int n = Convert.ToInt32(Application["numOfUsers"]);
n++;
Application["numOfUsers"] = n;
}
void Session_End(object sender, EventArgs e)
{
int n = Convert.ToInt32(Application["numOfUsers"]);
n--;
Application["numOfUsers"] = n;
}
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
hi
i need code example to read from excel file
lets sat col F and row 10
i need it in C#
eyalso
|
|
|
|
|
An easy way of accesing an execl file is through OleDb. Thake this article as a start point Accesing Excel Through OleDb[^].
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Hi...
Is it possible to make some kind of control
when the App starts; to check if framework is
installed? and if not maybe send to a download
page?
Thanks
QzRz
|
|
|
|
|
I think it isnt possible..
The application needs the framework to ran and if it isnt installed
on the machine you can check nothing..
If someone know the way to do this it will be great!
Enrico
|
|
|
|
|
The best (read easiest) way to do this is to create a Deployment Project for the application. VS will include a default system check for the .NET X version that you need and, should it not exist on the target machine, will prompt the user to download the .NET Framework.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I am hacking together a program to manage the scheduling for software-development projects. I got a great method to manage the work breakdown structure, but the datagridview won't show me an expandable tree structure when I got a table with a recursive structure.
Anyone have any clue what happend to the expandable structure that used to be available in the datagrid from .NET 1.1??
WM.
What about weapons of mass-construction?
|
|
|
|
|
Differences Between the Windows Forms DataGridView and DataGrid Controls [^]
"... The only feature that is available in the DataGrid control that is not available in the DataGridView control is the hierarchical display of information from two related tables in a single control. You must use two DataGridView controls to display information from two tables that are in a master/detail relationship."
The DataGrid is still available to use if you really need this, but then you lose all the handy new features of DataGridView .
Charlie
if(!curlies){ return; }
|
|
|
|
|
Ok, I think I'm going to use the DataGridView. The users can also see by the tasknumber how deep the task is nested. (The tasknumbers have a format that looks like this: 1, 1.1, 1.1.1)
WM.
What about weapons of mass-construction?
|
|
|
|
|
hi friends
i need your help (to write a program in C#)
i want to go this site :
http://today.reuters.com/stocks/Overview.aspx?ticker=msft
and to save the information about the stock (for example Last Trade: $27.76,
Trade Time: 1:00 PM ET ,Change: -0.57% ,Prev Close: $27.92 ,Open: $27.80 ...)
lets say i want to save it in access or sql server
thank you
Eyal
eyalso
|
|
|
|
|
Hi.
I put some label controls with text on a form and then I drew some lines on the form. Only part of the labels can be seen on the screen and to see some of lowest ones the user needs to scroll down. The lines outside of the visible clientarea don´t get drawn and when I scroll back up again the lines that were visible at the upper most part of the form are no longer visible! Why is that? I did try to use this.ResizeRedraw = true; and then this.CausesValidation = true; but it doesn´t fix the problem. I would like all of the lines I draw to be visible when the user scrolls up or down. Can someone please help me?
Thanks,
FJ
|
|
|
|