• Welcome to PlanetSquires Forums.
 

message in command window

Started by raymw, August 07, 2019, 09:31:02 AM

Previous topic - Next topic

raymw

Hi, It's been a while since i was on here, and recently - today - I have started to write a simple program to interface to arduinos. It surprised, even me, how much I'd forgotten about fb. Anyway, I find that when the command window opens, I get a dozen or so lines showing 'dwExStyle: 512'. I can't remember that happening previously. I'm using winFBE 1.9.1 (32 bit). When I arranged the text boxes, etc. in the graphics designer, some of the boxes seemed to disappear off the edge of the window (jerky mouse movements) and I'm not sure if I've found them all.

Paul Squires

Hi Ray, turn off the "Snap lines" feature (found under the Designer menu). That will fix the jerky mouse movement thing. It is, let's say "a work in progress". :)

You can also try downloading the 1.9.2 beta that is on GitHub
https://github.com/PaulSquires/WinFBE/releases

That beta made a LOT of changes to the visual designer so you probably won't have as many issues. I strongly encourage you to try that version. Here is the direct link to the download: https://github.com/PaulSquires/WinFBE/releases/download/1.9.2-beta1/WinFBE_Suite.rar

That dwExStyle message may be a leftover debug output message that I was using for some code. I think that was removed.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

Thanks Paul, seems to be OK now. Not sure if in your plans, but I think it would be useful if a text box and a label could be combined in the same object - it would allow quick form layout, and save on my coding.

raymw

I seem to have no problem with gui, and your debug hangovers have gone, but still jerky movement unless as you mentioned I switch off the auto align. If the buttons/textboxes, whatever whiz off to the right or bottom of the form, then a resize of the form brings them back into view, and they can be deleted or moved. What happens when the go off the form to the top or left? I can't stretch the form edges in that direction, are they actually deleted, or still in the system with negative axes?

Anyway, I could do with some code snippets. I have a button to start the reading via serial port of the various sensors connected wirelessly to the master arduino. It is a function, started off by a button click when various settings have been configured consisting of the opening of the port, and then a 'loop' which reads the serial stream. I can't remember how to interrupt that loop by the press of another button on the gui. The only way I can stop the loop is by closing down the command window, (I have debug values printing to the command window) the form does not respond and greys out after two button presses.

Thanks, Best wishes,
Ray

Paul Squires

Maybe have a "Stop" button and when clicked sets a global boolean gStopReading to True.

Add a call to AfxDoEvents within your loop and then check the value of the global gStopReading variable right after the AfxDoEvents. Exit the loop if True.

Maybe that works?
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

Thanks Paul, seems to do the job.

raymw

Hi Paul,
I'm printing my debug to console. If I compile program, I get no error messages or warnings, except if I compile win32 GUI (Release). I think it is caused by something not matching in the compile options on the edit screen and the build configurations under the Options tab. I thought they would be linked together. The error is in a function I have for handling strings, maybe the different compiles do not include 'string.bi' i.e the release ignores #include "string.bi"

Best wishes,

Ray

Paul Squires

Hi Ray - I don`t understand your question.

You`re developing and writing output to the console (using PRINT statements I assume) using Win32 Console (Release)?

When you switch to Win32 GUI (Release) you are getting errors during the compile process?

WinFBE does not automatically add or remove the #include "string.bi" file. I assume you're including that file in order to have access to the FORMAT function.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

ok, in editor on the 'line to the right of where you can hit the arrow keys for compile, etc'. there is a drop down list for compile options. Select any of that list - then open on the top line Options- build configuration and you see the same compile option is selected. but, if you change the compile option there,in the build configuration page  it does not show the change in the editor page - the box by the compile buttons.
I could not compile as gui, no console, but could with other compile options. Also, the program I'm writing does not close properly from the gui window 'X' . i. e. it disappears, but can't then recompile - says it is still running. I don't recollect having to do anything else to shut down my written programs.
Best wishes,
Ray
ps a few keywords are  not highlighted in winfbe, 'frac', for example, but 'fix' is.

