Вопрос

I have file, lets call it document.doc, and I want to open it with MS Word or some other program (default). What would be solution (in C++ or Java) be?. I prefer Java but I will need C++ later, so I'm asking for both.

Это было полезно?

Решение 2

With C++ should be this: ShellExecute(0, 0, L"document.doc", 0, 0 , SW_SHOW );

Java: java.awt.Desktop.getDesktop().open("document.doc");

Другие советы

Java:

Desktop.getDesktop().open(file);

See Desktop.open(File) for details beyond:

Launches the associated application to open the file.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top