我如何使用C#开发Win32应用程序? [英] how can i develop win32 application with c# ?

查看:68
本文介绍了我如何使用C#开发Win32应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想使用不带.net框架的C#开发应用程序,并且想使用Win32 dll?

我可以这样做吗?

Hi everybody,

I want to develop an application with c# without .net framework and I want to use win32 dlls?

Can I do it?

推荐答案

非简单答案是的,您可以这样做. Mono项目不使用.net框架,而是.net的端口,并且可用于Windows.它的主要问题是它落后于.net,并且由于最近的主要开发团队被解雇,该项目本身目前正遇到麻烦.如果它还不支持COM访问,则可以自己实现.

您还可以考虑跨网 [ ^ ]将.Net程序集编译为ANSI c ++.

另一个选择是让您编写自己的c#编译器并重新实现框架中已经可用的类库.所需的精力将是巨大的,但在理论上是可能的.

就个人而言,我会和达莱克·戴夫(Dalek Dave)的答案一起去)).
Non-simple answer yes, you can do this. The Mono project doesn''t use the .net framework, being a port of .net, and is available for windows. It''s main problem is it lags behind .net and the project itself is currently in trouble as the main development team was recently sacked. If it doesn''t already support COM access you could implement it yourself.

You could also consider cross net[^] which compiles .Net assemblies into ANSI c++.

Another option is for you to write your own c# compiler and re-implement the class libraries already available in the framework. The effort required would be immense, but theoretically possible.

Personally, I''d go with Dalek Dave''s answer ;).


简单答案,不.

C#完全基于.NET框架.

对于您所需要的,也许是C ++的解决之道.
Simple answer, No.

C# is based entirely on the .NET framework.

For what you need perhaps C++ is the way to go.


您可以使用.Net的Win32 appy.例如:

You are able to use Win32 appy from .Net. example:

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int PostMessage(HandleRef hwnd, int msg, IntPtr param, IntPtr lparam);



这个简单的示例使您可以发布\重新抛出Windows消息.



This simple example will allow you to post\re-throw a windows message.


这篇关于我如何使用C#开发Win32应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