Exiting my app cleanly - Windows Mobile Development and Hacking General

hi guys,
I try to exit my application in the following way but it doesnt seem to work:
Code:
AfxGetApp()->ExitInstance();
So, whats the way to exit the application cleanly without memory leaks.
Mohammad

???????????????

It really depends on what you do in you application. Normally you just close the main window, but if you used memory allocation you have to clean it up first.
Since this is not managed code any memory allocated with commands like new, malloc, LocalAlloc will not be released automatically when you close your app.

thanks levenum u r very helpful and gentle... I used the following in the MainFrame wnd:
Code:
DestroyWindow();
Sorry for posting too many questions these days, but I have a big work on WM and its my first time to program for this platform..
I might ask more :wink: , I will make this forum more active :lol:
thanx
Mohammad

Related

How to stop a program in command line

Hello,
I would like to stop a program (gpsgate) in memory usind windows command line.
Do you know how to do that ?
Or do you know another solution (or program) for this ?
Thanks
I wrote an app VJTaskKiller to help on this. I imagine itsme has much better tools to do this, and also perhaps mortscript.
V
vijay555 said:
I wrote an app VJTaskKiller to help on this. I imagine itsme has much better tools to do this, and also perhaps mortscript.
V
Click to expand...
Click to collapse
Nice !! I'll try it. Thank you vijay555
Your program is excellent and i will keep it !!
BUT i have a problem with gpsgate (specific problem i think). It is a hide task. The process name is GpsGateCE.EXE and vjtaskkiller doens't work with this argument.
Do you have a solution ? I will try to find if there is a an associated task name with GpsGateCE.EXE.
Thank you
Unfortunately I haven't updated VJTaskKiller to kill hidden tasks, right now it closes windows, not processes.
I will try to update it at some point soon, but do try searching for itsme's tools, or otherwise I will try to update at some point.
V
Ok thank you again vijay555 !
To close GpsGate you can make a little progam that send e windows message:
gpsGateHWnd = FindWindow(NULL, TEXT("Franson GpsGate"));
SendMessage(gpsGateHWnd, WM_COMMAND, 0x000000C8, 0x00000000);
Bye Bye

camera problems

Hello everyone,
I want to first say that I am new to these boards and am glad I have found them.
My problem is everytime I try to use my camera it tells me I dont have enough memory and to stop all running progs.
I stop them all and the problem still presist. It seems to work after I reboot the phone but returns to that after I start using some prog.
Is there a way to fix this or should I just reboot everytime?
Any help is appriciated.
Thanks.
lazorpointer said:
Hello everyone,
I want to first say that I am new to these boards and am glad I have found them.
My problem is everytime I try to use my camera it tells me I dont have enough memory and to stop all running progs.
I stop them all and the problem still presist. It seems to work after I reboot the phone but returns to that after I start using some prog.
Is there a way to fix this or should I just reboot everytime?
Any help is appriciated.
Thanks.
Click to expand...
Click to collapse
try flashing one of the ROMS they have here.. the reason why ur getting that is because ur running low on memory (ram). and the stock Rom the phone comes with just plain doesnt do the job. or try looking for the hibernate.cab maybe that can free up memory so u wont have to reboot all the time
You can also try the PagePool to reduce the size from the Stock 12 MB to your choice of 4 or 6.
I installed the pagepool but I cant get it to run the backup.bat file.
Error "There is no application associated with "backup". Run the application first, then open this file from within the application".
Am I missing something?
lazorpointer said:
I installed the pagepool but I cant get it to run the backup.bat file.
Error "There is no application associated with "backup". Run the application first, then open this file from within the application".
Am I missing something?
Click to expand...
Click to collapse
You run it from your PC while the phone is synced with your PC. Not from the phone.
I actually tried that first but it didn't do anything but I'll give it another try.
Maybe I did something wrong.
lazorpointer said:
I actually tried that first but it didn't do anything but I'll give it another try.
Maybe I did something wrong.
Click to expand...
Click to collapse
Read my walkthrough on the Herald mobile 6 forum on how to flash.
And read this for a list of ROMs.

S2 Mini Config Applications

