How to run a DirectX Game through Command Prompt

10may 1 Reputation point
2020-06-19T14:22:18.4+00:00

I have a program for DirectX, written in C++. I have compiled it through Visual Studio, but I want to run that program through the Command Prompt. I tried to run a Sample Direct3D Game from the Command Prompt just to be sure, but it did not work either. This Game works fine when I build it from Visual Studio 19 or Visual Studio 17, but I am not able to run it from the Command Prompt. Everytime I do, a window pops up with the following message.

The code execution cannot proceed because MSVCP140D_APP.dll was not found. Reinstalling the program may fix this problem.

The same message is displayed about vccorlib140d_app.Dll, CONCRT140D_APP.dll, and VCRUNTIME140D_APP.dll. However, I face no such issues when running the same program through Visual Studio. I have tried almost everything that I could find about this issue, but I could not solve it. The .exe file that I tried to run, is in the path:

..Direct3D_game_sample\cpp\x64\Debug\Simple3DGameDX

I also tried running a simple OpenCV program written in C++ to read and display a sample video file, but could not do so either. It runs perfectly through Visual Studio, but not through the Command Prompt. The OpenCV program returns the following errors.

warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:940)
warning: vtest.avi (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:941)
OpenCV(3.4.9) Error: Bad argument (CAP_IMAGES: cannot find starting number (in the name of file): vtest.avi) in cv::icvExtractPattern, file C:\build\3_4_winpack-build-win64-vc15\opencv\modules\videoio\src\cap_images.cpp, line 246
[ERROR:0] VIDEOIO(cvCreateFileCapture_Images(filename.c_str())): raised OpenCV exception:
OpenCV(3.4.9) C:\build\3_4_winpack-build-win64-vc15\opencv\modules\videoio\src\cap_images.cpp:246: error: (-5:Bad argument) CAP_IMAGES:cannot find starting number (in the name of file): vtest.avi in function "cv::icvExtractPattern";

PS: I am running Windows 10 on my machine and the Sample DirectX Game App uses DirectX 11.

Thanks in advance

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Patrick 426K Reputation points MVP
    2020-06-19T14:25:28.89+00:00

    C++ is not currently supported here on QnA. They're actively answering question in dedicated forums here.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral

    https://developercommunity.visualstudio.com/spaces/62/index.html

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.