我想寫一個程式,它的功能是:接收串口指令后去播放視頻,最好有個界面,播放視頻我想直接通過cmd呼叫電腦播放器播放,我想用c++去寫,不知大神有什么建議,我該如何著手呢
uj5u.com熱心網友回復:
WinExecThe WinExec function runs the specified application.
This function is provided for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.
UINT WinExec(
LPCSTR lpCmdLine, // address of command line
UINT uCmdShow // window style for new application
);
Parameters
lpCmdLine
Pointer to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, the system searches for the executable file in this sequence:
The directory from which the application loaded.
The current directory.
The Windows system directory. TheGetSystemDirectory function retrieves the path of this directory.
The Windows directory. TheGetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
uCmdShow
Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of theShowWindow function. For a non-Windows – based application, the PIF file, if any, for the application determines the window state.
Return Values
If the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values:
Value Meaning
0 The system is out of memory or resources.
ERROR_BAD_FORMAT The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
Remarks
In Win32, the WinExec function returns when the started process calls the GetMessage function or a time-out limit is reached. To avoid waiting for the time out delay, call the GetMessage function as soon as possible in any process started by a call to WinExec.
See Also
Processes and Threads Overview, Process and Thread Functions, CreateProcess,GetMessage,GetSystemDirectory,GetWindowsDirectory, LoadModule,ShowWindow
uj5u.com熱心網友回復:
用炫彩界面庫,寫成一個界面程式,然后你的串口收到資料后,資料是bmp位圖,然后發送給視窗,然后視窗進行繪制顯示uj5u.com熱心網友回復:
首先建立串口連接 CreateFile 然后ReadFile 然后對接收的資料進行判斷或者處理 (播放哪一個視頻) ,用WinExec可以uj5u.com熱心網友回復:
既然新手,問題就分開問,具體是串口不懂呢,還是什么不懂,說清楚。轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/128939.html
標籤:界面
