<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
	>
<channel>
	<title>どのフォルダにドキュメントが格納されているかを知る @WhichFolders へのコメント</title>
	<atom:link href="http://www.oto-kichi.com/2009/11/06/%e3%81%a9%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%ab%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%81%8c%e6%a0%bc%e7%b4%8d%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oto-kichi.com/2009/11/06/%e3%81%a9%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%ab%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%81%8c%e6%a0%bc%e7%b4%8d%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b/</link>
	<description>ロサンゼルス在住ITエンジニアの開発ブログ</description>
	<lastBuildDate>Thu, 18 Feb 2010 02:07:52 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>otuska より</title>
		<link>http://www.oto-kichi.com/2009/11/06/%e3%81%a9%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%ab%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%81%8c%e6%a0%bc%e7%b4%8d%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b/comment-page-1/#comment-17</link>
		<dc:creator>otuska</dc:creator>
		<pubDate>Tue, 08 Dec 2009 07:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.oto-kichi.com/?p=112#comment-17</guid>
		<description>Virukeさん、ご親切に回答ありがとうございます。

ゼロリセットしています。
こういう書き込みを行ってもいいのかわかりませんが
以下、ソースです。本当にすみません。

あつかましいのは重々、承知です。

#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define LOGFILE &quot;c:\\temp\\testperson.log&quot;
#define ORG_CERT_ID &quot;c:\\Program Files\\IBM\\lotus\\notes704\\data\\cert.id&quot;
#define PASSWORD &quot;password01&quot;
#define ORG_CERTNAME &quot;XXXX&quot;

#define MIN_PASS_LEN 3

FILE *fp;

int RegPerson();
void LNCALLBACK REGCallback (char far *msg);
STATUS GetCertCtx (char far *pCertFile, HCERTIFIER *phCertCtx, char far *szPassword);
void PrintAPIError (STATUS api_error);
void GetTime(char * ct);

int main(int argc, char *argv[])
{
	int val = 0;

	if (fopen_s(&amp;fp, LOGFILE, &quot;a&quot;)) {
		printf(&quot;File Open Error&quot;);
		return (1);
	}

	val = RegPerson();

	fclose(fp);

	return val;

}

