Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: tox am 09.12.04 - 16:01:40
-
Hallo,
ich habe das Problem, dass ich ein Programm in c++ geschrieben habe,
bei dem ich aber vor der Initialisierung noch einmal entscheiden möchte,
mit welcher ID ich mich einlogge.
Ist das überhaupt möglich und wenn ja wie???
Müssen dann alle ID´s lokal auf meinem Rechner liegen????
danke
-
Sagen wir mal, die IDs müssen auf jeden Fall erreichbar sein, können z.B. aber auch auf nem Netzlaufwerk liegen.
-
Hast du da für mich vielleicht einen Code???
-
Äh, ne, zumal ich C++ nicht beherrsche und auch von API-Progammierung keine Ahnung habe.
-
In Notes sähe das wie folgt aus:
Declare Function SECKFMSwitchToIDFile Lib "nnotes.dll" (Byval pIDFileName As String, Byval pPassword As String, _
Byval pUserName As String, Byval MaxUserNameLength As Integer, Byval ReservedFlags As Long, Reserved As Any) As Integer
nError =SECKFMSwitchToIDFile( path_id ,id_password, id_UserName ,Len(id_UserName),0,Null)
'Funktion gibt Fehler (<> 0) zurück, falls Passwort nicht stimmt
If nError <> 0 Then
Msgbox "Das eingegebene Passwort für die ID " & path_id & " ist falsch!",0+16,"Abbruch"
End If
Andreas
-
Und mit der C++ Api????
Oder mit welcher C++ Klasse???
danke im vorraus!
-
Benutzest Du das C++ Toolkit? Oder die C-API? Was Andreas gepostet hat, ist die C-API und da sieht es - ausser dass es natürlich in C geschrieben werden muss - im Prinzip genauso aus. A-Bär: beide Dokumentationen, die zur C-API und die zum C++ Toolkit (das notorisch älter ist als die API) findest Du auf DeveloperWorks (NotesNet ... siehe Glossar)
-
Ich benutze das C++ Toolkit!
D.h ich kann den Code genau so übernehmen???
-
Weiss ich jetzt nicht genau. Wenn ich mich richtig erinnere, setzt das C++ Toolkit auf der C-API auf, bin aber nicht sicher, ob das transparent ist. Da müsstest Du schon in der entsprechenden Doku noch nachsehen. Wie gesagt, die Doku lässt sich von LDD bzw. DeveloperWorks downloaden.
-
Für solche Stunts braucht man die Doku(s) sowieso zwingend. Alles andere wäre sträflich ...
Bernhard
-
Ist so, und ich finde es etwas merkwürdig, dass ich da zweimal drauf hinweisen musste.
-
In der C++ Api Dokumentation steht folgendes:
How do I run an API program using a different Notes ID or notes.ini file?
When you start a Notes session, either by running an API program or by running the Notes client or Domino server, Notes reads configuration information from an initialization file, called notes.ini on most platforms. In an API program, this happens when you initialize Notes by calling LNNotesSession::Init (C++ API) or NotesInit/NotesInitExtended (C API).
The initialization file specifies many settings, including the location of the Notes ID file and the workspace file. If you wish, you can create multiple initialization files (for example, one for each ID file), and then run your API program with a specific initialization file.
On the Intel platform, you can do this by specifying the name of the initialization file when you initialize Notes, using LNNotesSession::Init (C++ API) or NotesInitIni (C API). For example:
session.Init("c:\\notes\\data\\api_id.ini"); // C++ API
NotesInitIni("c:\\notes\\data\\api_id.ini"); /* C API */
This feature isn't supported on UNIX platforms. On those platforms, you have to set up the appropriate initialization information before running your API program. On UNIX, you can replace or modify notes.ini before running the API program.
Note that your API program can't switch to a different ID or initialization file after Notes has been initialized. To switch ID or initialization files during the course of a program, call LNNotesSession::Init and Term multiple times, specifying different .ini files for each session. Remember that you can have only one session active at any time, so before initializing a new session, you must terminate the current one.
Andreas
-
Zeigt deutlich, wie wichtig es ist, die Doku selber zu lesen.
-
;D