What is the difference between post api call and form submission with post method?

There are multiple ways to submit a form from the browser: HTML form, submit button, user presses submit button, no Javascript involved. HTML form in the page, Javascript gets DOM element for the form and calls .submit() method on the form object. Ajax call using the XMLHttpRequest interface with the POST method and manually sending … Read more

How to kill processes by name? (Win32 API)

Try below code, killProcessByName() will kill any process with name filename : #include <windows.h> #include <process.h> #include <Tlhelp32.h> #include <winbase.h> #include <string.h> void killProcessByName(const char *filename) { HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL); PROCESSENTRY32 pEntry; pEntry.dwSize = sizeof (pEntry); BOOL hRes = Process32First(hSnapShot, &pEntry); while (hRes) { if (strcmp(pEntry.szExeFile, filename) == 0) { HANDLE hProcess = … Read more

Wrapping C++ class API for C consumption

Foreach public method you need a C function. You also need an opaque pointer to represent your class in the C code. It is simpler to just use a void* though you could build a struct that contains a void* and other information (For example if you wanted to support arrays?). Fred.h ——————————– #ifdef __cplusplus … Read more

tech