Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Threading library for optimising compiler


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 02-11-2008, 06:55 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,321
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I think I will go with a separate executable handling the datafile and cheking the dates....
As I understand, and please confirm this, if I use something like my about panel as a pop-up, the code will NOT be halted...as it hapens qith a message box....Correct?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #12 (permalink)  
Old 02-11-2008, 07:07 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
I think I will go with a separate executable handling the datafile and cheking the dates....
In that case you might want to use the Process object in the threading library, rather than B4PPC "Shell", as Process can tell you when the separate app terminates and you could then pick up the results from a file.

Quote:
As I understand, and please confirm this, if I use something like my about panel as a pop-up, the code will NOT be halted...as it hapens qith a message box....Correct?
Your about panel seems to NOT halt the main code of a B4PPC app.
Reply With Quote
  #13 (permalink)  
Old 02-11-2008, 07:15 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,321
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Thanks Agraham...
All good news, but I do not need to do a process separation, because the checking is simple...then I just take the data and have it pop-up...
It will be a "silent" app, as it will be minimized and only show in the taskbar...
Thanks for all your input...
If you'd like i can post the code as far as I have it, but it is in portuguese language, but fairly simple to understand..
I plan to have the "Main" app ready tonight...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #14 (permalink)  
Old 02-11-2008, 07:20 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
It will be a "silent" app, as it will be minimized and only show in the taskbar
I assum that it will use the same data file as the main app. You will need to check what happens if this silent app tries to open the file at the same time as the main app (and vice versa) trap any errors and account for that in the code of both apps.
Reply With Quote
  #15 (permalink)  
Old 02-11-2008, 07:25 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,321
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I think I have it covered, as I use the Loadcsv method of the table control, so the file lock should be kept to a minimum, and since the silent app will be running at a known time, the user will know when NOT to husle the Main app...
Still I will post my app so that, if you be so kind, take a look and share with me your thoughts....
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #16 (permalink)  
Old 02-12-2008, 09:35 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Cableguy View Post
the user will know when NOT to husle the Main app...
Sorry - bad practice - NEVER rely on a user to do the right thing
Reply With Quote
  #17 (permalink)  
Old 02-28-2008, 06:08 AM
Knows the basics
 
Join Date: Jan 2008
Posts: 53
Default

Hi, agraham! It seems that your library is not work with HTTP library...
On the device, attached code raises an error
Attached Files
File Type: sbp 11.sbp (892 Bytes, 6 views)
Reply With Quote
  #18 (permalink)  
Old 02-28-2008, 10:28 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Elrick View Post
Hi, agraham! It seems that your library is not work with HTTP library...
On the device, attached code raises an error
Please read the help, Thread pitfalls -> GUI operations, and look at the sample app. You cannot access GUI controls from a thread without causing an error. This is why I provided thread events. See this mod to your original code which now works.
Attached Files
File Type: sbp 11.sbp (985 Bytes, 8 views)
Reply With Quote
  #19 (permalink)  
Old 02-29-2008, 04:27 PM
Knows the basics
 
Join Date: Jan 2008
Posts: 53
Default

Thanks for you reply, agraham, but in my Glofiish M700 your code still causing an error

UPDATE: Hmm... This error calls "NotSupportedException" :-) and if i ignore this error (choose to continue), the html code appears in TextBox...

Last edited by Elrick : 02-29-2008 at 04:45 PM.
Reply With Quote
  #20 (permalink)  
Old 02-29-2008, 05:32 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I assume you mean that an error occurs when you run the modified 11.sbp code I posted. Next time please be more exact in describing exactly what you see happens rather than just saying an error occurred.

There is no error trapping in the thread in that code. In production code a thread subroutine should always have an errorlabel statement to trap errors otherwise B4PPC error handling will try to put up a message box from the thread which will itself cause an error as it is running on the threads' thread, not the GUI thread. Please try the attached code which should run without error in all situations - at least it does on my device.
Attached Files
File Type: sbp 11.sbp (1.1 KB, 11 views)

Last edited by agraham : 02-29-2008 at 05:43 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
Threading Mr_Gee Basic4ppc Wishlist 0 09-23-2008 08:57 PM
formEXdesktop.dll and threading.dll Byak@ Questions & Help Needed 5 08-13-2008 04:05 PM
Parallel Processing / Multi-Threading questions TWELVE Questions & Help Needed 7 04-29-2008 12:40 PM
Error on compile with Optimising TonyGprs Questions & Help Needed 4 01-27-2008 12:15 PM
The Hekkus Library doesn't work when used with the Optimized Compiler Louis Questions & Help Needed 5 12-28-2007 09:06 PM


All times are GMT. The time now is 08:40 AM.


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