comparison Resources/Samples/OrthancCppClientStandalone/Basic/main.cpp @ 588:a0001c222b32

refactoring of samples
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Oct 2013 15:00:18 +0200
parents 7f9467b5f33b
children
comparison
equal deleted inserted replaced
587:8b6ae96125dc 588:a0001c222b32
24 * SOFTWARE. 24 * SOFTWARE.
25 **/ 25 **/
26 26
27 27
28 #include <iostream> 28 #include <iostream>
29 29 #include <orthanc/OrthancCppClient.h>
30 #include "../../../../OrthancCppClient/Package/AUTOGENERATED/OrthancClient.h"
31 30
32 int main() 31 int main()
33 { 32 {
34 try 33 try
35 { 34 {
36 #ifdef _WIN32 35 // The following explicit initialization is not required, except
37 OrthancClient::Initialize("libOrthancCppClient.dll"); 36 // if you wish to specify the full path to the shared library
38 #else 37 OrthancClient::Initialize();
39 OrthancClient::Initialize("libOrthancCppClient.so");
40 #endif
41 38
42 // Display the content of the local Orthanc instance 39 // Display the content of the local Orthanc instance
43 OrthancClient::OrthancConnection orthanc("http://localhost:8042"); 40 OrthancClient::OrthancConnection orthanc("http://localhost:8042");
44 41
45 for (unsigned int i = 0; i < orthanc.GetPatientCount(); i++) 42 for (unsigned int i = 0; i < orthanc.GetPatientCount(); i++)
63 } 60 }
64 } 61 }
65 } 62 }
66 } 63 }
67 64
65 OrthancClient::Finalize();
66
68 return 0; 67 return 0;
69 } 68 }
70 catch (OrthancClient::OrthancClientException e) 69 catch (OrthancClient::OrthancClientException e)
71 { 70 {
72 std::cerr << "EXCEPTION: [" << e.What() << "]" << std::endl; 71 std::cerr << "EXCEPTION: [" << e.What() << "]" << std::endl;