skip to Main Content

Visual Studio Code – error C2440: initialization: unable to convert "const char [10]" to "LPSTR"

I have this code: MyService: #define _CRT_SECURE_NO_WARNINGS #include <windows.h> #include <stdio.h> #define PIPE_NAME TEXT("\\.\pipe\MyNamedPipe") SERVICE_STATUS_HANDLE g_ServiceStatusHandle = NULL; SERVICE_STATUS g_ServiceStatus = { 0 }; HANDLE g_hStopEvent = NULL; void WINAPI ServiceMain(DWORD argc, LPTSTR* argv); void WINAPI ServiceCtrlHandler(DWORD CtrlCode); void ReportServiceStatus(DWORD…

VIEW QUESTION

Visual Studio Code – my c++ app don't run after i add this code

I add this code to my C++ app but I can't run the app anymore: void setclipbord(const char* szBuffer) { OpenClipboard(NULL); HGLOBAL hClipboardData = GlobalAlloc(GMEM_MOVEABLE, strlen(szBuffer) + 1); char* pchData = (char*)GlobalLock(hClipboardData); strcpy(pchData, szBuffer); GlobalUnlock(hClipboardData); EmptyClipboard(); SetClipboardData(CF_TEXT, hClipboardData); CloseClipboard(); }…

VIEW QUESTION
Back To Top
Search