Paul Squires

Quote from: raymw on August 09, 2019, 03:44:31 PM
ok, in editor on the 'line to the right of where you can hit the arrow keys for compile, etc'. there is a drop down list for compile options. Select any of that list - then open on the top line Options- build configuration and you see the same compile option is selected. but, if you change the compile option there,in the build configuration page  it does not show the change in the editor page - the box by the compile buttons.
Thanks - I have fixed that. I made a silly error there.

QuoteAlso, the program I'm writing does not close properly from the gui window 'X' . i. e. it disappears, but can't then recompile - says it is still running. I don't recollect having to do anything else to shut down my written programs.
Sounds like there is a running loop or thread within your program that hasn't terminated leaving the program in memory. If you still have the problem then I can take a look at your program for you if you wish.

Quoteps a few keywords are  not highlighted in winfbe, 'frac', for example, but 'fix' is.
Thanks - I have added FRAC to the syntax highlighting.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Quote from: Paul Squires on August 07, 2019, 10:08:30 AM
Hi Ray, turn off the "Snap lines" feature (found under the Designer menu). That will fix the jerky mouse movement thing. It is, let's say "a work in progress". :)

Looks like I found the source of that snap lines jerky mouse movement. I was not resetting the snap lines properties once the mouse button was released. This caused problems when subsequent moves of the control took place.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

Great, I knew you would fix it, thanks.

raymw

still problem with compile
target:       win32, 486, 32bit
compiling:    C:\Users\Ray\Desktop\rayprojects\ray_sensors\anilserr.bas -o C:\Users\Ray\Desktop\rayprojects\ray_sensors\anilserr.asm (main module)
C:\Users\Ray\Desktop\rayprojects\ray_sensors\anilserr.bas(269) error 99: No matching overloaded function, ACCEPTSRETURN()


error 99, (line -19) I had it compiling and running OK. I loaded in another previously running basic file, to remind me of some code I'd written in there. When I saw what I wanted to see, I deleted the added program, and then when I went to run the original, it gave the error message. Both programs have the gui forms. Not sure if you can replicate this.

raymw

There was not a very complicated form, so I copied the basic file and loaded into wfbe editor. All of your form design was commented out, as usual, but the error is here,

function readerType.FormInitializeComponent( byval pForm as readerType ptr ) as LRESULT
   dim as long nClientOffset

   pForm->Text = "Reader"
   pForm->SetBounds(10,10,500,300)
   pForm->Button1.Parent = pForm
   pForm->Button1.Text = "Read File"
   pForm->Button1.SetBounds(295,62-nClientOffset,114,32)
   pForm->Button1.OnClick = @reader_Button1_Click
   pForm->Text1.Parent = pForm
  ' pForm->Text1.AcceptsReturn =
   pForm->Text1.Text = "temperature1a.txt"
   pForm->Text1.SetBounds(60,62-nClientOffset,187,35)
   pForm->Label1.Parent = pForm
   pForm->Label1.Text = "File Name"
   pForm->Label1.SetBounds(61,26-nClientOffset,155,24)
   pForm->Controls.Add(ControlType.Button, @(pForm->Button1))
   pForm->Controls.Add(ControlType.TextBox, @(pForm->Text1))
   pForm->Controls.Add(ControlType.Label, @(pForm->Label1))
   Application.Forms.Add(ControlType.Form, pForm)
   function = 0
end function

I commented out the line in error, as you can see, and it is now back running. Maybe there is a clue in here somewhere, as to why is is so easy for me to break this.

Paul Squires

A few days ago I fixed a bug where Form files would not load correctly into an existing project via the "Add files to project" menu option. I expect that this may have something to do with it and why the value for the AcceptsReturn property got blanked.

I am close to having the code generation for the StatusBar and ToolBar finished. When that is complete then I will upload a new WinFBE package for everyone to test.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer