|
While calling the method, pass the 'reference' variables as
SomeMethod(ref varInput);
Then in the definition of the Method u have to use the same reference variable as,
public void SomeMethod(ref varInput)
{
//Give ur implementation here.
}
Regards,
Murali
|
|
|
|
|
the method has allready being deployed in vb6.o
in vb 6.0:-
public function somefunc(ref variable as string)
variable = "XYZ"
end function
in C# i have given reference to this class and function and created a Runtime callable wrapper.
IN c#
object.somefunc(ref csharpvar)
bharath.s
|
|
|
|
|
Make sure you are using the correct namespace.
|
|
|
|
|
maybe this?
IN c#
string csharpvar; //var must be declared first
object.somefunc(ref csharpvar)
|
|
|
|
|
Hi, Im trying to create a C# program that will compute the exact number of months between two durations.
This is my code
TimeSpan duration = startTime - stopTime;
//to compute the difference between days, I use this code
int result = (duration.Days);
unfortunately it stops with duration.Days.. there are no available methods that will compute the months or years (eg. duration.Months , duration.Years)
i tried to compute the days and divide it by 30, but this approach is highly innacurate.
Hope you guys can help
tnx
|
|
|
|
|
|
Hi harini. Thanks for the reply. Ive read the link, but it doesn't mention anything about getting the difference between two dates in months :c
Hope you have other references..
tnx!
|
|
|
|
|
Hai! everybody,
I want to get all the running tasks in my windows os.
Plz give me an hint
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi!
You can use the Process class.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Directly u see the Task manager.. or in a .net frame work means Process option is there la.. Its wright take it or u got correct ans intimate me..
Regards..
Maldeeban.R
Hi i am working as a software engineer.. this code project site articles is very usefull for us.. I am very interst to read this articales..
|
|
|
|
|
It is giving the process name i.e Winword but i want to display the tasks as in task manager and i would like to start or stop the tasks even though it is running in the client machine
I tried the Service Controller class also it is giving only the windows services
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hello Friends ,
I have a situation here , i have a com component (DLL) which is created in VB , i am accessing the dll in C#.Net .
The problem here is i have parameters to which are optional, but in c# while accessing it is giving me message saying that parameter is mandatory.
Example:-
vb6.0
Public function operation(byval a as integer,byval b as integer, optional symbol as string)
dim output as integer
case symbol
when "+"
output = a+b
when "-"
output = a-b
end case
endfunctin
i am calling this function in C#.
Here the symbol is optional . how i have to hadle the situation?
Thanks in advance.
Bharath.S.Ron
|
|
|
|
|
Hello!
In this case you'll have to use Type.Missing for the optional parameters you don't want to fill in.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I was wondering if there was any difference between the following code:
<br />
public void LoadAll()<br />
{<br />
obj x;<br />
StaticClass.DoSomething(x);<br />
}<br />
<br />
public void LoadAll()<br />
{<br />
obj x = StaticClass.DoSomething();<br />
}<br />
Are there any pros and cons to either of these? Are there any concerns with thread safety?
-- modified at 22:55 Sunday 3rd June, 2007
|
|
|
|
|
Any concerns you may have remain the same in either case, ultimately I'd go with the second for clarity, but so long as it's all running in the same thread, which it is here, I don't see any thread safety concerns. The second approach does allow the method to create the object whenever it likes, the first means it always exists.
The first would be better represented with the out keyword, seeing as you expect the value to be assigned, and not just read. Stupid C# doesn't have const, but you can make your code clear by using the out keyword.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want the reference for the charecter input system function code which is simmilar to windows operating system.
Please provide me the reference
Help Ever Hurt Never
|
|
|
|
|
You've asked this several times now. Surely you realise that anyone who knows what the windows code is, probably isn't allowed to show it to you ?
Even if I had the Windows source, and was able to share it, I would honestly have no idea what part of it you want to know about, based on how you word your question. You want to know how the textbox works ? How the keyboard is monitored ? How the console shows key preses ? I have no idea.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What is the best way to save currently opened PDF file as image in sql database?
|
|
|
|
|
Look the TEXTPTR function in SQLServer's help.You may find the answer.
|
|
|
|
|
do you mean as a bitmap, or as a binary file ? SQL Server doesn't care what the file type is, it just stores the bytes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is there a way to use Detours (http://research.microsoft.com/sn/detours/[^]) with C# ?
I tried to load the dll directly to C# project and it faild.
I could write the project in C++ and solve this issue (i'm new to C#), but would rather do it in C#, so i be able to integrate CScript engine to my project.
|
|
|
|
|
The way to call methods in a C++ dll from C# is pinvoke. www.pinvoke.net has heaps of examples of calling existing Win32 APIs, which should give you a clear idea of the syntax required.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I understand why the "Main" method needs to be in a class. But it appears that the name of that class can be pretty much anything! Is there some generally accepted name that is used most frequently for the "Main" containing class? I guess C# will find the "Main" method no matter what - yes?
|
|
|
|
|
SPRC wrote: I guess C# will find the "Main" method no matter what - yes?
Yes, and typically, the point is that you don't need a class just to have that main method in there, it gets added usually to the first form class that is shown by your app.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can I get information about user that is currently log on on windows Xp through web.
i.e A user access a particular page 'XYZ.com' then in response the page opens with user name 'ABC'
|
|
|
|