aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 82b62e6..a1bb255 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -1,3 +1,4 @@
+#include <sstream>
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
@@ -48,12 +49,13 @@ void DataListView::ShowEpisode(const int iEpisode)
lviValue.mask = LVIF_TEXT;
Frame f;
- const term_t t = PL_new_term_refs(3);
- if (!PL_put_integer(t,iEpisode)) return;
- const qid_t q = PL_open_query(NULL, PL_Q_NORMAL,
- PL_predicate("episode_datum", 3, "episode_data"), t);
+ const int iArity = 3;
+ const term_t t = PL_new_term_refs(iArity);
+ if (!PlPut(t, iEpisode)) return;
- for (int i = 0; PL_next_solution(q); i++) {
+ Query q (NULL, PL_predicate("episode_datum", iArity, "episode_data"), t);
+
+ for (int i = 0; q.NextSolution(); i++) {
std::basic_string<TCHAR> tstrKey;
std::basic_string<TCHAR> tstrValue;
@@ -72,7 +74,6 @@ void DataListView::ShowEpisode(const int iEpisode)
ListView_SetItem(hWnd, &lviValue);
}
- PL_cut_query(q);
UpdateLayout();
LVFINDINFO lvfi;