PDA

Click to See Complete Forum and Search --> : Vb6 --> .net


DJ_Catboy
Apr 15th, 2003, 06:37 AM
Hi,

I am a recent migrator to the .NET environment. I have hit a couple of small problems - hopefully somebody out there can help me?

In previous coding (VB6 to be exact) I made a lot of use of the windows API libraries (obviously). I have a lot of programs with a lot of these calls in. Now I would like to cross over to C# and I don't even know where to begin with using API's. Can you still use them? Does anybody know where I am going wrong?

Any help would be gratefully received.

Kind regards,
DJ

BrianHawley
Apr 26th, 2003, 04:10 AM
I would suggest that you try to avoid all use of the Windows API.

Any calls to the API will only work on Windows machines.

This rather defeats the philosophy and purpose of C#, which is that it is multi-platform.

If you must use API calls, make sure your code will fall back in a dignified way when run on a non-Windows machine.

Here is a link with an example of calling the API:

http://www.microbion.co.uk/developers/csharp/brwsfold.htm

DJ_Catboy
Apr 28th, 2003, 02:45 AM
Hi,

Thanks for the reply. This is very useful to know. Not what I wanted to hear but hey - are they really releasing the .NET framework for other platforms? That could be quite interesting!

Just one question - is there a .NET to get the Desktop Window's DC? (i.e. GetDesktopWindow() )?

Thanks for the example too - very useful...

DJ

CornedBee
Apr 28th, 2003, 03:04 AM
The language C# itself is cross-platform, but it depends on the framework. The mono project ( http://www.go-mono.org/ ) is porting the framework to linux, but they are experiencing difficulties because the whole framework is geared heavily towards windows (you wouldn't find a IWin32Window interface in Java, neither a HWnd property). And MS has submitted the entire .Net framework for patentation.