Author Topic: wxSmith error in initial parsing ofWxs file on new prject  (Read 7582 times)

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
wxSmith error in initial parsing ofWxs file on new prject
« on: June 21, 2007, 01:18:42 pm »
Hi,

i just installed code::blocks svn 4124 , the mingw 5.13 environment, wxWidgets 2.8.4 compiled with "mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug"

now i set up a new project with the wizard as explained in the tutorial "http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Hello_world"

everythings fine but at the end of creating the new project there shows a small message-box saying:

"Coudn't parse newly created Wxs file
wxSmith support is disabled"

the contents of the created Wxs file is:

Code
<?xml version="1.0" encoding="utf-8" ?>
<wxsmith>
    <object class="wxFrame" name="testFrame">
        <object class="wxMenuBar" variable="MenuBar1" member="no">
            <object class="wxMenu" variable="Menu1" member="no">
                <label>&amp;File</label>
                <object class="wxMenuItem" name="idMenuQuit" variable="MenuItem1" member="no">
                    <label>Quit</label>
                    <accel>Alt-F4</accel>
                    <help>Quit the application</help>
                    <handler function="OnQuit" entry="EVT_MENU" />
                </object>
            </object>
            <object class="wxMenu" variable="Menu2" member="no">
                <label>Help</label>
                <object class="wxMenuItem" name="idMenuAbout" variable="MenuItem2" member="no">
                    <label>About</label>
                    <accel>F1</accel>
                    <help>Show info about this application</help>
                    <handler function="OnAbout" entry="EVT_MENU" />
                </object>
            </object>
        </object>
        <object class="wxStatusBar" name="ID_STATUSBAR1" variable="StatusBar1" member="yes">
            <fields>1</fields>
            <widths>-1</widths>
            <styles>wxSB_NORMAL</styles>
        </object>
    </object>
</wxsmith>

where am i making the error...? :(
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #1 on: June 21, 2007, 01:37:54 pm »
well i dont know...

i solved the problem myself putting the folder of codeblocks directly under C: , before i had it in some sub-sub-directory with some strange names inbetween (with whitespaces and spanisch letters like ñ and so)

now it works

excuse me not trying first, but perhaps this could be a bug...? ah, and in the message of the box theres a spelling error: in the word coudn't there's missing the "l"
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #2 on: June 21, 2007, 02:08:41 pm »
usually creating project in path with contains local characters is not a good idea. C::B has some problems with it, but since it can be simply avoided (by using path without these characters), it's not considered as "critical".

BYO

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #3 on: June 21, 2007, 02:25:24 pm »
Generally putting a local character in project path or project filename crashes C::B. In that sense you are quite lucky that C::B didn't crash.

I've been facing such crash. I can't use my native language to name a file. Especially if it's a C::B project file. TinyXML parser crashes C::B while opening it.

C::B behaves fine with a text file though; which is not handled by TinyXML.
Be a part of the solution, not a part of the problem.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #4 on: June 21, 2007, 02:37:07 pm »
Hmm, there's TinyXML::LoadDocument put into <tinyxml/tinywxuni.h> which should take care of such bugs. And I guess that it should be preffered method of loading xml stuff. It's little bit hard to find since it's not documented and not put into globals.h (simillar saving function has wrapped in this file).

I'll need to update wxSmith's code.

BYO

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #5 on: June 21, 2007, 02:43:35 pm »
@Byo, Please don't be sad. It's not wxSmith which crashes. :)

C::B crashes at Line 62:sdk/projectloader.cpp.
Be a part of the solution, not a part of the problem.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #6 on: June 21, 2007, 03:32:37 pm »
Byo, hi, i'm bothering you again... sorry,

what is the status of wxSmith really rigth now? i meen, there is for example that function to add a menubar to a frame and then to add menues to the bar, but unless there is some clue i really don't know, or it simply isn't working, that is i don't fet any menuebar in the compiled and executing program. the statusbar does work. (?) is this still on the road and work in progress?

