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.


send information to running application


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2008, 11:15 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 205
Awards Showcase
Beta Tester 
Total Awards: 1
Default send information to running application

I'm trying to make an application which does something based on an argument provided in a .lnk flie.

My problem is that the application is slow to load, probably because it has to read the "actions.ini" every time it starts.

Is there a way to talk to an already running program using .lnk files?

I saw this thread, but it is not really what I want, If there is no other solution I can try that one though...

Thanks
Reply With Quote
  #2 (permalink)  
Old 08-05-2008, 11:26 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by Mr_Gee View Post
I'm trying to make an application which does something based on an argument provided in a .lnk flie.

My problem is that the application is slow to load, probably because it has to read the "actions.ini" every time it starts.

Is there a way to talk to an already running program using .lnk files?

Thanks
How big is your "actions.ini"?

See my beta demo ini editor...
it loads a small (10 lines or so" ini file with the most important things....

You could create a smal ini.file containing the file names of the lnk, and have the app "read" them during executions, has needed...
This would problebly cause some files to be read several times, but should not cause a too big lagg time...
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 08-05-2008, 11:31 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 205
Awards Showcase
Beta Tester 
Total Awards: 1
Default

At the moment there are only 4 items in the list, but in theory it could be 400
Reply With Quote
  #4 (permalink)  
Old 08-05-2008, 11:39 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

If you want to have an idea of how long it would take to load a BIG ini file, create a dumy ini file ( any textfile will do) and name it something.ini and load it with my app...
In my app the load time is NOT optimum, as I gave a small (50ms) time gap beetween each line read to create the "Load-write" effect..
Still it will be only a few seconds to load such a BIG ini file...
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #5 (permalink)  
Old 08-05-2008, 12:48 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I like to read the whole file into an array list and then search for the item that is needed, like so.....
Code:
If FileExist( "Config.ini" ) Then
 AlConfig.Clear	' Clear the current configuration

 FileOpen( ConfigFile , "Config.ini" , cRead,, cASCII )	' Open config file and read into the current configuration
 Data = FileRead( ConfigFile )
 Do Until Data = EOF
  AlConfig.Add( Data )
  Data = FileRead( ConfigFile )
 Loop
 FileClose( ConfigFile )

 Index = AlConfig.IndexOf( "CONFIG" )	' Find start of the config settings
 AlConfig.Item( Index + 1 ) = "AutoSchedule=Enabled" ' Update Autoschedule setting

Else

 CreateConfig	' If config file is missing create a new file before updating

End If
I find that doing it this way is fast, it also releases the file for other uses and it is easy to find the item you require using IndexOf on the array list which in this example is called AlConfig.
Hope this helps.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #6 (permalink)  
Old 08-05-2008, 01:11 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 205
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I should've mentioned this in the topic start,
but at the moment I'm reading the actions into a table
using the loadCSV, could this cause the lag?
Reply With Quote
  #7 (permalink)  
Old 08-05-2008, 01:21 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by Mr_Gee View Post
I should've mentioned this in the topic start,
but at the moment I'm reading the actions into a table
using the loadCSV, could this cause the lag?
You can only be sure by trying other methods...
Ramdom's emthod seems simple enought to Append to your project..either as is or as a sub...
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #8 (permalink)  
Old 08-05-2008, 02:33 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 205
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks, I'm going to try RadomCoder' solution, hopefully it works
Reply With Quote
  #9 (permalink)  
Old 08-06-2008, 12:10 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I hope it works for you but please feed back your experience, good or bad, as it will help others that may have similar applications.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
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
application already running micro Questions & Help Needed 3 09-04-2008 10:20 AM
Modules - more information Erel Beta Versions 4 09-02-2008 06:42 AM
Send data to serial port for other application schimanski Questions & Help Needed 6 04-08-2008 06:45 PM
QuickSMS - Define your own custom speed send messages and send them quickly! Oran Share Your Creations 2 02-17-2008 07:30 AM
Background running application eddy_ys Questions & Help Needed 5 09-27-2007 09:29 AM


All times are GMT. The time now is 01:02 PM.


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