1. Windows, memstructs, win32lib, IDE
- Posted by mattlewis (admin) Aug 26, 2012
- 1690 views
As you may recall, I've been working on adding better C-like memory structure capabilities to euphoria. This effort will be critical, I think, for getting Win32Lib working with 64-bit euphoria, and I've put in a lot of effort converting win32lib from its internal struct library to using memstructs.
I tried adapting the existing code to be portable between 32 and 64-bits, but that wasn't really worth it, so I've been working on converting all of Win32Lib (not completely done). Also, to help test that conversion, I've been working on updating the old Win32Lib IDE. This has included some 4.x code cleanup, plus converting legacy Win32Lib struct handling. Currently, it seems to run, though I haven't done much testing.
I have posted new windows eubins:
These are just a zip of the basic euphoria source tree with the binaries put into the bin dir. You'll need to set up appropriate eu.cfg files.
I have also posted downloads of my updates to Win32Lib and the IDE on sourceforge.
It would be great if some adventurous people tried this stuff out. Note that your existing Win32lib programs may not run as-is, especially if they directly use the legacy Win32Lib structs code. I'd really appreciate feedback about things that aren't working.
Matt
2. Re: Windows, memstructs, win32lib, IDE
- Posted by AndyDrummond Aug 27, 2012
- 1398 views
Matt,
Not sure if I have done this right but I downloaded your eubins and installed in c:\euphoria4, added the win32lib (renamed from the dated-name you used) and the ide (similarly renamed). The IDE started with the usual long delay, put up its startup window then crashed:
C:\Euphoria4\ide\Includes\IDE_code.ew:2363 in procedure Resize_CodeWin() variable Code_R1 has not been assigned a valueHave I done something weird or is ithis an actual "error"!
I'd like to get working with IDE & Win32Lib with Eu4 now that my work on old Eu3 has diminished to the point where I can forget it. So I want to get on with the most advanced offering rather than a basic old ide.
Andy
3. Re: Windows, memstructs, win32lib, IDE
- Posted by mattlewis (admin) Aug 27, 2012
- 1410 views
Matt,
Not sure if I have done this right but I downloaded your eubins and installed in c:\euphoria4, added the win32lib (renamed from the dated-name you used) and the ide (similarly renamed). The IDE started with the usual long delay, put up its startup window then crashed:
C:\Euphoria4\ide\Includes\IDE_code.ew:2363 in procedure Resize_CodeWin() variable Code_R1 has not been assigned a valueHave I done something weird or is ithis an actual "error"!
I've changed the initialization code a bit, and I've also been testing in WINE. It sounds like some event is firing before something critical has been initialized. It's a bit more dynamic, with different sections identifying their dependencies (rather than relying on the order in which files are included). Ultimately, this simplified a lot of things, but it's obviously not quite there yet.
Could you please post the stack trace into a pastey? All of the variable data probably isn't necessary, but the call stack should help me identify what isn't getting initialized properly.
Matt
4. Re: Windows, memstructs, win32lib, IDE
- Posted by AndyDrummond Aug 27, 2012
- 1414 views
Matt
Not used pastey before but I have done what seems right. Let me know if I have missed the right mechanism, but it seemed very simple. That's what worries me. I'm too used to Microsoft.....
Andy
5. Re: Windows, memstructs, win32lib, IDE
- Posted by mattlewis (admin) Aug 27, 2012
- 1389 views
Matt
Not used pastey before but I have done what seems right. Let me know if I have missed the right mechanism, but it seemed very simple. That's what worries me. I'm too used to Microsoft.....
That was very useful. Please see if this fix to Includes/IDE_window.ew helps:
procedure initialize_property_sheet() --prop.ew define the controls ensure( "config" ) ensure( "code" ) ...
Basically, you're adding that ensure( "config" ) line, which should initialize the bit that you're having problems with. Unfortunately, I suspect there may be other, similar things that will need to be added.
To expand on what I've done there, you can take a look at the file Includes/IDE_init.ew. This has some stuff that allows modules to register their initialization functions and identify their dependencies, so that things are initialized in the correct order.
Then, all of the modules have a call to register() to register their initialization. When the initialization routine is called, it can call ensure(), which checks to see if the dependency has been called yet. If not, then it is called, otherwise it simply returns.
This way, I can easily reorganize the code without breaking a dependency on include order to ensure that things get initialized in the right order.
Matt
6. Re: Windows, memstructs, win32lib, IDE
- Posted by AndyDrummond Aug 27, 2012
- 1388 views
That fixes it, Matt, and it runs a vestigial program OK. Now I have to see what I can do with it all!
I can see what you're doing with a common initialization routine. One thing I wanted to ask for in Eu4 but didn't dare ask for was for the object() type to return False if the object has not been initialised, True in all other cases. Then a routine could initialise any parameters which were undefined by using that. It would save having to have explicit initialisation routines being called at the program startup:
if !object(fred) then fred = "" endif
Andy
7. Re: Windows, memstructs, win32lib, IDE
- Posted by AndyDrummond Aug 27, 2012
- 1349 views
Another thing - I tried to eubind the ide.exw because I like to work by associating my ide files (I use extension ide rather that prj to avoid conflicts) and then I can simply double click on the ide file and key presto! I can get around that but ide.exw takes a long time to wind up by which time I forget what I am about to do! Well, not quite, but you follow my drift? Anyway, I couldn't eubind it as it claimed that int was being redefined...
I mention it merely for information, as my friend Marvin would say in H2G2...
Andy
8. Re: Windows, memstructs, win32lib, IDE
- Posted by mattlewis (admin) Aug 27, 2012
- 1351 views
That fixes it, Matt, and it runs a vestigial program OK. Now I have to see what I can do with it all!
I can see what you're doing with a common initialization routine. One thing I wanted to ask for in Eu4 but didn't dare ask for was for the object() type to return False if the object has not been initialised, True in all other cases. Then a routine could initialise any parameters which were undefined by using that. It would save having to have explicit initialisation routines being called at the program startup:
if !object(fred) then fred = "" endif
You're late! Please take a look at the object() documentation.
Matt
9. Re: Windows, memstructs, win32lib, IDE
- Posted by mattlewis (admin) Aug 27, 2012
- 1381 views
Another thing - I tried to eubind the ide.exw because I like to work by associating my ide files (I use extension ide rather that prj to avoid conflicts) and then I can simply double click on the ide file and key presto! I can get around that but ide.exw takes a long time to wind up by which time I forget what I am about to do! Well, not quite, but you follow my drift? Anyway, I couldn't eubind it as it claimed that int was being redefined...
I mention it merely for information, as my friend Marvin would say in H2G2...
Ultimately, I would distribute a translated version. This will start up and run faster. Since you've confirmed that what I did fixed it, I may upload a translated version with that fix included. But remember, this is an admittedly incomplete update, so be careful using it for now.
Thanks for the testing!
Oh, what version of Windows are you using?
Matt
10. Re: Windows, memstructs, win32lib, IDE
- Posted by AndyDrummond Aug 27, 2012
- 1366 views
Ultimately, I would distribute a translated version. This will start up and run faster. Since you've confirmed that what I did fixed it, I may upload a translated version with that fix included. But remember, this is an admittedly incomplete update, so be careful using it for now.
Thanks for the testing!
Oh, what version of Windows are you using?
Matt
Ah! Object() does more than just return True! I should have realised that you pundits were ahead of an old experienced hand like me! I did start my programming using MAC - Mercury AutoCode - on a Ferranti Mercury computer! With valves, you heard of those?
I'm on Windows 7 SP1. I set myself to be administrator and set my UAC to zero because (initially anyway) if it wasn't I got all sorts of failures with Eu - Eu3 - and it made life tricky.
No worries about beta versions of IDE - I worked with Judith - God bless her - for years using ber Bleeding Edge IDE. Personally i love working that way, rather than just moaning that the compiler/interpreter is not doing what I think it ought.
Thanks ...
Andy