also that check-box in the new-project wizzard: the one which sias use wxSmith as grafical tool... it works fine, even compiles, but it seems that the xml of the wxs file isn't transformed into c++ and it does not appear in any file. the programm runs, but naturally shows nothing since its frame is actually missing. and it can't be terminated through code::blocks (the red cross button)...

im i getting this wrong too?  :shock:

if i try to generate an empty project and later add files nad frames to it with wxSmith it adds an app file without headerfile, its all in the cpp file...  being so much a noob in this all i get quite confused :mrgreen:

please, don't take anything i say as critic or something, i really am very glad, that this programm and your plugin exist!

regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #7 on: June 21, 2007, 04:11:43 pm »
what is the status of wxSmith really rigth now? i meen, there is for example that function to add a menubar to a frame and then to add menues to the bar, but unless there is some clue i really don't know, or it simply isn't working, that is i don't fet any menuebar in the compiled and executing program. the statusbar does work. (?) is this still on the road and work in progress?

Hmm, I use wxSmith for some time and I was able to write few more advanced apps using it, so that prooves that this plugin is actually working quite well. Of course there are always some bugs, that's unavoidable, but finding them and removing may be really time-consuming and intensive process. Also note that many parts of wxSmith could be done better, more user friendly and so on. Of course enw features will be added in future, but for now, bug-fixing has highest priority.

also that check-box in the new-project wizzard: the one which sias use wxSmith as grafical tool... it works fine, even compiles, but it seems that the xml of the wxs file isn't transformed into c++ and it does not appear in any file. the programm runs, but naturally shows nothing since its frame is actually missing. and it can't be terminated through code::blocks (the red cross button)...

If you choose wxFrame-based window, it should actually have status bar and menu bar, nothing else. If you choose wxDialog-based it adds some text and buttons into it. I don't know what's the problem, but when I create any project using wizard it works out-of-the-box. Maybe it's some kind of wxSmith bug, try playing with paths (f.ex. remove any spaces etc).

Quote
if i try to generate an empty project and later add files nad frames to it with wxSmith it adds an app file without headerfile, its all in the cpp file...  being so much a noob in this all i get quite confused :mrgreen:

For empty App class, header file is not required, because usually you won't use it anywhere in the code.

Quote
please, don't take anything i say as critic or something, i really am very glad, that this programm and your plugin exist!

No, I threat this rather as a source of information ;) If you have some problems with something that may require some changes in wxSmith since other people can face same problem.

After summing things up: it looks like you have some strange problems with wxSmith which I've never seen before. When I do some test on my local machine, everything works well. So the only thing I could suggest to you is to experiment and if you find the reason of problems just give me some feedback so maybe I'll be able to fix it.

Regards
   BYO

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #8 on: June 21, 2007, 04:27:41 pm »
Hmm, there's TinyXML::LoadDocument put into <tinyxml/tinywxuni.h> which should take care of such bugs. And I guess that it should be preffered method of loading xml stuff. It's little bit hard to find since it's not documented and not put into globals.h (simillar saving function has wrapped in this file).

Thanks for pointing this. :D  I've fixed (not in svn though) the project loading/workspace loading bug.

But there's another bug. Crash report is as follows. I've used a non-English project name.

Quote
Error occured on Thursday, June 21, 2007 at 22:19:13.

F:\cbsource\src\devel\codeblocks.exe caused an Access Violation at location 77c478c0 in module C:\WINDOWS\system32\msvcrt.dll Reading from location 00000000.

Registers:
eax=00000000 ebx=01450ca0 ecx=00000000 edx=00000001 esi=004c19a8 edi=05ed4728
eip=77c478c0 esp=0023ede4 ebp=0023ee70 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010246

