simple.c

来自「通过Notes C API访问Notes数据库」· C语言 代码 · 共 51 行

C
51
字号
/*	Simple program to find the data directory using the Lotus C API for Notes/Domino
	
	Using main() as the entry point

*/

/* Include header files that we will need from the C library */

#include <stdio.h>
#include <string.h>


/* Include header files that we will need from the Lotus C API for Notes/Domino */

#include <global.h>
#include <osfile.h>


/* The main() function */

int main(int argc, char *argv[])
{

	/* Local variables */
	char        DataDir[256];		/* the data directory for Notes*/
	STATUS   error = NOERROR;       /* return type for most Lotus C 
									API functions for Notes/Domino - defined in global.h */
	WORD	wlength;				/* unsigned integer - defined in global.h */

	/* Initialize Notes/Domino runtime */

	if (error = NotesInitExtended (argc, argv))
	{
     printf("\n Unable to initialize Notes.\n");
     return (1);
	}

	/* Get the full path of the data directory which is returned by the OSGetDataDirectory() function in the text buffer 
	whose address is passed in as the arguement. The function return value is the length of the buffer returned */

	wlength = OSGetDataDirectory(DataDir);

	/* Print the data directory path */
	if (wlength > 0)
		printf("\n The data directory is %s", DataDir);

	/* Done - shutdown the Notes/Domino runtime and return from the function */

	NotesTerm();
	return (0); 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?