Home > Software engineering >  MFC same computer, different position, the operation error!
MFC same computer, different position, the operation error!

Time:09-24

Made up a dialog based socket MFC procedures, vs2015, debugging and running, can be normal I associated with the program of the whole folder, copy from one location to another location on the same computer, commissioning times wrong, "the Debug an Assertion Failed!" What reason is a great god, please?

CodePudding user response:

Suspended, bring up the stack a see will know that this normally only myself to debug

CodePudding user response:

Assertion errors, so you are looking for the place where an error, are you sure your resources on the two computers is consistent?
You may use the save resources for absolute path, but not to copy those resources to another computer,

CodePudding user response:

If you program in use is the relative path, still go wrong, it will have to take a look at your support library, are two different computer environment, there are some supporting libraries such as opencv kind of not all configuration?

CodePudding user response:

reference phenix2009 reply: 3/f
if you program in use is the relative path, still go wrong, it will have to take a look at your support library, are two different computer environment, there are some supporting libraries such as opencv kind of not all configuration?

A computer ah, wrong, so I presume that is the path problem, please check the application is using the absolute path

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

SetCurrentDirectory
The SetCurrentDirectory function changes The current directory for The current process.

BOOL SetCurrentDirectory (
LPCTSTR lpPathName//pointer to the name of the new current directory
);

The Parameters
LpPathName
Pointer to a null - terminated string that specifies the path to the new current directory. This parameter may be a relative path or a fully qualified path. In either case, the fully qualified path of the specified directory is calculated and stored as the current directory.
The Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Few
Each process has a single current directory made up of two parts:

A disk designator that is either A drive letter followed by A colon, or A server name and the share name (\ \ servername \ sharename)
A directory on the disk designator
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase. H.
The Import Library: Use kernel32. Lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also
The File I/O the Overview, the File Functions provides, GetCurrentDirectory


CodePudding user response:

Should be a handle to create is not successful, parameter is NULL, see "the Debug an Assertion Failed!" Superiors when the caller, way back is which handles or Pointers to NULL
  • Related