Call stack:
77C478C0  C:\WINDOWS\system32\msvcrt.dll:77C478C0  strlen
61873C92  F:\cbsource\src\devel\codeblocks.dll:61873C92  cbWrite(wxFile&, wxString const&, wxFontEncoding)  F:/cbsource/src/sdk/globals.cpp:477
63C1F13D  F:\cbsource\src\devel\share\codeblocks\plugins\scriptedwizard.dll:63C1F13D  Wiz::GenerateFile(wxString const&, wxString const&, wxString const&)  F:/cbsource/src/plugins/scriptedwizard/wiz.cpp:702
63C1CC14  F:\cbsource\src\devel\share\codeblocks\plugins\scriptedwizard.dll:63C1CC14  Wiz::RunProjectWizard(wxString*)  F:/cbsource/src/plugins/scriptedwizard/wiz.cpp:452
63C1B923  F:\cbsource\src\devel\share\codeblocks\plugins\scriptedwizard.dll:63C1B923  Wiz::Launch(int, wxString*)  F:/cbsource/src/plugins/scriptedwizard/wiz.cpp:318
619228A4  F:\cbsource\src\devel\codeblocks.dll:619228A4  TemplateManager::NewFromTemplate(NewFromTemplateDlg&, wxString*)  F:/cbsource/src/sdk/templatemanager.cpp:127
619227A9  F:\cbsource\src\devel\codeblocks.dll:619227A9  TemplateManager::New(TemplateOutputType, wxString*)  F:/cbsource/src/sdk/templatemanager.cpp:115
00435A14  F:\cbsource\src\devel\codeblocks.exe:00435A14  MainFrame::OnFileNewWhat(wxCommandEvent&)  F:/cbsource/src/src/main.cpp:2065
00432318  F:\cbsource\src\devel\codeblocks.exe:00432318  MainFrame::OnStartHereLink(wxCommandEvent&)  F:/cbsource/src/src/main.cpp:1686
6CD07305  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD07305  _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
6CD0765C  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD0765C  _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
6CD08629  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD08629  _ZN12wxEvtHandler12ProcessEventER7wxEvent
6CD08449  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD08449  _ZN12wxEvtHandler20ProcessPendingEventsEv
6CC41BF4  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CC41BF4  _ZN12wxAppConsole20ProcessPendingEventsEv
6D1F7EB5  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6D1F7EB5  _ZN18wxHtmlSearchEngineD1Ev
7E41F84A  C:\WINDOWS\system32\USER32.dll:7E41F84A  EnableMenuItem
7E41F7F6  C:\WINDOWS\system32\USER32.dll:7E41F7F6  EnableMenuItem
7E41F94B  C:\WINDOWS\system32\USER32.dll:7E41F94B  CallNextHookEx
7C90EAE3  C:\WINDOWS\system32\ntdll.dll:7C90EAE3  KiUserCallbackDispatcher
6CD4D5F4  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD4D5F4  _ZN11wxEventLoop8DispatchEv
6CE23366  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CE23366  _ZN17wxEventLoopManual3RunEv
6CDF202E  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CDF202E  _ZN9wxAppBase8MainLoopEv
00404CC2  F:\cbsource\src\devel\codeblocks.exe:00404CC2  CodeBlocksApp::OnRun()  F:/cbsource/src/src/app.cpp:605
6CC8E477  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CC8E477  _Z14wxUninitializev
6CD10ACC  F:\cbsource\src\devel\wxmsw28u_gcc_cb.dll:6CD10ACC  _Z7wxEntryP11HINSTANCE__S0_Pci
004018AC  F:\cbsource\src\devel\codeblocks.exe:004018AC  WinMain  F:/cbsource/src/src/app.cpp:287
004628DA  F:\cbsource\src\devel\codeblocks.exe:004628DA
00401247  F:\cbsource\src\devel\codeblocks.exe:00401247
004012B8  F:\cbsource\src\devel\codeblocks.exe:004012B8
7C816FD7  C:\WINDOWS\system32\kernel32.dll:7C816FD7  RegisterWaitForInputIdle
Be a part of the solution, not a part of the problem.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #9 on: June 21, 2007, 04:45:59 pm »
 :( sorry  :(

meditaded a little and went over to the windows user settings folder and erased the folder "codeblocks" and reinstalled codeblocks and now it all works fine and like you sayd and you were right and i should think a little more...  :|

good, that all of you are so pacient  :D

greetings
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith error in initial parsing ofWxs file on new prject
« Reply #10 on: June 21, 2007, 08:01:19 pm »
:( sorry  :(

Glad to hear that everything works fine now :)

BYO