Author Topic: wxWidgets 2.9 patches to get Code::Blocks project to compile and run  (Read 8063 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
FYI:

I have tested the patches against 2.9.2 wxWidgets and wxWidgets trunk SVN 68807.

I have not confirmed that the patches are correct.

Tim S.

Code
Index: src/sdk/cbauibook.cpp
===================================================================
--- src/sdk/cbauibook.cpp (revision 7398)
+++ src/sdk/cbauibook.cpp (working copy)
@@ -549,9 +549,13 @@
         // If we open a project or a workspace, it can happen, that the tabCtrl is not yet rendered.
         // in this case IsTabVisible always returns true and does not work correctly therefore.
         // So we force a paint event here to render the tabCtrl
-        // a little hacky, but it works
+        // a little hacky, but it works; not tested wx 2.9.2 change
+        #if wxCHECK_VERSION(2,9,2)
+        // No Idea if anything should be added here
+        #else
         wxPaintEvent event;
         tabCtrl->ProcessEvent(event);
+        #endif
         int tabOffset = tabCtrl->GetTabOffset();
 
         wxClientDC dc(win);

Code
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- src/plugins/codecompletion/parser/parserthread.cpp (revision 7398)
+++ src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -523,7 +523,7 @@
         {
             // token length of 1
             case 1:
-            switch (token[0])
+            switch ((wxChar)token[0])
             {
             case ParserConsts::semicolon_chr:
                 {
@@ -2681,7 +2681,7 @@
     wxArrayString container;
     for (size_t i = 0; i < args.Len(); ++i)
     {
-        switch (args.GetChar(i))
+        switch ((wxChar)args.GetChar(i))
         {
         case ParserConsts::space_chr:
             container.Add(word);

Code
Index: src/sdk/scripting/bindings/sc_wxtypes.cpp
===================================================================
--- src/sdk/scripting/bindings/sc_wxtypes.cpp (revision 7398)
+++ src/sdk/scripting/bindings/sc_wxtypes.cpp (working copy)
@@ -241,6 +241,8 @@
         ///////////////////
         // wxArrayString //
         ///////////////////
+        typedef wxString&(wxArrayString::*WXAS_ITEM)(size_t);
+
         SqPlus::SQClassDef<wxArrayString>("wxArrayString").
                 emptyCtor().
                 func(&wxArrayString::Add, "Add").
@@ -248,7 +250,11 @@
 //                func(&wxArrayString::Index, "Index").
                 staticFuncVarArgs(&wxArrayString_Index, "Index", "*").
                 func(&wxArrayString::GetCount, "GetCount").
+                #if wxCHECK_VERSION(2, 9, 2)
+                func<WXAS_ITEM>(&wxArrayString::Item, "Item");
+                #else
                 func(&wxArrayString::Item, "Item");
+                #endif
 
         //////////////
         // wxColour //
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #1 on: August 23, 2011, 03:22:02 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #2 on: August 23, 2011, 03:22:50 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

It is NOT the correct fix; I tried it.
It causes a runtime warning that paint events are NOT allowed.

Tim S.
« Last Edit: August 23, 2011, 03:24:32 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #3 on: August 23, 2011, 03:50:46 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

It is NOT the correct fix; I tried it.
It causes a runtime warning that paint events are NOT allowed.

Tim S.

Which GCC version are you using? I'm using MingW GCC 4.5.2.

I compiled CB with this patch and the others you submitted.

However, the CB crashed when I create a new test CPP project. The new Dititalmars D project works.

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #4 on: August 23, 2011, 03:58:00 am »

However, the CB crashed when I create a new test CPP project. The new Dititalmars D project works.

If codecompletion.dll is disabled, all the projects works (It seems that the patchs for codecompletion plugin not works). When CB quiting, an error raised (There are no more error messages).
« Last Edit: August 23, 2011, 03:59:57 am by heromyth »

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #5 on: August 23, 2011, 04:15:32 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

It is NOT the correct fix; I tried it.
It causes a runtime warning that paint events are NOT allowed.

Tim S.

That's true. I got the error message in codeblocks.RPT:

-------------------

Error occured on Tuesday, August 23, 2011 at 10:11:37.

D:\Program Files\codeblocks\codeblocks.exe caused an Access Violation at location 00000000 Reading from location 00000000.

Registers:
eax=022107e8 ebx=0220f730 ecx=00000000 edx=0226ff08 esi=00e05e18 edi=0022f0c8
eip=00000000 esp=0022ece0 ebp=0022ecfc iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010206

Call stack:
00000000
6323863A  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:6323863A  _ZN12wxEvtHandler6UnlinkEv
63238DF1  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63238DF1  _ZN12wxEvtHandlerD1Ev
64BC5C4E  D:\Program Files\codeblocks\share\codeblocks\plugins\compiler.dll:64BC5C4E
64BC5CC5  D:\Program Files\codeblocks\share\codeblocks\plugins\compiler.dll:64BC5CC5
61849180  D:\Program Files\codeblocks\codeblocks.dll:61849180  _ZN7LogSlotD2Ev
61849649  D:\Program Files\codeblocks\codeblocks.dll:61849649  _ZN10LogManagerD1Ev
618496F1  D:\Program Files\codeblocks\codeblocks.dll:618496F1  _ZN10LogManagerD0Ev
619DD7C8  D:\Program Files\codeblocks\codeblocks.dll:619DD7C8  _ZN3MgrI10LogManagerE4FreeEv
6185209B  D:\Program Files\codeblocks\codeblocks.dll:6185209B  _ZN7Manager8ShutdownEv
0042CC8E  D:\Program Files\codeblocks\codeblocks.exe:0042CC8E
63102D72  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63102D72  _ZNK16wxAppConsoleBase16CallEventHandlerEP12wxEvtHandlerR14wxEventFunctorR7wxEvent
6323871E  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:6323871E  _ZN12wxEvtHandler23ProcessEventIfMatchesIdERK21wxEventTableEntryBasePS_R7wxEvent
63238823  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63238823  _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
63238A48  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63238A48  _ZN12wxEvtHandler11TryHereOnlyER7wxEvent
632388B2  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632388B2  _ZN12wxEvtHandler10DoTryChainER7wxEvent
63238AFD  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63238AFD  _ZN12wxEvtHandler12ProcessEventER7wxEvent
63238901  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63238901  _ZN12wxEvtHandler18SafelyProcessEventER7wxEvent
6341C937  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:6341C937  _ZN12wxWindowBase5CloseEb
632EA064  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632EA064  _ZN7wxFrame13MSWWindowProcEjjl
632B6171  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632B6171  _Z9wxWndProcP6HWND__jjl@16
77D18734  C:\WINDOWS\system32\USER32.dll:77D18734  GetDC
77D18816  C:\WINDOWS\system32\USER32.dll:77D18816  GetDC
77D28EA0  C:\WINDOWS\system32\USER32.dll:77D28EA0  DefWindowProcW
77D28EEC  C:\WINDOWS\system32\USER32.dll:77D28EEC  DefWindowProcW
7C92E473  C:\WINDOWS\system32\ntdll.dll:7C92E473  KiUserCallbackDispatcher
77D28DD9  C:\WINDOWS\system32\USER32.dll:77D28DD9  DefWindowProcW
5ADC3BC2  C:\WINDOWS\system32\uxtheme.dll:5ADC3BC2  DrawThemeText
5ADDC7F6  C:\WINDOWS\system32\uxtheme.dll:5ADDC7F6  GetThemeAppProperties
5ADC1AC7  C:\WINDOWS\system32\uxtheme.dll:5ADC1AC7
5ADC1B3D  C:\WINDOWS\system32\uxtheme.dll:5ADC1B3D
77D294ED  C:\WINDOWS\system32\USER32.dll:77D294ED  GetPropW
632BA068  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632BA068  _ZN8wxWindow16MSWDefWindowProcEjjl
632BAE3C  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632BAE3C  _ZN8wxWindow13MSWWindowProcEjjl
632E9F2F  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632E9F2F  _ZN7wxFrame13MSWWindowProcEjjl
632B6171  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632B6171  _Z9wxWndProcP6HWND__jjl@16
77D18734  C:\WINDOWS\system32\USER32.dll:77D18734  GetDC
77D2BDF1  C:\WINDOWS\system32\USER32.dll:77D2BDF1  UserLpkPSMTextOut
77D2927B  C:\WINDOWS\system32\USER32.dll:77D2927B  GetParent
77D292E3  C:\WINDOWS\system32\USER32.dll:77D292E3  SendMessageW
5ADE8895  C:\WINDOWS\system32\uxtheme.dll:5ADE8895  Ordinal61
5ADC1AC7  C:\WINDOWS\system32\uxtheme.dll:5ADC1AC7
5ADC1B3D  C:\WINDOWS\system32\uxtheme.dll:5ADC1B3D
77D294ED  C:\WINDOWS\system32\USER32.dll:77D294ED  GetPropW
632BA068  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632BA068  _ZN8wxWindow16MSWDefWindowProcEjjl
632BAE3C  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632BAE3C  _ZN8wxWindow13MSWWindowProcEjjl
632E9F2F  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632E9F2F  _ZN7wxFrame13MSWWindowProcEjjl
632B6171  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632B6171  _Z9wxWndProcP6HWND__jjl@16
77D18734  C:\WINDOWS\system32\USER32.dll:77D18734  GetDC
77D18816  C:\WINDOWS\system32\USER32.dll:77D18816  GetDC
77D189CD  C:\WINDOWS\system32\USER32.dll:77D189CD  GetWindowLongW
77D18A10  C:\WINDOWS\system32\USER32.dll:77D18A10  DispatchMessageW
632469C2  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:632469C2  _ZN14wxGUIEventLoop14ProcessMessageEP6tagMSG
63246C50  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63246C50  _ZN14wxGUIEventLoop8DispatchEv
6312CCE0  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:6312CCE0  _ZN17wxEventLoopManual3RunEv
63103A1E  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63103A1E  _ZN16wxAppConsoleBase8MainLoopEv
004045BA  D:\Program Files\codeblocks\codeblocks.exe:004045BA
63176602  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63176602  _Z11wxEntryRealRiPPw
63247896  E:\doc\mingw\bin\wxmsw292u_gcc_custom.dll:63247896  _Z7wxEntryP11HINSTANCE__S0_Pci
00401B13  D:\Program Files\codeblocks\codeblocks.exe:00401B13
0044BF6C  D:\Program Files\codeblocks\codeblocks.exe:0044BF6C
004010BB  D:\Program Files\codeblocks\codeblocks.exe:004010BB
004012C8  D:\Program Files\codeblocks\codeblocks.exe:004012C8
7C817077  C:\WINDOWS\system32\kernel32.dll:7C817077  RegisterWaitForInputIdle



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #6 on: August 23, 2011, 04:24:46 am »
Which GCC version are you using? I'm using MingW GCC 4.5.2.

gcc version 4.5.2 (tdm-1)

But, that does not matter; remember I am getting a run-time message NOT a compiler message.

Tim S.
« Last Edit: August 23, 2011, 06:45:52 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #7 on: August 23, 2011, 06:45:48 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

It is NOT the correct fix; I tried it.
It causes a runtime warning that paint events are NOT allowed.

Tim S.

It's OK for wxWidgets 2.8.11.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: wxWidgets 2.9 patches to get Code::Blocks project to compile and run
« Reply #8 on: August 23, 2011, 06:47:19 am »
cbauibook patches:

To replace
     tabCtrl->ProcessEvent(event);
with
     GetEventHandler()->ProcessEvent(event);

It is NOT the correct fix; I tried it.
It causes a runtime warning that paint events are NOT allowed.

Tim S.

It's OK for wxWidgets 2.8.11.

Since, the runtime messages do NOT exist in the 2.8 branch; I would NOT think the message would show up.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org