in Education by
I'm developing a plugin. Take a look at the following code. string request(char post_params[]) { CURL *curl; CURLcode res; std::string buffer; //here we'll write response curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_params); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(post_params)); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } return buffer; } .... bool perform(..) { std::ofstream file ("d:/t/t.txt"); file << "opened"; file.close(); string resp = request(....); ... } If the code is launched inside an app, file d:/t/t.txt is created, but if the code is compiled to a DLL, and launched from an app running my plugin, the file is not created. But if I comment out line string resp = request(....); and what follows, the file will be created. Can somebody explain me what's up here? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
std::ofstream file ("d:/t/t.txt"); // Make sure the file is opened before trying to write in it if (!file.is_open()) { // print error message } else { file << "opened"; file.close(); }

Related questions

0 votes
    I have a managed C++ dll which uses a unmanaged C++ lib. I've added the lib file in the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I have a c++11 type alias: using coord = std::array; Can I define the operator + for coord? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    I have a c++11 type alias: using coord = std::array; Can I define the operator + for coord? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I have a c++11 type alias: using coord = std::array; Can I define the operator + for coord? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    Maps are great to get things done easily, but they are memory hogs and suffer from caching issues. And ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    Maps are great to get things done easily, but they are memory hogs and suffer from caching issues. And ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I am developing a prototype for a game, and certain gameplay rules are to be defined in an ini ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am developing a prototype for a game, and certain gameplay rules are to be defined in an ini ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am developing a prototype for a game, and certain gameplay rules are to be defined in an ini ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I am developing a prototype for a game, and certain gameplay rules are to be defined in an ini ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    In python3 console, input those: >>> import sys >>> sys.version_info sys.version_info(major=3, minor= ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    In python3 console, input those: >>> import sys >>> sys.version_info sys.version_info(major=3, minor= ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    In python3 console, input those: >>> import sys >>> sys.version_info sys.version_info(major=3, minor= ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    Copper behaves as a (a) Conductor always (b) Conductor or dielectric depending on the applied ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 6, 2021 in Education by JackTerrance
0 votes
    Does a stochastic network will evolve differently each time it is run? (a) yes (b) no I have been ... Feedback Neural Networks of Neural Networks Please answer the above question....
asked Aug 30, 2022 in Education by JackTerrance
...