Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Problem with Serial. ("before loop" error)


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-14-2008, 07:21 PM
Junior Member
 
Join Date: Jul 2007
Posts: 32
Question Problem with Serial. ("before loop" error)

Hi everyone,

I've developed a small program based on GPS4PPC, (it just shows more info from NMEA sentences), which works fine, both on Desktop and Device.

I've upgrade prior working version of basic4ppc, from 5.8 to 6.05, and now I get some strange problems with SerialDevice.

First, I re-compiled my source (replace SerialDevice and DBcomm with Serial2.dll) and get an exe. Put needed libraries on Storage Card, on Device, and despite of Serial2.dll is in the same directory than the .exe file, when I try to run the exe I got a msgBox with

" Error loading program.
\Storage Card\B\Serial2.dll "

but Serial2.dll is in that directory (?). I've copied it two or three times on the card, just in case it was corrupted, but the error keeps appearing.

I've copied and old compiled version of the program, (with 5.8), which uses SerialDevice.dll and DBcom.dll, (put also the dlls on device) and when I click on it, I got the following messages boxes:

Serial Device. <-title of the box
"before loop"

click ok, and I got:

serial device
1
0
(ok)

serial device

7007

(ok)
serial device

2

(ok)

and then the program stops.

Does anybody has any idea of whats happening? Why does it work before and not now?
Is it better to downgrade to 5.8?

Thank you,


Jes.
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 12:28 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Jes,
Just to rule out all odds, is .NET Compact Framework 2.0 installed on your device? The Ver 6.05 (optimized) compiler targets 2.0 as does serial2.dll.
Cheers
Robert
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 04:10 PM
Junior Member
 
Join Date: Jul 2007
Posts: 32
Question keep trying

Hi alfcen,

Yes, .Net CF 2.0 is installed. It's a Qtek S200, and it has also a newer version than the one (V2.0.50727) I tried to install.

I have partially solved the problem; If I copied the old .exe to the Device, it works but I canīt re-compile and create a new working .exe. I'm quite disconcerted about this...

Thank you for your time.
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 05:41 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,466
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Re your Serial2.dll loading probllem, I think you may have a Framework version problem. I believe that your device will have .NET 1.0 in ROM and that .NET 2.0 has been installed as well.

Dbasic.exe, v5.8 compiled exes and v6.05 legacy compiled exes are all .NET 1.0 apps and will preferentially run under 1.0 even if 2.0 is available. If .NET 1.0 is not available then they will automatically run under 2.0 without problem.

If an app wants to run with a .NET 2.0 library AND both Framework versions are present then an appname.exe.config file is required to be in the same folder as the compiled app to force .NET 2.0 operation. Dbasic produces this automatically. I suspect your problem is that you have legacy compiled your app under v6.05 and have not copied this config file to the device.

If an app wants to run with a .NET 2.0 library and only Framework version 1.0 is present then the app will not run.

If an app wants to run with a .NET 2.0 library and only Framework version 2.0 is present then the app will run fine without a config file.

Optimised compiled v6.05 exes are .NET 2.0 exes and will only run under .NET 2.0. They do not need a config file. If you optimise compile under v6.05 then I would expect your app to work fine.

This also applies to desktop exes. Dbasic installation comes with a dbasic.exe.config file so that Dbasic.exe runs under .NET 2.0 if it is present even if .NET 1.0 or 1.1 is present on the desktop.

A little more information here http://www.basic4ppc.com/netcf2.html

Last edited by agraham : 02-15-2008 at 05:44 PM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Error loading program" on 29th Feb 08 WZSun Bug Reports 2 03-01-2008 05:43 AM
Is there a "FOR/NEXT" loop problem ? dan kabestan Questions & Help Needed 2 12-15-2007 10:52 PM
calling the device's "Programs" or "settings" screens HarleyM Questions & Help Needed 0 12-05-2007 02:59 AM
Error message: "Not correct version of dll" BjornF Questions & Help Needed 5 09-17-2007 03:16 PM
SetUpBuilder Problem - "Build Cabs first" dhillinmkewi Questions & Help Needed 1 07-27-2007 08:20 AM


All times are GMT. The time now is 07:41 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0