Hello, everyone!
Today I want to present...
History... (Not so important, though...)
Since the creation of S2U2 1.30 there were a lot of posts like "How to change 'slide to unlock' text, S2U2SettingsPlus doesn't work!"
That's why I wanted to make a good little configurator.
After a day of work, a night of sleep, a day of rest and a night of work I've realized my wish. The <SATT> was born.
Mmmm... that's a lie. <SATT> was born about three or four days ago, it was named "S2U2 Translator". <ESC> was born today, as a little project for me to rest.
What does <SATT> stand for? <ESC>?
<SATT> - S2 Advanced Translation Tool
It comes in two editions: SATT4PC and SATT4PPC.
<ESC> - Easy S2U2 Configurator
What do they do?
<SATT> is an ultimate tool for S2 Apps translators. It is designed for easy lang.ini files editing. Works not only with S2U2, but also with S2V and S2P files.
<ESC> is a tool for everyone, who wants to change 'slide to unlock' text into something else.
What are the requirements?
<SATT4PC> needs .NET Framework 2.0
<SATT4PPC> and <ESC> need .NET Compact Framework 2.0. It was designed for WM5-WM6.1, and wasn't tested on PocketPC2003. If there are any bugs on such an OS, I can't help you.
What application were your programs done with?
MS Visual Studio 2008 Team Edition
Where do I post bugs?
Here!
What is Otaku DAN?
This is me. To tell you the truth, this is the name for my future site, but it isn't complete... Maybe I'll tell you, when it will be running...
NB: My applications won't do any major harm to your PPC. The worst case will be lost lang file...
And the last one: every my app inserts comment lines into lang files. They won't do any harm, 'cause S2 Apps ignore them.
And now the really last one: Don't thank me. Thank A_C for his marvelous applications!
History of fixes:
<20-10-2008 03-30> Fixed Localized Program Files Folders in <SATT4PPC> and <ESC>...
<20-10-2008 23-20> Updated <ESC> to restart iLock2.exe automatically.
<21-10-2008 22-40> Updated <SATT4PC>, removed some unnecessary functions.
i tried your Satt4ppc. doesen't work :says i dont have installed any S2 app on internal storage. thats wrong, all S2 apps are on my internal storage?
mmm... What is the path to them?
\Program files\S2U2\
\Program files\S2V\
\Program files\S2P
?
OK, now I know what to do...
There will be an update in 30 min.
I haven't taken localized folder names into account...
Sorry...
Major Update
Now It should work with all the localized folder names.
BUT! .NET CF Framework doesn't have a Special path variable for Program Files, so I've tricked my app by cutting it from startup path.
So, it is critical to have SATT under %Program files%/OtakuDAN/SATT and ESC under %Program files%/OtakuDAN/ESC... so, use CAB installers...
It doesn't matter if these apps are installed on internal storage or storage card...
Is .NET on WM like it is on PCs, where you need to have specific versions for the required application? That is, one still needs to install .NET framework 2.0 for your application even though there is already .NET 3.5 installed?
Thanks!
Very useful your applications,thank you very much for sharing your work.
It works fine.
snovvman said:
Is .NET on WM like it is on PCs, where you need to have specific versions for the required application? That is, one still needs to install .NET framework 2.0 for your application even though there is already .NET 3.5 installed?
Thanks!
Click to expand...
Click to collapse
If you can't work with it on your device, I can easily convert it to .NET CF3.5
BTW, my device has CF3.5 too, and all the errors I've got when I debugged these apps said that they are running on CF3.5.
The ESC app doesnt work for me. I can get in and change the values, it creates a new lang.ini and saves the old one but none of the text changes. Im using a 700WX and S2U rev 1.30. Update to 1.32 help??
It is necessary to restart iLock2.exe for changes to take effect...
I'll update <ESC> today for it to restart iLock automatically. I figured out that it will be the best option.
Esc works
Thank you!
At the moment i've tried ESC only and it took me 30/40 secs to do everything, from install to changing effects.
The right things to do:
1)Install the .cab you need (Esc setup in this case)
2)Go to programs folder (for many people "Program files") and click on ESC
3)Write the words you want to appear on the s2u2 an on the s2a
4)Save,exit and click on ilock, it will stop the s2u2.
5)go to s2u2 settings and open it,save and close it and you're done.
Now you've got the new text on your jewel!
rupertone said:
Thank you!
At the moment i've tried ESC only and it took me 30/40 secs to do everything, from install to changing effects.
The right things to do:
1)Install the .cab you need (Esc setup in this case)
2)Go to programs folder (for many people "Program files") and click on ESC
3)Write the words you want to appear on the s2u2 an on the s2a
4)Save,exit and click on ilock, it will stop the s2u2.
5)go to s2u2 settings and open it,save and close it and you're done.
Now you've got the new text on your jewel!
Click to expand...
Click to collapse
Thanks for a guide, I was so tired to write something like "How to use"...
Now, some additions to your guide:
2) You can go to Start Menu/Programs/Otaku DAN/ESC as well
4) You can stop here. iLock will be restarted automatically, if you have the latest build ^___~
Everything is really easy, that's why this application is called EasyS2Config...
You're right, it's easier and quicker than my explanation!
Thank you again
I always like to have my name in my unlock text, just in case some kind soul would return it to me, it's right there as the first thing they'll see.
Worked well and very easy, thanks!
Looks pretty cool...I will check this out later, good work!!
s2 Mini Config Application don't work
Hello excuse me but my english is verry light.
i've just installed Satt4ppc and wen i want to use it, i've the message:
critical error;
You haven' installed any s2 Application onto internal storage. this configurator works only with intelnal storage.
Bur S2U2 is installed on my device.
I don't understend???
Thanks to help me
There was an exactly same problem some posts ago (be sure to read first page of this topic).
1) S2U2 or another S2 app should be located on the internal storage in a default location:
%program files%/S2U2 or %program files%/S2V, etc.
2) SATT should be installed in that %program files% folder to be under %program files%/SATT
This is due to localized %program files% folder which name can't be received by any means (Is it a Microsoft bug?)...
Why is it so difficult? Well, I've made these apps just for myself and didn't have any intention to release them to the public, but my friend told me to do so. Now I've lost my source files, so if I want to do something with SATT or ESC, I should rewrite it all...
Completely rewritten SATT?
Well, I haven't posted here for ages.
I haven't translated S2U2 since this March, so there was no work on SATT.
Now SATT is renamed to S2TT ("Slide 2" Translation Tool) and has v.2 flag.
Application is completely rewritten, it shows untranslated strings, and it requires .NET Framework v2.0
S2TTĀ²: View attachment S2TT.zip (v2.0.1.2)
If anyone wants to translate this app (just to mention), you can use this English file: View attachment English.zip . this is .cs file (Language class for S2TT).
If there are any errors, you can post them here.
All other applications are DISCONTINUED.
thanks! thanks! thanks!
Great Work!
Thanks!
here there is Italiano.cs for you!
I hope that it's correct!
Sorry for my bad english
thanks for translation
thx, millo1978!
I've recompiled S2TT, now it has 3 languages (english[default], russian[mine], italian[yours]).
I've also corrected a minor programming bug in my source code, it won't be visible in the application. I hope your Italian translation is correct, 'cause I don't know Italian. Nevertheless, thx for your work.
S2TT v2.0.1.3: View attachment 211670

