here is a program to user interface
i understand the excuted result
who known why ?
//////////////////////program///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
#include <iostream.h>
#include "nsISupports.h"
#include "nsIComponentManager.h"
#include "nsTextImport.h"
#include "nsIImportABDescriptor.h"
#include "nsIImportFieldMap.h"
NS_DEFINE_CID(kTextImportCID, NS_TEXTIMPORT_CID);
int main(int argc, char **argv) {
nsresult rv;
//char* val;
rv =
nsComponentManager::AutoRegister(nsIComponentManagerObsolete::NS_Startup,
NULL /* default */);
if (NS_FAILED(rv)) return rv;
nsIImportABDescriptor *pSource=NULL;
nsIAddrDatabase *pDestination=NULL;
nsIImportFieldMap *fieldMap=NULL;
PRBool isAddrLocHome;
PRUnichar **pErrorLog;
PRUnichar **pSuccessLog;
PRBool *fatalError;
nsIImportAddressBooks *import = NULL;
nsComponentManager::CreateInstance(kTextImportCID,
NULL,
NS_GET_IID(nsIImportAddressBooks),
(void **) &import);
if (import != NULL) {
import->ImportAddressBook(pSource,pDestination,fieldMap,isAddrLocHome,pError
Log,pSu
ccessLog,fatalError);
import->Release();
} else {
cout << "CreateInstance failed\n";
}
return 0;
}
///////////////////////result///////////////////////////////////////////////
////////////////////////////////////////////
./ImportAddressbook
Warning: MOZILLA_FIVE_HOME not set.
Type Manifest File:
/work/jameng/workstation/mozi/mozilla/dist/bin/components/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
nsTextImport Module Created
nsTextImport Module Deleted
CreateInstance failed
and why import variable equal NULL?