Home > Software engineering >  Novice c problem for help
Novice c problem for help

Time:10-12

I want to write a program, its function is: after receiving serial command to play video, had better have a interface, play the video I want to directly through the CMD call player playing computer, I want to use c + + to write, don't know what a great god, how do I get started

CodePudding user response:

WinExec
The 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,//the address of the command line
UINT uCmdShow//window style for new application
);

The 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 The 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 to the and is 2 supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of 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.
The 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:

The Value a fancy
0 The system is out of memory or resources.
ERROR_BAD_FORMAT The. EXE file is invalid (non - Win32. EXE or error in The. EXE image).
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.


Few
In Win32, the WinExec function returns when the started process calls To the GetMessage function or a time - out limit is reached. To get waiting for time out delay, call the GetMessage function as soon as possible In any process started by a call To WinExec.

See Also
The Processes and Threads the Overview, the Process and Thread Functions provides the CreateProcess, GetMessage, GetSystemDirectory, GetWindowsDirectory, LoadModule, ShowWindow


CodePudding user response:

Written in dazzle colour interface library, an interface program, then your serial port after receiving the data, the data is BMP bitmap, then sent to the window, and then to draw display window

CodePudding user response:

First establishing a serial port connection CreateFile and ReadFile then to judgment or the received data (which play video), can use WinExec

CodePudding user response:

Since the novice, questions are separate, concrete is a serial port don't understand, what do not understand, or clear,
  • Related