PDA

View Full Version : Comm_Recv causes thinBasic to crash



Bevan
06-08-2007, 05:05
Hello All,

I'm new to thinBasic, but so far I have been quite impressed on how easy it has been to use, in fact it structure is close to the same as that used by Citect, which has probably made using it easier for me.

However I want to recieve one character of data every now and then to control a Clock that I have built for our local hockey club. When ever my code get to the line "Comm_Recv(hComm,nBytes,sBuffer)" even in the sample code, my thinBasic crashes with "thinBasic Language Interpreter GUI Application has encountered a problem and needs to close."

Does anyone know what I am doing wrong?

I have seen others mention the use of API to get data in and out via the serial ports, can someone give me an example of that use?

Regards,

Bevan Daniel

ErosOlmi
06-08-2007, 08:09
Hi Daniel,

wellcome here.

I will check if I find something wrong with COMM_Recv function. The error you get seems a GPF (general protection failure) and usually happen when application try to get/set data into an invalid memory address (pointer).

In the meantime, can you please be so kind to give me some info on you operating system?

Thanks a lot
Eros

Bevan
06-08-2007, 08:41
Hello Eros,

My Current machine is a IBM Pentium 4 3Ghz with 500Mb of Ram running Windows XP Professional, version 2002, service pack 2.

The Error Signature is:

AppName: thinbasic.exe AppVer: 1.4.0.0 ModName: thincore.dll
ModVer: 1.4.0.0 Offset: 0002cf94

I have also attached the error report incase that is helpful.

I have also included the script I have been working with, I must admit I have been a bit slack with commenting what everything is for. Basically the script will send out a serial string (not yet implemented) of clock data and I have built a remote control that has two or four buttons depending on which remote is being used. this allows the game to be started and paused remotely. The remote reciever generates the letters "a" or "c" depending on which button is pressed.

I have tried the sample code "testmodems.tbasic" and it gives the same errors.

Thank you for you help

Bevan

ErosOlmi
06-08-2007, 10:54
I didn't check your example but I checked thinCore.dll (the main thinBasic parsing/interpreting engine) and I hope to have fix the problem.
Please download new thinBasic.dll and substitute the one present in \thinBasic\ directory.

Please tell me if ok or still GPF.

Thanks a lot
Eros

ErosOlmi
06-08-2007, 11:14
I checked the console screen of your scipt. Nice, nice one. Thanks for using thinBasic.

I will check the full script this evening when I will have more time for this. For the moment I would like to concentrate of GPF and fix the problem you are having as soon as possible to give you the option to go on with your script. Let me know if previous attached thinCore.dll solve the problem or not.

Thanks a lot.
Eros

Bevan
07-08-2007, 00:54
Hello Eros,

Thank you for you fast response to my problem.

Unfortunately, the new thincore causes a new fault "The procedure entry point thinBasic_IAm could not be located in the dynamic link library THINCORE.DLL."

Regards,

Bevan

ErosOlmi
07-08-2007, 09:26
Bevan,

what version do you have installed of thinBasic?
If you have installed thinBasic 1.4.0.0, the thinCore.dll I sent you cannot be used because I sent you thinCore.dll version 1.4.0.1
You need to download and install thinBasic preview version 1.4.0.1 from http://www.thinbasic.com/index.php?name=CmodsDownload&file=index&req=viewsdownload&sid=34&orderby=dateD and than replace thinCore.dll with the one I attached to previous post.

As you may have read here in forum, we have 2 line of development: stable and preview.
Stable version is the one we officially release after some months of tests.
Preview version is the one under development and changed every time we fix important bugs. After some weeks of tests (in some cases some months) we release preview version as stable and start again a new preview development phase.

We will update stable version in first weeks of september.

Let me know.
Eros

ErosOlmi
07-08-2007, 12:26
Just one note.
In case you move to preview version 1.4.0.1, you will not be able to create bundled executable with this version due to missing sincronization with thinBasic protection dll (thinVL.dll)

Preview version 1.4.0.1 add the following changes to stable version 1.4.0.0: http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?whatsnew.htm

A new preview version is quite ready to be released. Important bugs has been fixed.

Ciao
Eros

Bevan
07-08-2007, 15:29
Hello again Eros,

Yes I was running the 1.4.0.0 stable version, I have now downloaded the 1.4.0.1 version and replaced the thincore.dll as per your request, however I still get the GPF when ever the Comm_recv line of code is processed.

Regards,

Bevan

ErosOlmi
07-08-2007, 15:37
OK, thanks. I will double check again all your script code and thinBasic interface.
In my tests with modem all seems working fine.
Can you please be so kind to confirm if TestModems.tBasic script is still generating a GPF after new thinBasic version installed?

Thanks a lot for you patience.
Eros

Bevan
07-08-2007, 15:57
Eros,

I have tested the "testmodem.tbasic" script although I had changed the one line but I put it back to Comm_recv(hComm,nBytes,sBuffer) which I believe was the original line. Once I put that line back in I started getting the GPF again.

I am using the command correctly? I haven't messed up the order of the variables etc?

Regards
Bevan

PS as for patience, I really don't mind helping with this problem as I can see the usefulness of the software.

ErosOlmi
07-08-2007, 16:07
Bevan,

