1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
void switch_to_dealer() {
HWND hWnd = CreateWindow(TEXT("C Windows"), TEXT("C Windows"), WS_OVERLAPPEDWINDOW,
10, 10, 600, 480, NULL, NULL, NULL, NULL);
int bbb = man->Dealer((MTAPI_NOTIFY_FUNC)DealingHandle, hWnd, NULL);
if (bbb != RET_OK)
cout << "Dealing switch error" << '\n';
else
cout << "Dealing mode connected" << '\n';
while (1) {
Sleep(100000000000);
}
}
int main()
{
FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
curl = curl_easy_init();
if (curl) {
string syurl = link;
curl_easy_setopt(curl, CURLOPT_URL, syurl.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
cres = curl_easy_perform(curl);
curl_easy_cleanup(curl);
cout << "Rates: " << readBuffer << '\n';
}
std::thread exchangerates(update_rates);
std::thread dealer(switch_to_dealer);
exchangerates.detach();
dealer.detach();
while (1) {
std::this_thread::sleep_for(std::chrono::milliseconds(10000000000000));
}
}
|