Click here to Skip to main content
15,312,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
EnumChildWindows GetDesktopWindow, _
AddressOf EnumChildCloseup, ByVal 0&

I have this api function and i want to convert it to c#;
i dont know what 0& means ?

and how to convert it to c# .

i tried int value with zero but still got error

help me .

thanks a lot.
Posted
Updated 24-Sep-13 5:24am
v3
Comments
[no name] 24-Sep-13 11:27am
   
If you need to use GetDesktopWindow then you need to P/Invoke it. 0 in VB6 is still 0 in C# no need to "convert" it.

It does not make much sense. The concepts are too much different. Even the "volume of the scope" of this technologies are different: .NET is very much self-contained and reach, and VB6 is… forget it :-). I would rather call it "anti-technology". :-)

However, in principle, you could try something. First, try to migrate from VB6 to VB.NET. See for example, this CodeProject article:
Upgrading VB6 to VB.NET[^].

As soon as you have more or less adequate results (which is a very questionable problem), you can further formally translate VB.NET to C#. This step will create no problems at all and can be done fully automatically. Please see my past answers:
COde Line Interpretatio of C# to VB.NET[^],
Need to convert vb code to c#[^],
FixedPage to ContentPage convert c# code into vb.net[^],
Source Code from a exe[^].

I would specially emphasize that very comprehensive high-quality off-line translation method based on the use of open-source ILSpy, please see the answers referenced above.

However, I would hardly advice to go for it, but it might worth trying. The first step (VB6 to VB.NET) would be a great problem, not anything else. In most cases, you would be better off by creating a project from scratch, based on good .NET knowledge. You VB6 code would be then used only as a reference. Also, you would have a chance to avoid reproducing the old bugs.

—SA
   
Comments
Aydin Homay 24-Sep-13 15:27pm
   
Good job Sergey ;-)
Sergey Alexandrovich Kryukov 24-Sep-13 16:50pm
   
Thank you, Aydin.
—SA
Aydin Homay 25-Sep-13 1:01am
   
+5
   
Thank you, Aydin.
—SA
Maciej Los 24-Sep-13 15:55pm
   
+5!
Sergey Alexandrovich Kryukov 24-Sep-13 16:50pm
   
Thank you, Maciej.
—SA
eng.iris 24-Sep-13 19:04pm
   
thanks alot _SA
but i guess this so long solution for me cuz i have convert it my self but i have adoubt wth byval 0& what does it means and how to do it in c#

but i enjoyed reading and ur typical idea allot :)


thank you
Sergey Alexandrovich Kryukov 24-Sep-13 19:10pm
   
You are welcome.

Long solution or not, depends on the state of original project and its complexity. If you say it's too long, I guess you know better. Actually, I suggested two variants and generally advise the second, "manual" one, but it again depends on the same factors. Anyway, there are no shortcuts; yes, I'm sure.

Good luck, call again.
—SA
Quote:
Anyway, there are no shortcuts; yes, I'm sure.


i guess so

i will try it
thanks again and again
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900