Installing Cab question

Hi
I apologise for my lack of knowledge as I am very new to WM. Always been a Nokia man.
I have attempted to install a couple of cabs. When prompted on whether to save or open I have done both and directed it towards my storage card. When I do this the application doesn't appear to work. If I direct it to phone memory it works.
I want to keep the phone memory as free as possible. Am I doing something wrong, or should I not worry about my phones free memory?
Any help will be appreciatted
i just double click on my cabs using total commander then it
ask me if i want to install them and if i say yes it ask me where
as in main mem or sdcard and then i say where
and it install and show up in programs in the startmenu
I see. So what you are saying is that it shouldn't matter where I install the cab it should work and show up in programs.
I must be doing something wrong, is there a good user guide to installing cabs?

Self deleting executable

Hello all,
I am trying to write an application in Visual Basic.NET 2008 for the Windows Mobile 5.0 platform. One of the features of the application is that it needs to have a "panic" button. The idea is that a user can run the application and press the panic button. The application should then terminate immediately and remove itself (the physical executable). A sort of self destructing program
The problem is that an executable cannot be deleted if it is running because the file is locked. It can only be deleted after the program has terminated, but after the program has terminated it is not possible to fire a delete command anymore.
I have done some investigation on the web and I found this article: http://www.catch22.net/tuts/selfdel
The article explains the problem and it also provides a few solutions. Unfortunately I am not familiar with writing C++ or assembler (too stupid ) ) so I have not been able to use "the ultimate self deleting executable code".
Is there anybody here that can help me a bit to get this working ? Any help is appreciated
There are two ways:
1. Use something else to delete you app.
2. Figure out the ASM root.
By your own admission, 2 isn't viable, so that leaves us with 1.
I can think of 2 ways to do it, a seperate App to delete yours, all the other app does is way 2 seconds and run, and keep running and retrying until the File is Deleted. Your app then calls it and quits.
The other way is to do the above process but use MortScript to delete and wait instead of an app. There's loads of Mort examples on xda.
Dave

Categories

Resources