|
Hi,
I have one problem I tryed to use method invoke to ...invoke some methods, in case I need to store by ref paramteter in object[] array, normally when I call MyFunction i set ref argument so it looks like that: MyFunction(ref MyObject) now I cant and if I set MyObject without ref argument it report me an error. Maybe someone has trayed to use tRfcInvoke in .NET SAP Connector to invoke RFC function with SAPTable as reference parameter or encounted this kind of problem in other projects?
Thanks in advance.
best regards,
Osin
|
|
|
|
|
Assuming you are using MethodBase.Invoke[^], the MSDN[^] documentation says that you don't need any special attributes for ref parameters.
"If the method or constructor represented by this instance takes a ref parameter (ByRef in Visual Basic), no special attribute is required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type."
|
|
|
|
|
hi, thx a lot it looks like it's intenral problem of sap connector function when I used MethodInfo from .net framework its work fine.
br,
Osin
|
|
|
|
|
I recently released a program that uses the WMI service. A small percentage of users had turned that service off for some reason, and as a result my app CTD'ed with no warning to the user.
I would like to be able to test that WMI is available, and if not warn the user about the need to activate it.
What's the best way to do this?
|
|
|
|
|
Stick^ wrote: I would like to be able to test that WMI is available
Your post is not specific. One way to interpret it is that you want to see what is running on other peoples computers... but that would just be a guess.
led mike
|
|
|
|
|
It's fairly simple to do, and you can even start it programatically if need be, here's a small snippet that starts a service not running (you'll need to add proper error checking).
string serviceName = "SomeServiceName";
ServiceController sc = new ServiceController();
sc.ServiceName = serviceName;
if (sc.Status == ServiceControllerStatus.Stopped)
{
sc.Start();
sc.WaitForStatus(ServiceControllerStatus.Running);
}
A little more searching on the ServiceController class, and you'll see what else you can do with services.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Thanks for the tip. I'll take a look at that class.
Patrick
|
|
|
|
|
Hi all
can anybody help me how to create a hyperlink in one worksheet and it should link to another cell in another worksheet in same workbook ...
i tried hyperlink.add method(interop.excel) .. but i am not getting the parameters correctly ...
thanks in advance
Akhil
|
|
|
|
|
Hi,
How to put checkbox in datagrid through DataGridColoumnStyle.
Plz help me.
|
|
|
|
|
I am creating an email using C# and I want to go to the next line or skip two lines on my email body.
How do I do this. Thank you.
|
|
|
|
|
you should be able to use Environment.NewLine
OR may be \r\n also should work for you!!
- ashish
|
|
|
|
|
How does this work?
I use
this.Send("wow@yahoo.com","yyy@yahoo.com","Copier Completed" + "Nice one");
to ":wow@yahoo.com
From : yyy@yahoo.com"
Body : Copier Completed
Nice one
|
|
|
|
|
this.Send("wow@yahoo.com","yyy@yahoo.com","Copier Completed" + "\r\n\r\n"+ "Nice one");
|
|
|
|
|
In C# 2005 DataGridView, I have a comboboxcell that is populated with a list of values from a datasource. However, I simply want the user to be able to enter an item not in the list. The DataGridView always throws the DataError event and doesn't put the text in the cell. Any way to get around this?
I've tried setting the EmptyOnInvalid property in the InitializeEditingControl method of a custom cell class. But this does not work.
|
|
|
|
|
I'm a new man in .Net, I need to ask a question.
When I programming to the C# form, after a text control's text be changed, I need to check if the input text are illegal, and prompt to re-input it, and after checked the text, I need to changed the text to a formal text, such as changed '1' to '0001','2' to '0002', and after this operation, the TextChanged Event is fired again,but I don't need it happen.
Could the Windows Event know if the changed event is fired by the user or programming, and only response to the user keybord operation, and if the programming changed the text, no response?
marioDai
|
|
|
|
|
You could unregister the event handler before changing the text and reregister it afterwards.
void textBox1_TextChanged(object sender, EventArgs e)
{
...
textBox1.TextChanged -= new EventHandler(textBox1_TextChanged);
...
textBox1.TextChanged += new EventHandler(textBox1_TextChanged);
}
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Having try...finally around this to ensure the event is rebound correctly would also be a good idea.
|
|
|
|
|
Deal with the formatting and checking in the Validation event. Changes made to the text there do not fire the textchanged event.
You can do something like
if (entryisvalid())
{
textbox.color=color.black;
textbox.text = doformatting(textbox.text);
}
else
{
textbox.color=color.red;
messagebox.show("your input is invalid, please correct the entry in red");
}
|
|
|
|
|
I am creating a log file and I want its name to be a current date eg. 080820061350PM.text which is 08/08/2006 13:50.
How do I create this file name?
Please help me.
|
|
|
|
|
Specify the format when you convert the date to a string:
DateTime.Now.ToString("MMddyyyyhhmmtt") + ".text"
or
DateTime.Now.ToString("ddMMyyyyhhmmtt") + ".text"
depending on if you are using a day/month or a month/day format.
I would suggest using a format based on the ISO 8601 standard instead:
DateTime.Now.ToString("yyyyMMddHHmm") + ".text"
One distinct advantage with this format is that the files will be sorted correctly.
---
b { font-weight: normal; }
|
|
|
|
|
Allow me to second the suggestion for the "yyyyMMddHHmm" format. I have used this in user-file generation, and have gotten much positive feedback because of the sorting. You might even do "yyyy'-'MM'-'dd'-'HH'-'mm", to split things up for users.
|
|
|
|
|
DateTime.Now.ToString("ddMMyyyyHHmm") + ".text"
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all, I had this problem yesterday aswell.
I have, lets say a HTML file, that i want to send directly to the printer. Is it possible, i've been googleing all morning and found other developers asking the same question but no answer as yet.
i read something about a printDialog tool in the .NET toolbox and i'll go read up on it further just now...
Some one mentioned something yesterday about:
this.PrintDocument1.PrintPage += new PrintPageEventHandler(this.printDocument1_PrintPage);
this.printDocument1.Print();
i checked the help file not shure how to use this yet but i'll look into it. If any one has an example.
Lets say the file i want to print has the name: "C:\Reports\OpenInvoice.HTML"
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
|
the following is a xml file from which i have to get appraisal.xsn to a string can anyone plz help
<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.20" productVersion="11.0.5531" PIVersion="1.0.0.0" href="file:///C:\Documents%20and%20Settings\abc\My%20Documents\appraisal.xsn" ?>
<?mso-application progid="InfoPath.Document"?>
<my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-08-03T09:08:02" xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<my:Name>Sreejith Madhavan</my:Name>
<my:Designation>PM</my:Designation>
<my:DOJ>30-11-2005</my:DOJ>
<my:Appraiser>Ashiq</my:Appraiser>
</my:myFields>
Vipn
|
|
|
|