Hi you guys,
I'm newbie in Code::Blocks. I'm compiling my project in Code::Blocks version 17.12 with wxWidgets 3.1.0 (my wxWidgets installed and compiled successful), but when I paste my code, which I compile with GNU GCC Compiler successful without using wxWidgets, then compile with wxWidgets, it occured some error:
This is my function that I get from msdn:
int enumReg() {
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line)
DRIVER32, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi ) // Pointer to PROCESS_INFORMATION structure
)
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
}
}
and error:
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|45|error: cannot convert 'const char*' to 'LPWSTR {aka wchar_t*}' for argument '2' to 'WINBOOL CreateProcessW(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, WINBOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION)'|
Log:
||=== Build: Debug in ForHelperGUI (compiler: GNU GCC Compiler) ===|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|16|warning: ignoring #pragma comment [-Wunknown-pragmas]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp||In function 'int enumReg()':|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|45|error: cannot convert 'const char*' to 'LPWSTR {aka wchar_t*}' for argument '2' to 'WINBOOL CreateProcessW(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, WINBOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION)'|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|48|warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp||In function 'DWORD ListProcessModules()':|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|206|warning: deprecated conversion from string constant to 'TCHAR* {aka wchar_t*}' [-Wwrite-strings]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|217|warning: deprecated conversion from string constant to 'TCHAR* {aka wchar_t*}' [-Wwrite-strings]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp||In member function 'void ForHelperGUIFrame::OnbtnDumpClick(wxCommandEvent&)':|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|251|warning: unused variable 'lpThreadID' [-Wunused-variable]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|252|warning: unused variable 'hThreadArray' [-Wunused-variable]|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|260|warning: 'virtual void wxWindowBase::SetInitialBestSize(const wxSize&)' is deprecated: use SetInitialSize() instead. [-Wdeprecated-declarations]|
C:\wxWidgets-3.1.0\include\wx\window.h|1917|note: declared here|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp||In function 'int enumReg()':|
E:\WorkSpace\Code\ForHelperGUI\ForHelperGUIMain.cpp|51|warning: control reaches end of non-void function [-Wreturn-type]|
||=== Build failed: 1 error(s), 16 warning(s) (0 minute(s), 2 second(s)) ===|
Please help me. Thank for reading!