|
what defferences between:
public void function1() and
public object function1()
Thanks
|
|
|
|
|
hunghero wrote: what defferences between:
public void function1() and
public object function1()
The first one doesn't return anything, the second one returns an object reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
when should we use a function or an object?
Thanks
|
|
|
|
|
first you must understand some types of method
1. a method that doesn't have any returns and parameters, in C# i.e : void methodname()
2. a method that pass parameters by value, this method doesn't change the parameters value after execute i.e : void methodname(object par1[, ...object parN])
3. a method that pass parameters by reference. This method will change the parameters value after execute i.e : void methodname(ref object par1[, ...ref object parN])
4. a method that return a value with or without parameters (either pass by value or by reference) object methodename([object par[, ref object var]]
in some programming language these method are divided into two that is procedure and function. A Procedure (Sub in VB) is a method that doesn't have a return value. A Function is a method that returned a value.
hunghero wrote: when should we use a function or an object?
when you needed
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Seriously, pickup a beginners book on C# and work through it. You're asking questions that would be covered in the first couple of chapters.
|
|
|
|
|
Dave Kreskowiak wrote: Seriously, pickup a beginners book on C# and work through it.
Ditto that.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have two very simple report in my winform project.
Development machine is windows vista home premium, vs 2005 sp1 and crystal report sp1 for vs 2005.
I read the printer name from a config file and use that printer name in code
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
PaletteLabelPrinter is a string holding the printer name from config file.
When I deploy my app to server 2003 R2, I simple have an error for report printing if I have a different printer name at the server than at my development machine.
Crash (exeption) happening right at the line like below
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
Error is as follows
Error in File C:\DOCUME~1\alc.......... The request could not be submitted for background processing
Besides, even though I installed the crystal report sp1, vs2005 just stop running when I select from
menu as following
Crystal Report -> Design -> Printer Setup, do something change and press OK then VS2005 simple
stop working.
Please help
Thanks to everybody
Muharrem
|
|
|
|
|
Don't double post.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi everyone,
I have been researching this topic for a few hours now and have not found any good sources of information. Basically, I have a windows service and a windows form application. The winform app can control the service (start, stop, pause...). However, the service runs long processes, and I would like for it to report progress that can be displayed by the winform, when the winform is running. The progress should be reported by raising events that the winform will subscribe to.
I know I will have to have a shared library that contains an interface or class that the server extends or inherits. I am not sure how to the whole thing would be structured though.
If anyone has any experience with this and can share a very simple example, I would really appreciate it. Links to related articles are also very welcome.
Thanks in advance,
-----------------
Picazo
|
|
|
|
|
Have you looked into .NET Remoting?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes. I would like to use the IPC channel since the service and the winform will live on the same machine. I have used IPC before, but never with winservices or events. That is the part that I would like some advice or assistance with.
Thanks,
-----------------
Picazo
|
|
|
|
|
|
I have an update which is further aggravating. If you open Outlook Express. Create a new message, then save the message, close the message and execute the message, you will see there is no "Send" button. We originally thought the issue was a problem with headers and might still be.
|
|
|
|
|
Is there any possibilites to customize the tooltip of the propertygrid. By default, when you hover it shows a horizontal box. I am looking to customize it so the words wrap up instead of a showing a long horizontal kind of tooltip.
thanks
|
|
|
|
|
netJP12L wrote: Is there any possibilites to customize the tooltip
Yes. However, the responsibility of customizing falls to software developers.
So for copy-paste drag n drop queens like yourself, no.
led mike
|
|
|
|
|
Ouch? Unwarranted? Am I missing something here?
|
|
|
|
|
EliottA wrote: Am I missing something here?
History. You can look at a members last posts ( like 200 or something) from in their profile page.
led mike
|
|
|
|
|
I tried looking for tooltip event but couldn't find. Is there any resource you could think of that might give me the right direction
Thanks
|
|
|
|
|
netJP12L wrote: Is there any resource you could think of that might give me the right direction
Starting from where? You don't appear to know anything and are incapable of using documentation to learn anything. You just come and post questions here. Maybe this might help[^], but I doubt it.
led mike
|
|
|
|
|
Guys,
I have a comnosle application that runs as a job in the middle of the night and displays the info via console.write line.
I have a question:
Is there any way to eather retrive what is written in the screen and write to a file or is there anyway to dump the content of the screen to a file without having to make many modification where ever I have console.write line
Please advice guys!
Thanks a lot!
|
|
|
|
|
|
I tried this at the very end of main thread but nothing got written
//here call a method that does console.write lines
//when done do the code below and file is empty
FileStream fs = new FileStream(@"c:\out1.txt", FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
Console.SetOut(sw);
sw.Close();
fs.Close();
Please advice with some more details
|
|
|
|
|
No the code to set the output stream must go in the console app itself.
|
|
|
|
|
here is my code
class utility {
[STAThread]
static void Main(string[] args)
{
ProcessRecords();
//here I placed the code for redirecting to output as above but it did not work. The function ProcessRecords does have some console.writeline statements
}
|
|
|
|
|
nesfrank wrote: here I placed the code for redirecting to output as above but it did not work. The function ProcessRecords does have some console.writeline statements
Except the Console.WriteLine() statements have already been written to the console You must do it before you actually do anything else. I suggest you move it to the beginning of Main().
Cheers,
Vıkram.
"You idiot British surprise me that your generators which grew up after Mid 50s had no brain at all." - Adnan Siddiqi.
|
|
|
|