开发者

Best way to create a standalone-exe (Forms) (C++)

I have to create an application for testing that is relatively simple. If a user plugs in a device into a USB (hid library), the form will say "Pass". If no device is detected, it will say "Fail".

I want to create the app to run on WinXP+. It must be a forms application as it needs to be visual and have colors. The biggest requirement for me is that it must be stand-alone (a user just double clicks, the file and it opens, no installation). I need to avoid installing any extra .dll files and want to avoid the .net framework all together. It has to be written in C++.

So my question is, what are my options? I am new to Forms applications and the only 开发者_如何学Pythonforms application I have written required the .net framework.

From my research, Visual C++ seems out of the question as it requires .net for Forms apps. What about Turbo C++ by Borland? It seems outdated, but can it do the job?


I would suggest Borland C++ Builder 5 or 6. Visual C++ lacks the functionality to create C++ form apps, if we dismiss MFC


I'd say Visual C++ would probably still be your best option. A standard simple Win32 C/C++ program using only the native API will should suite your needs just fine. If you're targeting XP+, then the only dependency would be "msvcrt.dll" which is included with Windows by default.

Edit: This article on MSDN should get you started in the right direction.


What you're talking about is C++/CLI, it's microsoft's dialect of C++ that requires a .Net framework. Please distinguish it from real (native) C++, which can be used to create what you want to. Visual C++ is perfectly fine, just make sure you don't create a .Net project.


Forms are a .NET library. It's not Windows or anything like that, you can use the native GUI libraries in Win32 with no problem or any native wrapping of them. You can implement this in native C++ easily in Visual Studio.


If you're looking to create the application in a rapid fashion (i.e. stock UI components that you can drag and drop onto forms), my experience is that Embarcardero C++ Builder effectively solves that problem space.

I like Visual C++ but it's not a great environment for rapidly creating forms based applications. I want to emphasize that I'm referring to Rapid Application Development (RAD) tools. There are plenty of great C++ IDEs and libraries for creating forms based applications and all of them should be able to create standalone exes.

Here is a list of related questions that might help in your decision:

  • https://stackoverflow.com/q/1754020/4916
  • https://stackoverflow.com/q/93326/4916
  • Best C++ IDE or Editor for Windows
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