When the software starts, it automatically modifies the IP address, which can be automatically called
Overload the InitInstance () function in the project ForcePlate.cpp, and add the initialization function
ShellExecute (NULL, _t ("open"), _t ("1.bat"), NULL, M_strexepath, sw_show);
1.bat File: (Modify IP)
netsh int ip set addr name= "Local Area Connection" Source=static addr=192.168.2.3 mask=255.255.255.0
2.bat file: (Restore)
@echo off
netsh interface ip set address "Local Area Connection" DHCP (//p: "DHCP" is set to obtain an IP address automatically)
netsh interface ip set DNS "Local Area Connection" DHCP
Need to be processed at exit, then overloaded virtual function exitinstance ()
ShellExecute
The function of ShellExecute is to run an external program (either open a registered file, open a directory, print a file, etc.) and have some control over the external program.
BAT file Learning and use: http://jingyan.baidu.com/article/e8cdb32b61e98437052bada9.html
Automatically set the IP BAT file virtual function overload