|
|
|
|
|
|
|
|
|
|
|
|
|
|
Develop free Windows software for Domino with Borland (continued)
Now create a directory for my sample code and copy the .cpp, .h and .mak files in there. I used c:\projects\chksrv\ for the first utility and c:\projects\tellsrv\ for the second. The "make" files (ending in .mak) that I've written to compile and link these programs have been modified from the Lotus ones. I found the ones in the C++ API 2.1 Toolkit didn't seem to work with the Borland 5.5 compiler, and I suspect they were intended for an earlier version. You'll need to edit the make files using Notepad, but only to modify the four lines that tell the compiler the paths you've used to install your software. These are the lines starting LIB, INCLUDE, BCC55COMPILE, and BCC55LINK near the top of the file. You'll see that I installed my compiler to the directory c:\program files\bcc55 and the Lotus C++ 2.1 toolkit to c:\lotus\cppapi so if you have chosen different paths, please change the four lines appropriately.
Open a Command Prompt window and change to the directory of the first utility using the command cd\projects\chksrv. Now type:
c:\program files\bcc55\bin\make -f borwin32.mak
|
The program should then compile and link. You may get a couple of warnings, but hopefully no errors. The reason you have to type the full path for the make utility is that you haven't put the compiler program directory c:\program files\bcc55\bin into the system path. It's not necessary to do this, but if you write a lot programs, it might be worth it to save yourself some time.
Testing your new programs So now you can test out the chksrv program. Copy the chksrv.exe file to the program directory of your Notes R5 client. In my case, it's c:\lotus\notes. Now go to the Lotus C++ toolkit and copy the lcppb21.dll file also to the Notes program directory from c:\program files\bcc55\lib\borwin32 as the API programs need this DLL to run. In your Command Prompt window use cd\Lotus\Notes to get to the place you copied the programs to and type:
Use the common name of one of your servers in place of "yourserver". The program should now check this server every 10 seconds and report how long it took to respond. To end the program, press any key on the keyboard.
Now test the tellsrv program. Compile it in the same way as the chksrv program and copy the tellsrv.exe file to the Notes program directory. In the Command Prompt window type:
tellsrv yourserver "show tasks"
|
The server will respond to your command just as if you were using the remote server console in the administration client.
The tellsrv program is different from chksrv in that it uses C API function calls as well C++ API calls. To enable this, the makefile links an extra library called notes.lib into the program that Lotus supplies with the C++ toolkit. The C++ API contains a function to issue remote server commands, but it has a fatal flaw. The C++ ExecuteServer function returns the server's response into an LNString object. LNString is limited to 64K, and this causes an error if you type "show tasks" on a busy server because the response has more than 64K of text. To get around this, I copied the sample code from the Lotus C API toolkit for the NSFRemoteConsole function instead of ExecuteServer. It works just fine, and this ability to use functions from both toolkits gives you the widest possible access to the inner workings of Lotus Notes and Domino.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|