Debugging scheduler user code

Follow these steps to create the project, add files to the project, modify the project settings, and run the project:

  1. Start Microsoft Visual Studio. Select File/New Project.
  2. Select Win32 Project and give the new project a name.
  3. Choose to create a new solution and click OK.
  4. Choose to create an empty DLL project and then click on Finish.
  5. Select Project/Add Existing Item.
  6. Add your .C files.
  7. Add the USER.DEF file from the same directory.
  8. Add the following .LIB files from the USERCODE directory: aps_sim.lib, aps_susr.lib, aps_ulib.lib, and aps_util.lib
  9. Select Project/Properties and then the C/C++ tab.
  10. For the Category, select Preprocessor.
  11. For the Additional include directories edit box, type in the full path to the USERCODE directory.
  12. Add the following to the Preprocessor definitions: UNICODE,_UNICODE,_WIN32,SYTEAPS,_AFXDLL,_DLL.
  13. Select the Link tab.
  14. For the Category, select General.
  15. For the Output file name edit box, type in the full path and USER.DLL. For example, if your database is called MYDB, you would type: C:\Program Files\Infor\APS\Scheduler\USERCODE\MYDB\USER.DLL .
  16. Select the Debugging tab.
  17. For the Category, select General.
  18. For the Executable for debug session, enter the full path to APS_BATS.EXE. For example: C:\Program Files\Infor\APS\Scheduler\APS_BATS.EXE .
  19. For the Working directory, specify the directory where APS_BATS.EXE is located. For example: C:\Program Files\Infor\APS\Scheduler .
  20. For the Program Arguments, enter a line that looks like the following (substitute your User Id, Password, Server name, Database name, and the correct alternative number): The only space should be in front of the alternative number. For example: UID=me;PWD=mypassword;SERVER=myserve;DATABASE=mydb; 0 .
  21. Select OK to accept changes.
  22. To run the project, select Build/Build <project name>. You should not see any errors.
  23. Click on the FileView tab and expand the Source Files item.
  24. Double-click on the file name you want to debug.
  25. Click on the line where you want the code to stop and then click on the hand icon to Insert/Remove Breakpoint(F9). This will set a breakpoint on this line.
  26. Select Debug/Start Debugging. The Scheduler will start running and pause when it reaches your breakpoint.