Search DominoPower's 11,437 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Coding Domino server tasks in C: the adventure continues (continued)

ACLHelp doesn't break the normal rules of Domino security because it only works if you have administrator's rights to the system. If you can't already shut the server down remotely, you can't run ACLHelp. In fact it would be a good addition to the standard administration tools. Hmmm…maybe I should start a petition on behalf of all administrators.

To run ACLHelp, you need to install the naclhelp.exe (for Windows) program in the server program directory. To run it, you type the following on the server console:

load aclhelp docs\mydb.nsf Ian Cherrill/4NF

You'll find that Ian Cherrill/4NF is now an unspecified manager in the ACL of the mydb.nsf database, located in the docs folder.

ACLHelp source code
The source code can be found at http://www.4nf.co.uk/aclhelp, and you need to set up your compiler environment as described in last month's article. You must create the ACLHelp project and compile both the Win32 Debug and Win32 Release builds in MS Visual C++ 6.0 to make sure everything is working correctly.

By the way, if you're little confused by the error-handling code in these programs, you're not alone. When I first saw the following construct, I wondered what it meant:

if (error = NSFDbOpen (path, &hDb))
{
LogError (error);
return NOERROR;
}

Like a lot of C, there's a long way and a short way of writing the code. The error code returned is either zero (for no error) or a number relating to the problem. What the "if" statement does is execute the function and assign the error code to a variable called error and test the value of error all at once. And the statement:

if (error) ...

is the same as:

if (error != 0) ...

So it could be written as:

error = NSFDbOpen (path, &hDb);

if (error != 0)
{
LogError (error);
return NOERROR;
}

This is definitely more readable. However, I've adopted the shorthand that Lotus uses, so don't blame me!

Stepping through
Let's step through the ACLHelp program.

Build the code using the "Win32 Debug" as the active configuration. To run the program successfully, you must add some extra information to the Project Settings page under the Debug tab, as pictured in Figure A.

FIGURE A


You must add some extra information to the Project Settings page. Roll over picture for a larger image.

As you can see, under Working directory, you must specify "d:\notes" (or whatever your local Notes program directory is), and under Program arguments, you must specify "test.nsf, Mickey Mouse."

This tells the compiler to run the program from the Notes program directory (Domino server or Notes client) on your workstation. It also adds some test arguments that you would normally add on the console command line. Now in the Notes client, add a new database to match the program arguments called test.nsf using any design template you like. Check the ACL before you start so you know what's in it already.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > Access Control (7 articles)
   Forcing immediate indexes to actually update immediately
   Enabling and disabling the single login setting in Notes 6
   Coding Domino server tasks in C: beyond Windows
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Home > Microsoft Technologies > Visual C (2 articles)
   Coding Domino server tasks in C: beyond Windows
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
Adding Quick Highlighter support to IBM Lotus Notes Domino Wiki, Weblog, or Webpage
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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 --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login