can you please check thinBasic_COMM.dll version right-clicking on it , choose Properties menu and than see Version tab. It should show something like 1.0.9.x
If this is the case, please check attached file.
Substitute:
thinBasic.dll in \thinBasic\
thinBasic_COMM.dll in \thinbasic\Lib\

TestModem script is the same as old one I suppose.
If all will work now I will explain the problem in next post.

Thanks
Eros

Bevan
07-08-2007, 16:24
Hey Eros,

You have done it, all is fixed ;D

Thank you very much

Bevan

Bevan
07-08-2007, 16:26
and yes the version of the thinBasic_comm.dll was version 1.0.9.1 which I think was the version I downloaded from download.com

ErosOlmi
07-08-2007, 16:35
download.com ???? We are the only original ;D ;D

OK, now some exaplantions. In the recent past we had some licence problems with the company producing the compiler we use to build thinBasic.
As you may have read here in the forum, thinBasic is developed using PowerBasic (http://www.powerbasic.com) Compiler.
To manage serial communications we have used compiler internal built-in serial communication functionalities. We were warned by PowerBasic Inc. not to use them in native way (directly wrapped I mean). For this reason we stopped to release thinBasic_COMM.dll in official thinBasic releases. In the meantime we have review a lot that module and we are quite close to have a module that will not directly wrap PowerBasic serial communication functionalities.

That said, if you need something on COMM module and it will not be afficially released yet, just ask and we will fix or implement as needed.

Ciao
Eros

ErosOlmi
07-08-2007, 16:41
And, forgot to say, I'm very happy to see thinBasic can be used for real world problems.
We use thinBasic a lot in the company we work for and we know it can be used for many purpose. For this reason we are committed to make it as stable and fast as possible.

Feel always welcome here for any requests, critics or bugs reporting. User opinion is our best troubleshouter and thanks to this we are where we are now with thinBasic.

Ciao
Eros

Bevan
07-08-2007, 17:35
download.com was where I first learnt of thinBasic. so they are to blame for me hassling you ;)

I'm assuming that I can still use a line such as Comm_Set(hcomm,%comm_baud,1200) as all the gear I am connecting to was developed around that lower baud rate, as I only have the one serial port on this laptop to test data in both directions I will have to do the final testing tomorrow on my work desktop.

Thank you for your assistance with all this. I have found thinBasic to be very enjoyable to work with, my current project needs a bit of tidying up and I have yet to develop a "database" of all the games to be played, but I have plans on how to do it.

Please don't take offence, but this software is being used to replace a Tandy TRS80 that is currently controlling the scoreboard, but is maxed out on memory use, and has limited functionality, and each weeks games are programmed in as data lines, weekly.

Regards,

Bevan

I will send you a copy of my project when I have got it finished for you to have a look at.

ErosOlmi
07-08-2007, 17:53
Yes, you are right on download.com !

On connection speed, yes, it is fine.

Offended, absolutely not :D
I'm just worried about long run script. I mean, how long will the script need to be executed? Make some tests before official run. Let the script executed for a night or some hours and see if any corruption. Recently I fixed a memory leak problem (fixed in the thinCore.dll you have now) that was not releasing few bytes every run in user defined functions. So, execute the script and see if used memory by thinBasic is stable or not. You can do it by executing the script and looking in task manager process list. Would be quite bad to have your scoreboard hang during the game :-[

Ciao
Eros

PS: please find here attached a revised help file with COMM module help. Official one have no COMM module in help file (for the moment).

Bevan
08-08-2007, 02:34
Hello Eros,

Not sure if i have done something wrong, I replaced the 2 help files in the help directory, but now i get page can not be displayed errors when I look at the help from the thinair menu.

Bevan

ErosOlmi
08-08-2007, 02:39
Do you have XP SP2?
Did you download zip file and open directly instead of saving to disk and than opening from there.
If this is the case I think it is a XP Sp2 protection.

Go to IE and clean the cache
Download thinBasic ZIP help file from previous post and do not directly open but save to disk
Than open ZIP file and extract .chm file placing into \thinBasic\Help\ directory
Let me know if now it works.

If this is not the case, I have no idea and have to think to something else.

Eros

Bevan
08-08-2007, 02:51
Once again you have nailed it Eros, Thank you.

Another one of windoze little quirks

ErosOlmi
08-08-2007, 02:56
I had the ... "fortune" to fall into similar problems when first installed SP2 under XP.
That's why I had the impression problem was this one.

.chm files can have code embedded. For this reason SP2 understand if a .chm file has been download from internet or created by a seup install. In the first case some protection actions takes place. I have no official Microsoft documentation to reference here but this is what happen nad the above is a possible solution.

Ciao
Eros

Michael Clease
08-08-2007, 08:32
if you install a download manager like GetRight it stops that problem. ;D

ErosOlmi
08-08-2007, 10:59
mmmh, I really like the idea of download managers but in the past I had few problems with them. Some of the well know names contained spy ware components very hard to find even from good personal firewalls like ZoneAlarm Pro. They are hard to find because those kind of software needs to connect to internet so when you authorize them do connect inside your personal firewall you authorize for all connection even the one you are not aware. You need some tcp/ip utilities that check every single ip connection giving info on where they are connected and what data they are exchanging.

So, my suggestion is to check carefully this kind of software.

Regards
Eros