int RegPerson()
{

	REG_ID_INFO IDInfo = {0,0,0,0,&quot;&quot;,0,0,0,0,0,0,0,0};
	REG_MAIL_INFO_EXT MailInfoExt = {0,0,0,0,0,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,0,0,0,0,0,0,0,0,0,0};
	REG_ROAMING_INFO RoamingInfo = {0,&quot;&quot;,&quot;&quot;,0,0,0,0,0,0,0,0,0,0,0,0};
	REG_MISC_INFO MiscInfo = {0,&quot;&quot;,&quot;&quot;,&quot;&quot;,0,0,0,0,0,0,0,0};
	REG_PERSON_INFO PersonInfo = {0,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,0,0,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

	//REG_MAIL_INFO_EXT *MailInfoExt;
	//REG_PERSON_INFO *PersonInfo;

	STATUS error;				/* return code from API calls */

	char *DbServer = &quot;idm-test01/XXXX&quot;;
	char *IDFileName = &quot;c:\\Program Files\\IBM\\lotus\\notes802\\data\\test7.id&quot;;
	char FullDBPath[MAXPATH];
	REGSIGNALPROC  signalstatus = NULL;
	HCERTIFIER hCertCtx;
	//DBHANDLE hNABook;
	void *spare = NULL;

	FullDBPath[0] = &#039;&#039;;

	if (error = NotesInit()) {
		PrintAPIError(error);
		return (1);
	}

	if (error = GetCertCtx(ORG_CERT_ID, &amp;hCertCtx, PASSWORD)) {
		PrintAPIError(error);
		NotesTerm();
		return (1);
	}

	//IDInfo
	memset(&amp;IDInfo, 0x00 ,sizeof(REG_ID_INFO));
	IDInfo.Size = sizeof(REG_ID_INFO);
	IDInfo.KeyWidth = 0;
	IDInfo.PasswordKeyWidth = 0;
	IDInfo.Type = KFM_IDFILE_TYPE_ORG;
	IDInfo.FileName = &quot;c:\\Program Files\\IBM\\lotus\\notes802\\data\\test7.id&quot;;

	//MailInfo
	memset(&amp;MailInfoExt, 0x00 ,sizeof(REG_MAIL_INFO_EXT));
	MailInfoExt.Size = sizeof(REG_MAIL_INFO_EXT);
	MailInfoExt.pMailServerName = DbServer;
	MailInfoExt.DbQuotaSizeLimit = 100000;
	MailInfoExt.pMailFileName = &quot;mail\\MTest7.nsf&quot;;
	MailInfoExt.pMailTemplateName = &quot;mail7.ntf&quot;;
	MailInfoExt.MailSystem = 0;
	//MailInfoExt = malloc(sizeof(REG_MAIL_INFO_EXT));
	//memset(MailInfoExt, 0x00 ,sizeof(REG_MAIL_INFO_EXT));
	//MailInfoExt-&gt;Size = sizeof(REG_MAIL_INFO_EXT);
	//MailInfoExt-&gt;pMailServerName = DbServer;
	//MailInfoExt-&gt;DbQuotaSizeLimit = 100000;
	//MailInfoExt-&gt;pMailFileName = &quot;mail\\MTest7.nsf&quot;;
	//MailInfoExt-&gt;pMailTemplateName = &quot;mail7.ntf&quot;;
	//MailInfoExt-&gt;MailSystem = 0;
	
	//RoamingInfo
	memset(&amp;RoamingInfo, 0x00 ,sizeof(REG_ROAMING_INFO));
	RoamingInfo.Size = sizeof(REG_ROAMING_INFO);
	RoamingInfo.ServerName = NULL;
	RoamingInfo.SubDirectory = &quot;aaa&quot;;
	RoamingInfo.OnDuplicate = REG_FILE_DUP_OVERWRITE;
	RoamingInfo.CleanupPeriod = 0;
	RoamingInfo.CleanupSetting = REG_ROAMING_CLEANUP_NEVER;

	//MiscInfo
	memset(&amp;MiscInfo, 0x00 ,sizeof(REG_MISC_INFO));
	MiscInfo.Size = sizeof(REG_MISC_INFO);
	MiscInfo.Comment = &quot;Test&quot;;
	MiscInfo.LocalAdminName = &quot;idm administrator/XXXX&quot;;
	MiscInfo.Location = &quot;Internet&quot;;

	//PersonInfo
	memset(&amp;PersonInfo, 0x00 ,sizeof(REG_PERSON_INFO));
	PersonInfo.Size = sizeof(REG_PERSON_INFO); 
	PersonInfo.FirstName = &quot;M&quot;;
	PersonInfo.LastName = &quot;Test7&quot;;
	PersonInfo.ShortName = &quot;MTest7&quot;;
	PersonInfo.ProfileName = &quot;&quot;;
	PersonInfo.OrgUnit = ORG_CERTNAME;
	PersonInfo.AlternateName = &quot;&quot;;
	PersonInfo.AltLanguage = &quot;&quot;;
	PersonInfo.AltOrgUnit = &quot;&quot;;
	PersonInfo.InternetAddress = &quot;&quot;;
	PersonInfo.MiddleName = &quot;&quot;;
	PersonInfo.PreferredLanguage = &quot;&quot;;
	PersonInfo.Password = &quot;12345678&quot;;
	PersonInfo.PasswordQuality = 8;
	PersonInfo.Flags = fREGCreateAddrBookEntry;
	PersonInfo.FlagsExt = fREGExtRoamingUserNow;
	PersonInfo.MailInfo = &MailInfoExt;
	PersonInfo.IDInfo = &IDInfo;
	PersonInfo.MiscInfo = &MiscInfo;
	PersonInfo.RoamingInfo = &RoamingInfo;
	//PersonInfo = malloc(sizeof(REG_PERSON_INFO));
	//memset(PersonInfo, 0x00 ,sizeof(REG_PERSON_INFO));
	//PersonInfo-&gt;Size = sizeof(REG_PERSON_INFO); 
	//PersonInfo-&gt;FirstName = &quot;M&quot;;
	//PersonInfo-&gt;LastName = &quot;Test7&quot;;
	//PersonInfo-&gt;ShortName = &quot;MTest7&quot;;
	//PersonInfo-&gt;ProfileName = &quot;&quot;;
	//PersonInfo-&gt;OrgUnit = ORG_CERTNAME;
	//PersonInfo-&gt;AlternateName = &quot;&quot;;
	//PersonInfo-&gt;AltLanguage = &quot;&quot;;
	//PersonInfo-&gt;AltOrgUnit = &quot;&quot;;
	//PersonInfo-&gt;InternetAddress = &quot;&quot;;
	//PersonInfo-&gt;MiddleName = &quot;&quot;;
	//PersonInfo-&gt;PreferredLanguage = &quot;&quot;;
	//PersonInfo-&gt;Password = &quot;12345678&quot;;
	//PersonInfo-&gt;PasswordQuality = 8;
	//PersonInfo-&gt;Flags = fREGCreateAddrBookEntry &#124; fREGCreateDesktopClient;
	//PersonInfo-&gt;FlagsExt = fREGExtRoamingUserNow;
	//PersonInfo-&gt;MailInfo = MailInfoExt;
	//PersonInfo-&gt;IDInfo = &IDInfo;
	//PersonInfo-&gt;MiscInfo = &MiscInfo;
	//PersonInfo-&gt;RoamingInfo = &RoamingInfo;
	//PersonInfo-&gt;MailInfo = NULL;
	//PersonInfo-&gt;IDInfo = NULL;
	//PersonInfo-&gt;MiscInfo = NULL;
	//PersonInfo-&gt;RoamingInfo = NULL;

	error = REGNewPerson(hCertCtx, DbServer, &amp;PersonInfo, &amp;REGCallback, FullDBPath, NULL);

	/* Free the certifier context */
	SECKFMFreeCertifierCtx (hCertCtx);

	//free(MailInfoExt);
	//free(PersonInfo);

	if (error) {
		PrintAPIError(error);
		NotesTerm();
		return (1);
	}

	NotesTerm();
	return (0);

}

void LNCALLBACK REGCallback (char far *msg)
{
	char out[200];
	time_t timer;
	char ct[50];
	struct tm t_st = {0,0,0,0,0,0,0,0,0};

	/* 現在時刻の取得 */
	time(&amp;timer);

	/* 現在時刻を構造体に変換 */
	localtime_s(&amp;t_st, &amp;timer);
	sprintf_s(ct, sizeof(ct), &quot;%d/%2.2d/%2.2d-%2.2d:%2.2d:%2.2d&quot;,t_st.tm_year+1900, t_st.tm_mon+1, t_st.tm_mday, t_st.tm_hour, t_st.tm_min, t_st.tm_sec);

	OSTranslate(OS_TRANSLATE_LMBCS_TO_NATIVE, msg, strlen(msg), out, sizeof(out));

    /* Print it. */
    fprintf_s(fp, &quot;%s  --&gt; %s\n&quot;, ct, out);
	fflush(fp);
}

STATUS GetCertCtx (char far *pCertFile, HCERTIFIER *phCertCtx, char far *szPassword)
{
	TIMEDATE ExpDate;
	STATUS error;
	char CertName[MAXSPRINTF];
	BOOL IsHierarchical;
	WORD FileVersion;
	KFM_PASSWORD KFMPassword, *pKFMPassword;    /* encoded password */

	OSCurrentTIMEDATE(&amp;ExpDate);

	/* set the expiration date to two years from today (Domino and Notes default) */
	error = TimeDateAdjust(&amp;ExpDate, 0, 0, 0, 0, 0, 2);

	if (error) return (error);

	/* get the encoded password */
	if (szPassword == NULL) {
		pKFMPassword = NULL;
	} else {
		pKFMPassword = &KFMPassword;
		SECKFMCreatePassword (szPassword, pKFMPassword);
	}

	/* get the certifier context */
	error = SECKFMGetCertifierCtx (
				pCertFile,       /* Certifier file path spec */
				pKFMPassword,    /* encoded password */
				&quot;certlog.nsf&quot;,   /* certifier log */
				&amp;ExpDate,        /* expiration date */
				CertName,        /* returned name of certifier */
				phCertCtx,       /* returned handle to certifier context */
				&amp;IsHierarchical, /* returned TRUE if certifier is hierarchical */
				&amp;FileVersion);   /* returned file version */

	return (error);
}
void PrintAPIError (STATUS api_error)
{
	STATUS string_id = ERR(api_error);
	char error_text[200];
	char error_out[200];
	WORD text_len;
	char ct[50];

	/* 現在時刻の取得 */
	GetTime(ct);

    /* Get the message for this Lotus C API for Domino and Notes error code
       from the resource string table. */
	text_len = OSLoadString (NULLHANDLE,
							 string_id,
							 error_text,
							 sizeof(error_text));
	OSTranslate(OS_TRANSLATE_LMBCS_TO_NATIVE, error_text, sizeof(error_text), error_out, sizeof(error_out));

    /* Print it. */
    fprintf_s(fp, &quot;%s  --&gt; %s\n&quot;, ct, error_out);

}

void GetTime(char * ct)
{
	time_t timer;
	struct tm t_st = {0,0,0,0,0,0,0,0,0};

	/* 現在時刻の取得 */
	time(&amp;timer);

	/* 現在時刻を構造体に変換 */
	localtime_s(&amp;t_st, &amp;timer);
	sprintf_s(ct, 50, &quot;%d/%2.2d/%2.2d-%2.2d:%2.2d:%2.2d&quot;,t_st.tm_year+1900, t_st.tm_mon+1, t_st.tm_mday, t_st.tm_hour, t_st.tm_min, t_st.tm_sec);

}</description>
		<content:encoded><![CDATA[<p>Virukeさん、ご親切に回答ありがとうございます。</p>
<p>ゼロリセットしています。<br />
こういう書き込みを行ってもいいのかわかりませんが<br />
以下、ソースです。本当にすみません。</p>
<p>あつかましいのは重々、承知です。</p>
<p>#include<br />
#include<br />
#include<br />
#include </p>
<p>#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include </p>
<p>#define LOGFILE &#8220;c:\\temp\\testperson.log&#8221;<br />
#define ORG_CERT_ID &#8220;c:\\Program Files\\IBM\\lotus\\notes704\\data\\cert.id&#8221;<br />
#define PASSWORD &#8220;password01&#8243;<br />
#define ORG_CERTNAME &#8220;XXXX&#8221;</p>
<p>#define MIN_PASS_LEN 3</p>
<p>FILE *fp;</p>
<p>int RegPerson();<br />
void LNCALLBACK REGCallback (char far *msg);<br />
STATUS GetCertCtx (char far *pCertFile, HCERTIFIER *phCertCtx, char far *szPassword);<br />
void PrintAPIError (STATUS api_error);<br />
void GetTime(char * ct);</p>
<p>int main(int argc, char *argv[])<br />
{<br />
	int val = 0;</p>
<p>	if (fopen_s(&amp;fp, LOGFILE, &#8220;a&#8221;)) {<br />
		printf(&#8221;File Open Error&#8221;);<br />
		return (1);<br />
	}</p>
<p>	val = RegPerson();</p>
<p>	fclose(fp);</p>
<p>	return val;</p>
<p>}</p>
<p>int RegPerson()<br />
{</p>
<p>	REG_ID_INFO IDInfo = {0,0,0,0,&#8221;",0,0,0,0,0,0,0,0};<br />
	REG_MAIL_INFO_EXT MailInfoExt = {0,0,0,0,0,&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",0,0,0,0,0,0,0,0,0,0};<br />
	REG_ROAMING_INFO RoamingInfo = {0,&#8221;",&#8221;",0,0,0,0,0,0,0,0,0,0,0,0};<br />
	REG_MISC_INFO MiscInfo = {0,&#8221;",&#8221;",&#8221;",0,0,0,0,0,0,0,0};<br />
	REG_PERSON_INFO PersonInfo = {0,&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",0,0,&#8221;",&#8221;",&#8221;",&#8221;",&#8221;",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};</p>
<p>	//REG_MAIL_INFO_EXT *MailInfoExt;<br />
	//REG_PERSON_INFO *PersonInfo;</p>
<p>	STATUS error;				/* return code from API calls */</p>
<p>	char *DbServer = &#8220;idm-test01/XXXX&#8221;;<br />
	char *IDFileName = &#8220;c:\\Program Files\\IBM\\lotus\\notes802\\data\\test7.id&#8221;;<br />
	char FullDBPath[MAXPATH];<br />
	REGSIGNALPROC  signalstatus = NULL;<br />
	HCERTIFIER hCertCtx;<br />
	//DBHANDLE hNABook;<br />
	void *spare = NULL;</p>
<p>	FullDBPath[0] = &#8221;;</p>
<p>	if (error = NotesInit()) {<br />
		PrintAPIError(error);<br />
		return (1);<br />
	}</p>
<p>	if (error = GetCertCtx(ORG_CERT_ID, &amp;hCertCtx, PASSWORD)) {<br />
		PrintAPIError(error);<br />
		NotesTerm();<br />
		return (1);<br />
	}</p>
<p>	//IDInfo<br />
	memset(&amp;IDInfo, 0&#215;00 ,sizeof(REG_ID_INFO));<br />
	IDInfo.Size = sizeof(REG_ID_INFO);<br />
	IDInfo.KeyWidth = 0;<br />
	IDInfo.PasswordKeyWidth = 0;<br />
	IDInfo.Type = KFM_IDFILE_TYPE_ORG;<br />
	IDInfo.FileName = &#8220;c:\\Program Files\\IBM\\lotus\\notes802\\data\\test7.id&#8221;;</p>
<p>	//MailInfo<br />
	memset(&amp;MailInfoExt, 0&#215;00 ,sizeof(REG_MAIL_INFO_EXT));<br />
	MailInfoExt.Size = sizeof(REG_MAIL_INFO_EXT);<br />
	MailInfoExt.pMailServerName = DbServer;<br />
	MailInfoExt.DbQuotaSizeLimit = 100000;<br />
	MailInfoExt.pMailFileName = &#8220;mail\\MTest7.nsf&#8221;;<br />
	MailInfoExt.pMailTemplateName = &#8220;mail7.ntf&#8221;;<br />
	MailInfoExt.MailSystem = 0;<br />
	//MailInfoExt = malloc(sizeof(REG_MAIL_INFO_EXT));<br />
	//memset(MailInfoExt, 0&#215;00 ,sizeof(REG_MAIL_INFO_EXT));<br />
	//MailInfoExt-&gt;Size = sizeof(REG_MAIL_INFO_EXT);<br />
	//MailInfoExt-&gt;pMailServerName = DbServer;<br />
	//MailInfoExt-&gt;DbQuotaSizeLimit = 100000;<br />
	//MailInfoExt-&gt;pMailFileName = &#8220;mail\\MTest7.nsf&#8221;;<br />
	//MailInfoExt-&gt;pMailTemplateName = &#8220;mail7.ntf&#8221;;<br />
	//MailInfoExt-&gt;MailSystem = 0;</p>
<p>	//RoamingInfo<br />
	memset(&amp;RoamingInfo, 0&#215;00 ,sizeof(REG_ROAMING_INFO));<br />
	RoamingInfo.Size = sizeof(REG_ROAMING_INFO);<br />
	RoamingInfo.ServerName = NULL;<br />
	RoamingInfo.SubDirectory = &#8220;aaa&#8221;;<br />
	RoamingInfo.OnDuplicate = REG_FILE_DUP_OVERWRITE;<br />
	RoamingInfo.CleanupPeriod = 0;<br />
	RoamingInfo.CleanupSetting = REG_ROAMING_CLEANUP_NEVER;</p>
<p>	//MiscInfo<br />
	memset(&amp;MiscInfo, 0&#215;00 ,sizeof(REG_MISC_INFO));<br />
	MiscInfo.Size = sizeof(REG_MISC_INFO);<br />
	MiscInfo.Comment = &#8220;Test&#8221;;<br />
	MiscInfo.LocalAdminName = &#8220;idm administrator/XXXX&#8221;;<br />
	MiscInfo.Location = &#8220;Internet&#8221;;</p>
<p>	//PersonInfo<br />
	memset(&amp;PersonInfo, 0&#215;00 ,sizeof(REG_PERSON_INFO));<br />
	PersonInfo.Size = sizeof(REG_PERSON_INFO);<br />
	PersonInfo.FirstName = &#8220;M&#8221;;<br />
	PersonInfo.LastName = &#8220;Test7&#8243;;<br />
	PersonInfo.ShortName = &#8220;MTest7&#8243;;<br />
	PersonInfo.ProfileName = &#8220;&#8221;;<br />
	PersonInfo.OrgUnit = ORG_CERTNAME;<br />
	PersonInfo.AlternateName = &#8220;&#8221;;<br />
	PersonInfo.AltLanguage = &#8220;&#8221;;<br />
	PersonInfo.AltOrgUnit = &#8220;&#8221;;<br />
	PersonInfo.InternetAddress = &#8220;&#8221;;<br />
	PersonInfo.MiddleName = &#8220;&#8221;;<br />
	PersonInfo.PreferredLanguage = &#8220;&#8221;;<br />
	PersonInfo.Password = &#8220;12345678&#8243;;<br />
	PersonInfo.PasswordQuality = 8;<br />
	PersonInfo.Flags = fREGCreateAddrBookEntry;<br />
	PersonInfo.FlagsExt = fREGExtRoamingUserNow;<br />
	PersonInfo.MailInfo = &#038;MailInfoExt;<br />
	PersonInfo.IDInfo = &IDInfo;<br />
	PersonInfo.MiscInfo = &MiscInfo;<br />
	PersonInfo.RoamingInfo = &#038;RoamingInfo;<br />
	//PersonInfo = malloc(sizeof(REG_PERSON_INFO));<br />
	//memset(PersonInfo, 0&#215;00 ,sizeof(REG_PERSON_INFO));<br />
	//PersonInfo-&gt;Size = sizeof(REG_PERSON_INFO);<br />
	//PersonInfo-&gt;FirstName = &#8220;M&#8221;;<br />
	//PersonInfo-&gt;LastName = &#8220;Test7&#8243;;<br />
	//PersonInfo-&gt;ShortName = &#8220;MTest7&#8243;;<br />
	//PersonInfo-&gt;ProfileName = &#8220;&#8221;;<br />
	//PersonInfo-&gt;OrgUnit = ORG_CERTNAME;<br />
	//PersonInfo-&gt;AlternateName = &#8220;&#8221;;<br />
	//PersonInfo-&gt;AltLanguage = &#8220;&#8221;;<br />
	//PersonInfo-&gt;AltOrgUnit = &#8220;&#8221;;<br />
	//PersonInfo-&gt;InternetAddress = &#8220;&#8221;;<br />
	//PersonInfo-&gt;MiddleName = &#8220;&#8221;;<br />
	//PersonInfo-&gt;PreferredLanguage = &#8220;&#8221;;<br />
	//PersonInfo-&gt;Password = &#8220;12345678&#8243;;<br />
	//PersonInfo-&gt;PasswordQuality = 8;<br />
	//PersonInfo-&gt;Flags = fREGCreateAddrBookEntry | fREGCreateDesktopClient;<br />
	//PersonInfo-&gt;FlagsExt = fREGExtRoamingUserNow;<br />
	//PersonInfo-&gt;MailInfo = MailInfoExt;<br />
	//PersonInfo-&gt;IDInfo = &IDInfo;<br />
	//PersonInfo-&gt;MiscInfo = &MiscInfo;<br />
	//PersonInfo-&gt;RoamingInfo = &#038;RoamingInfo;<br />
	//PersonInfo-&gt;MailInfo = NULL;<br />
	//PersonInfo-&gt;IDInfo = NULL;<br />
	//PersonInfo-&gt;MiscInfo = NULL;<br />
	//PersonInfo-&gt;RoamingInfo = NULL;</p>
<p>	error = REGNewPerson(hCertCtx, DbServer, &amp;PersonInfo, &amp;REGCallback, FullDBPath, NULL);</p>
<p>	/* Free the certifier context */<br />
	SECKFMFreeCertifierCtx (hCertCtx);</p>
<p>	//free(MailInfoExt);<br />
	//free(PersonInfo);</p>
<p>	if (error) {<br />
		PrintAPIError(error);<br />
		NotesTerm();<br />
		return (1);<br />
	}</p>
<p>	NotesTerm();<br />
	return (0);</p>
<p>}</p>
<p>void LNCALLBACK REGCallback (char far *msg)<br />
{<br />
	char out[200];<br />
	time_t timer;<br />
	char ct[50];<br />
	struct tm t_st = {0,0,0,0,0,0,0,0,0};</p>
<p>	/* 現在時刻の取得 */<br />
	time(&amp;timer);</p>
<p>	/* 現在時刻を構造体に変換 */<br />
	localtime_s(&amp;t_st, &amp;timer);<br />
	sprintf_s(ct, sizeof(ct), &#8220;%d/%2.2d/%2.2d-%2.2d:%2.2d:%2.2d&#8221;,t_st.tm_year+1900, t_st.tm_mon+1, t_st.tm_mday, t_st.tm_hour, t_st.tm_min, t_st.tm_sec);</p>
<p>	OSTranslate(OS_TRANSLATE_LMBCS_TO_NATIVE, msg, strlen(msg), out, sizeof(out));</p>
<p>    /* Print it. */<br />
    fprintf_s(fp, &#8220;%s  &#8211;&gt; %s\n&#8221;, ct, out);<br />
	fflush(fp);<br />
}</p>
<p>STATUS GetCertCtx (char far *pCertFile, HCERTIFIER *phCertCtx, char far *szPassword)<br />
{<br />
	TIMEDATE ExpDate;<br />
	STATUS error;<br />
	char CertName[MAXSPRINTF];<br />
	BOOL IsHierarchical;<br />
	WORD FileVersion;<br />
	KFM_PASSWORD KFMPassword, *pKFMPassword;    /* encoded password */</p>
<p>	OSCurrentTIMEDATE(&amp;ExpDate);</p>
<p>	/* set the expiration date to two years from today (Domino and Notes default) */<br />
	error = TimeDateAdjust(&amp;ExpDate, 0, 0, 0, 0, 0, 2);</p>
<p>	if (error) return (error);</p>
<p>	/* get the encoded password */<br />
	if (szPassword == NULL) {<br />
		pKFMPassword = NULL;<br />
	} else {<br />
		pKFMPassword = &#038;KFMPassword;<br />
		SECKFMCreatePassword (szPassword, pKFMPassword);<br />
	}</p>
<p>	/* get the certifier context */<br />
	error = SECKFMGetCertifierCtx (<br />
				pCertFile,       /* Certifier file path spec */<br />
				pKFMPassword,    /* encoded password */<br />
				&#8220;certlog.nsf&#8221;,   /* certifier log */<br />
				&amp;ExpDate,        /* expiration date */<br />
				CertName,        /* returned name of certifier */<br />
				phCertCtx,       /* returned handle to certifier context */<br />
				&amp;IsHierarchical, /* returned TRUE if certifier is hierarchical */<br />
				&amp;FileVersion);   /* returned file version */</p>
<p>	return (error);<br />
}<br />
void PrintAPIError (STATUS api_error)<br />
{<br />
	STATUS string_id = ERR(api_error);<br />
	char error_text[200];<br />
	char error_out[200];<br />
	WORD text_len;<br />
	char ct[50];</p>
<p>	/* 現在時刻の取得 */<br />
	GetTime(ct);</p>
<p>    /* Get the message for this Lotus C API for Domino and Notes error code<br />
       from the resource string table. */<br />
	text_len = OSLoadString (NULLHANDLE,<br />
							 string_id,<br />
							 error_text,<br />
							 sizeof(error_text));<br />
	OSTranslate(OS_TRANSLATE_LMBCS_TO_NATIVE, error_text, sizeof(error_text), error_out, sizeof(error_out));</p>
<p>    /* Print it. */<br />
    fprintf_s(fp, &#8220;%s  &#8211;&gt; %s\n&#8221;, ct, error_out);</p>
<p>}</p>
<p>void GetTime(char * ct)<br />
{<br />
	time_t timer;<br />
	struct tm t_st = {0,0,0,0,0,0,0,0,0};</p>
<p>	/* 現在時刻の取得 */<br />
	time(&amp;timer);</p>
<p>	/* 現在時刻を構造体に変換 */<br />
	localtime_s(&amp;t_st, &amp;timer);<br />
	sprintf_s(ct, 50, &#8220;%d/%2.2d/%2.2d-%2.2d:%2.2d:%2.2d&#8221;,t_st.tm_year+1900, t_st.tm_mon+1, t_st.tm_mday, t_st.tm_hour, t_st.tm_min, t_st.tm_sec);</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Viruke より</title>
		<link>http://www.oto-kichi.com/2009/11/06/%e3%81%a9%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%ab%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%81%8c%e6%a0%bc%e7%b4%8d%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b/comment-page-1/#comment-16</link>
		<dc:creator>Viruke</dc:creator>
		<pubDate>Mon, 07 Dec 2009 09:05:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.oto-kichi.com/?p=112#comment-16</guid>
		<description>はじめまして、
残念ながらREGNewPerson関数を使ったことは未だないです。
関数からエラーSTATUSが返される前に落ちてしまうということだと思うのですが、こういうのが一番難しいですよね。
REG_ROAMING_INFO構造体をREG_PERSON_INFO構造体で指定しているってことだと思ったので、リファレンスをちょっとみてみたんですが

This structure defines roaming registration information for the REGNewPerson function.  The entire structure must be initialized to zero.

The fields in the structure are (all fields that are not used must be NULL/O):

という注意書きが書いてあるので、ちゃんと構造体をゼロリセットしているか確認してみてはいかがでしょうか？
すいません、これぐらいしかアドバイスできること思い浮かばないです（＞＜）</description>
		<content:encoded><![CDATA[<p>はじめまして、<br />
残念ながらREGNewPerson関数を使ったことは未だないです。<br />
関数からエラーSTATUSが返される前に落ちてしまうということだと思うのですが、こういうのが一番難しいですよね。<br />
REG_ROAMING_INFO構造体をREG_PERSON_INFO構造体で指定しているってことだと思ったので、リファレンスをちょっとみてみたんですが</p>
<p>This structure defines roaming registration information for the REGNewPerson function.  The entire structure must be initialized to zero.</p>
<p>The fields in the structure are (all fields that are not used must be NULL/O):</p>
<p>という注意書きが書いてあるので、ちゃんと構造体をゼロリセットしているか確認してみてはいかがでしょうか？<br />
すいません、これぐらいしかアドバイスできること思い浮かばないです（＞＜）</p>
]]></content:encoded>
	</item>
	<item>
		<title>otsuka より</title>
		<link>http://www.oto-kichi.com/2009/11/06/%e3%81%a9%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%ab%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%81%8c%e6%a0%bc%e7%b4%8d%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b/comment-page-1/#comment-15</link>
		<dc:creator>otsuka</dc:creator>
		<pubDate>Mon, 07 Dec 2009 06:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.oto-kichi.com/?p=112#comment-15</guid>
		<description>はじめまして、日本でdominoを使用して開発しておりますものです。失礼かと存じますが
書き込みをさせていただきました。実はNotes　CAPIを使用してユーザー登録を使用としているのですが
うまくいきません。（バージョン等関係なくです）
ローミングの設定をすると、エラーで落ちてしまいます。
なにかご存知でしたら教えていただけたら幸いです。

REGNewPerson関数でローミングの引数を指定するとエラーとなります。</description>
		<content:encoded><![CDATA[<p>はじめまして、日本でdominoを使用して開発しておりますものです。失礼かと存じますが<br />
書き込みをさせていただきました。実はNotes　CAPIを使用してユーザー登録を使用としているのですが<br />
うまくいきません。（バージョン等関係なくです）<br />
ローミングの設定をすると、エラーで落ちてしまいます。<br />
なにかご存知でしたら教えていただけたら幸いです。</p>
<p>REGNewPerson関数でローミングの引数を指定するとエラーとなります。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
