|
then why i cant transfer string object by ref ? it's only transfers by val
|
|
|
|
|
strings (and almost all structs) are immutable, when you think you modify a string, you are actually replacing it by a new string. Most objects are not immutable, so you can pass Forms and Controls and Dictonaries around, modify them, and have the caller see your modifications without limitations.
|
|
|
|
|
Damn, I need to type faster
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: I need to type faster
yes.
or start sooner.
|
|
|
|
|
Too simple. I'll just issue a DoS attack on your servers to prevent you from posting
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
That won't work either, CodeProject just tried that, and all they got was more messages. See my sig.
|
|
|
|
|
As Luc pointed out objects passed by ref are able to be modified. This is because you are working with the memory location of the actual object. Since a string is immutable any time it is modified an new one is created which points to a new memory location, not the original that may have been passed to the method.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i see...
then i need to wrap this string with other object list for exmp, and to pass list to the thread, after creating new string, return it with the "ref" list, am i right ?
|
|
|
|
|
If you mean to create some object that contains the string and passing it around, then yes, I believe that will work for you. Although more levels of abstraction does not improve anything. Possibly you could re-engineer the code so it is not necessary?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
it did work for me...
and yes, i can re-engineer the code, but it means that i will work in single thread mode... i wanted to practice on multithreading...
|
|
|
|
|
Re-engineering doesn't necessarily mean you have to give up on multithreading, just use it differently
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have 2 forms.
both are loaded.
i wanat with click in Datagrid cell string display in Text box in Other FORM
hoW can i do?
|
|
|
|
|
Raise an event in the form that has the DataGrid in it, and subscribe to the event in the other form.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
If I had received a penny everytime this question was asked here...
|
|
|
|
|
It should be in the FAQs !
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
Simulation domain name server resolution
Its riches action.
Request : Middle exchange item of newss client and server according to just protocol DNS
Server can resort to help of domain name lysis by command gethostbyname và gethostbyaddr
dragon_cntt@yahoo.com
send mail !!!
|
|
|
|
|
Never post your email address to any forum, unless you really like spam!
If anyone here want to contact you, you will receive an email (just like this one) when they reply to you, or they can send you an email without exposing your email address via the "email" button at the bottom of each message.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I doubt you're going to get an answer for this question. I can't understand what it is you're talking about nor what the error is norwhat your code is supposed to be doing, nor what you want it to do, nor how this relates to C#...
|
|
|
|
|
I have found this sample in C# and I was hoping that some one could tell me the equivalent code in VB.
I have tried the converters and they do not know how to handle it.
This works correctly in C#
Task.Factory.StartNew(delegate
{
for(int iJJ = 0; iJJ < 100000; iJJ++)
{
}
});
Thank you for your help.
Humble Programmer
|
|
|
|
|
while converting it with the help of : http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
I got this solution and a error:
Solution:
01.Task.Factory.StartNew(Function() Do
02. For iJJ As Integer = 0 To 99999
03. 'DO somework...
04. Next
05.End Function)
Error: line 2 col 12: VB does not support anonymous methods/lambda expressions with a statement body
|
|
|
|
|
Hi Friends,
I have written a code to send email using c# and .net.
Now my aim is to create a software for email marketing i.e send emails to bulk recipients sending advertisements of certain products of companies to various customers.
So to accomplish this i want to create templates where the newsletter can be created.
Can anyone help me with the creation of templates.
any useful resource is also ok.
Thanks in advance
|
|
|
|
|
You can use XSLT files as a email template, and using XslTransform class by passing content(dataset/xml) you can transform it to mail content.
Try to google this, you will definitely find some samples on this.
I found one on CP.
Email Template using XSLT and XSLTArgumentList[^]
Regards,
Prakash Kalakoti
|
|
|
|
|
Thanks a lot dude....
If u get anything more info about this,please do update.
Thanks once again
|
|
|
|
|
problem to show my project icon at taskbar icons with c#
|
|
|
|