Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

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

Threading library version 2

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 04-13-2010, 08:49 PM
Senior Member
 
Join Date: Apr 2008
Location: Duesseldorf, Germany
Posts: 154
Default

Quote:
I am afraid that is how .NET (and Java and to an extent C++) is designed to work. They throw execeptions instead of returning error codes. The intention is to better separate error handling code from normal path of execution code.
I agree...

Andrew, can you still answer to the 2 questions above...?

regards,

TWELVE
Reply With Quote
  #12 (permalink)  
Old 04-14-2010, 08:04 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

1) If by existing you mean running then ThreadName.Running tells you.

2) By the name of the Thread object as with any other library object.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #13 (permalink)  
Old 04-18-2010, 05:05 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Owing to internal changes in Basic4ppc v6.90 to support typed variables and Sub returns the Threading library needs changing to suit.

Version 3.0 is posted for Basic4ppc v6.90 and later. I have left version 2.0 available for use with Basic4ppc v6.80 and earlier.

In version 3.0 the B4PObject(1) parameter is no longer needed in Thread.New.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #14 (permalink)  
Old 04-20-2010, 08:17 PM
Senior Member
 
Join Date: Apr 2008
Location: Duesseldorf, Germany
Posts: 154
Default

Hi Andrew,

sorry for the stupid questions.I had paused my main B4P project for one year and a half, meanwhile working and playing with a variety of programming languages, so it is really hard to get into my own code line after that period of time.After some reading and reviewing it is getting better and i recall a lot of things i already knew but apparently shifted into other regions of my brain..*lol*

Sorry again for asking fundamental questions..certainly i will ask you questions again ( at least for the threading) but before i will continue to read and try to get familiar with my code....;-)



regards,

TWELVE
Reply With Quote
  #15 (permalink)  
Old 04-20-2010, 08:27 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by TWELVE View Post
sorry for the stupid questions.
No question is stupid if you don't know the answer (although some can be more nearly stupid than others ). Just keep on asking.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #16 (permalink)  
Old 11-19-2010, 09:40 AM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I've just started using the threading library merely because I thought it might provide a better alternative to Shell() (as mentioned in the forum).

I want to analyse the output of a DOS command (I do not have a need to run on any PPC for this purpose) and hoped to use stdout redirection. But I could not make this work by adding the redirection to the "argument" parameter of Process.Start(); maybe because redirection is a feature of Cmd.exe which is not involved in this process.

Unfortunately actually using Cmd.exe in the Process.Start(), while it works as intended, briefly pops up the cmd window. Since I am doing this every few seconds in the background the disruption to other windows due to cmd.exe appearing for a fraction of a second in the foreground is intolerable.

Anyone know of a way round this? Cmd.exe doesn't have a "start minimised" option!

Alternatively, what I'm trying to do is monitor network access to find what process suddenly downloads 50-80Mb soon after I start my PC but stops if I break the connection briefly. So I am using netstat to monitor traffic and capturing its output. netstat doesn't have an "output to file" option which would obviate the redirection problem. But I cannot find a Basic4PPC library that offers netstat data monitoring functionality. (I thought that network.dll might, but it is focused on client/server operation.)

Mike.
Reply With Quote
  #17 (permalink)  
Old 11-19-2010, 09:50 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Have you looked at Wireshark?
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #18 (permalink)  
Old 11-19-2010, 02:00 PM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
Have you looked at Wireshark?
Thanks Andrew, I hadn't heard of it. (And I asked some ex-work colleagues about the spurious traffic too.) It has help on "Network Troubleshooting" which I hope will lead me in the right direction, though it also says "Wireshark is not aimed (and may not be well suited either) for all the tasks mentioned".

Separately, I take it that there is no simple answer to running commands and capturing their stdout results...

Mike.
Reply With Quote
  #19 (permalink)  
Old 11-19-2010, 02:18 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by mjcoon View Post
I take it that there is no simple answer to running commands and capturing their stdout results...
The method that Process uses to start applications allows the default program to be invoked on say an html or jpg file. This method does not allow redirection.

There is an alternative way of starting an application that does allow redirection but this will only work directly on exe files. Process could be extended to do this but I have no plans to implement it as I don't think the work involved would be worth the return as I don't imagine this is anything but a niche requirement. I certainly haven't needed it. The only time I have needed to do do this in my Logcat viewer for Android that I have just written but that is a .NET C# application.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 11-21-2010 at 04:28 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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Threading library for optimising compiler agraham Additional Libraries 46 08-31-2009 04:38 PM
Threading Mr_Gee Basic4ppc Wishlist 0 09-23-2008 07:57 PM
formEXdesktop.dll and threading.dll Byak@ Questions (Windows Mobile) 5 08-13-2008 03:05 PM
Version 6.01 Problem with SIP Features of Hardware Library Woinowski Bug Reports 4 01-08-2008 12:59 PM
New serial library - beta version Erel Announcements 13 08-02-2007 12:24 PM


All times are GMT. The time now is 06:54 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0