Getting Activesync Status - Windows Mobile Development and Hacking General

Hi XDA developers..
I'm doing some programming and running into a problem...
I'm programming for WM6 for SmartPhone, preferably using .net, either VB.net or C#...
I'm looking for some code that can tell me the real status of activesync...
When I run Activesync, and tries to connect (Using bluetooth) my progam needs to respond to the status... If the connection succeds (Meaning that it could connect to to a Activesync Session on a pc), if synchronization is running, if syncronization is finished or if connection failed (There was no activesync connection available, no PC to connect to)...
So in general: I want the specific status of ActiveSync.
So far the only thing I've come by is the ActiveSyncStatus in the SmartPhone SDK
Microsoft.WindowsMobile.Status.SystemState.ActiveSyncStatus
I've tried setting up a Handler, and it works...
The problem is this crappy SDK doesn't give much response back..
It never returns the Error code (2), as is written on MSDN.
It can only tell give back to responses "None" and "Synchronizing"...
If I try to make a connection and no pc is near, the handler is never triggered. If connection is ok it will change back and forth between "None" and "Synchronizing"... Which is terrible... I could come to the conclusing that upon succesfull connection and sync it would go Synchronizing->None->Synchronizing->None->Synchronizing->None.. I could probably count the time this takes, and check whether it gone through this sequences in a matter of this time, but this is a very unreliable and ugly way to solve this problem.
So I'm hoping someone has any other suggestion, or can lead me to where to look... The current SDK really sucks...
I guess it would be possible to use some native c++ code? But I'm not really into c++, but if you have some code in c++ you are very welcome to post that also...
Any help appriciated!
CyBeRDuDeDK

Hi CyBeRDuDeDK,
Any luck with your earlier question?.
I was trying to do very similar (c# to pass WM_COMMAND to activesync) and trying to research on this topic for few days now, as i want to send the commands only if activesync is not already connected, but there is no way to find out that.
The ActiveSyncStatus is for application level, that is why it shows only 3 values, not at connection level !.

Did someone solve the problem.
I have to recognize if Active Sync connects to a Computer.
Im using a WinCE.NET device and Native C-API. But it should be the same on Windows Mobile.
Thanks in Advance,
ccube
Edit: I finally got it!
Every Window gets the Message 0x3FE (1022) if an Active Sync event occures.
wParam: 1 means connected
wParam: 0 means disconnected
I didnt find any documentation about this, so I'll give no guaranty, that it is working.
I got it working on a Windows.CE 4.x device.
On my Windows Mobile 6.1 Raphael, the Event doesn't occur.
Perhaps I can investigate, hot to get it running on WM6.1 if someone needs it!
greetings,
ccube

Related

USB PROBLEM. ACTIVESYNC keeps Connecting but no sync ! :-(

Hi,
If anyone can spare some time to look at my problem.
Basically : I have received my new O2 XDA EXEC and have tried a few times to synchronise it using
- the included 4.0 Activesync
- the download 4.1 Activesync
Problem is : when I plug the USB to the device, it is recognise and Activesync start spinning and displays "Connecting..." but would just keep connecting without moving further (as screenshot below).
I looked for issues like this on various website and here, but nothing really looks like what I am experiencing, anyone has an idea where to go from now ?
I checked
- firewall (activesync is in the list of exception)
- uninstalled activesync, reboot pc, reinstall, reboot pc.. still no luck
- install activesync on a second PC and do the same: no luck
- used a different mini USB cable, no luck so it's not the cable.
Do you think I should send my XDA back ? everything else seems to work (GPRS, Wifi, BT..)
Thanks a lot for your suggestion ?
PS: the device is recognised as I can ping it too from the PC.[/b]
Well you seem to have hit all the usual suspects. Regarding the firewall issue, in ZoneAlarm I also watched the logs, found a blocked connection attempt that seemed to be my device and set that to the trusted/allowed zone which helped back when I was having problems. The next step might be a hard reset on the Exec.
Try disabling your firewall and test the connection.
For some firewalls you have to do more than just allow ActiveSync.
Try diabling the password. That cofused my activesync the first time I tried my replacement handset
Disable firewall completely, than retest if activesync will work. Helps in 99%.
HTH
Chris
I'm currently having "issues" with ActiveSync too. Every time I try to sync when there are more than about 25 changes that need updating, my JasJar decides to open an ActiveSync window on the JJ (for no apparent reason).
It only manages to show the top half of the ActiveSync window (The "Connected" section with the progress bar are missing) then it freezes, requiring me to do a soft reset.
The only way I can currently sync all details successfully is to kill all non-essential processes with a process manager, and remove all today plugins (!), then it works with absolutely no problems. Not a very elegant solution, but it works for now, and as I've tried absolutely everything else I can think of in THIS thread, it'll have to do for now...
it works fine now ! I have disabled the firewall and also ..
uninstall Cisco VPN client, so not sure which one it was that caused the connexion problem.
Thx to all your fast responses.
I have mine Sync successfully after removing the anti-virus software. Not sure whether it works or not to install the anti-virus back on. I have followed all the instruction in Microsoft website, but with Trend Micro installed, it just couldn't Sync. That's why I removed it completely.
Maybe this will help You (or me ) further :
I can sync at home without problems, W-XP ASync 4.1, Internet through a Linksys Firewall/Router.
If I come to the office I get exactly what You have, visible, but no syncing.
I use W-XP there as well, same ASync 4.1, Internet through the Office Network.
When I disconnect the network cable, Microsoft Office will immediately notice and complain. I wait between 30-60 second and ASync will actually connect and sync. It will not sync to a Exchange Server though, as this is disconnected with the cable.
I would have come with this issue here, but probably a little later, as other problems are of higher priority to me now, but maybe this information helps here.
regards,
Ruud
Perhaps this hint may help you under certain conditions: http://forum.xda-developers.com/viewtopic.php?t=39002
regards
df2jh
Hi df2jh,
thanks, interesting read. I was able to solve my issue in the meantime.
My firewall, MS is restricting the programs used by MS ASync and therefore does not allow syncing.
Solution for me :
Disabled processes wcescomm.exe and rapimgr.exe in the Windows Task Manager
Wrote a text-file in the directory where ASync is in !! which will be searched for by the firewall (do not recall the name of this file, but can check it out if somebody needs it.) This file has one entry to disable the firewall in concern of rapimgr.exe.
Then run rapimgr and wcescomm by hand and, WOW, WCESMgr.exe will run itself and syncing it working flawlessly.
What I did not understand until then :
1) this special file should be in the ASync directory, not in the firewall directory
2) this special file is only searched for when ASync is run (PC boot), not when the USB is connected
For me this is solved, though not everything else in my sync problems.
Hope this helps others,
Ruud
Might not be the same issue but you may find my post in this topic of use
http://forum.xda-developers.com/viewtopic.php?p=225939#225939
Might not be the same issue but you may find my post in this topic of use
http://forum.xda-developers.com/viewtopic.php?p=225939#225939
Had same problem on Kaiser and Wizard
I fixed it by going into Settings>Connections>USB to PC (in WM6.1, USB to PC is in system). Uncheck Enable Advanced Network Functionality. Fixed my active sync not connecting problems on both phones.
Hope that helps some of you!
escapemcp

End of my tether with Activesync 4.1

Is there a credible alternative to Activesnc 4.1 anywhere ? I am absolutely sick and tired of this cr*p.
I want to be able to sync calendar, tasks, notes and files - reliably. That's all. That's not too much to ask is it?
Any ideas ?
TIA, DBo.
I'd be interested in one, been looking for a day or two but pretty new to the PPC thing and not making much progress.
Atm the only surefire way to ActiveSync seems to be, soft reset before sync, again after. It's quite a 1 shot deal, once it's synced, it won't again without a soft reset of the PDA. Note: Never needed to restart the PC used, I have tried this, no difference.
Have you read this?
http://forum.xda-developers.com/viewtopic.php?t=41955&highlight=activesync+solution
Solved that problem for me.
reading the other post now ... my activesync kills itself too i need to reboot my pc to make it work again ... apart from that it wont even synch all my contact ... it misses out random ones all the time
Can't tweak my TCP settings
I'd love to do this, but I can't go messing about with the TCP settings on my company laptop. Not if I want to keep my job.
I need a decent alternative to AS 4.1 even if that means AS 4.2
Silentz:
Yeah, tried that (amongst several hundred other things). I already use DrTCP for optimising my lans due to me using gigE with jumbo packets, so am pretty familiar with it on that ground. I also tried many other reg tweaks (on the PC not PPC) regarding networking etc. to no avail.
From all the tests and tweaks I've done I'm no further into solving this issue, which doesn't half stick in my side. PC m$ os with m$ software talking to a PPC with m$ os with m$ software, who the hell is writing this utter drivvle software?
I have concluded however that the PC / ActiveSync 4.1 side of things does not fail or lockup, regardless of reboots or no reboots or net settings used. It is the PPC's running ActiveSync which borks, stalls then grinds to a halt. I suppose it's possible m$ will fix the PC 4.1 software to not bust the PPC but I've also pretty much resided myself to needing a ROM update to fix the PPC half
This of all things annoys me, I've fixed almost everything else wrong with this phone but turning it off on a regular basis just takes the biscuit, like who does that nowadays? :roll:
Yeah that's right - it's the PPC which goes funky, but in my case it was down to the PC (i think) cramming data at it.
If you switch off (untick) all elements of the today screen it also works better, although that's not really a solution!
Microsoft do need to release ActiveSync 4.2 asap.
Yeah, tried all that, I only have MSN on today page anyways but have tried it with nothing. I only sync contacts anyway and even then only about 100 - still hangs if not the first time...
What about this?
Device Manager
Hi,
I was successful in resolving a "stubborn" active Sync, by doing the following:
Remove USB Cable to K-jam.
Open device manager.
Go to Network adapters.
Disabling adapter called: "Windows Mobile Based Device".
Re-enabling adapter called: "Windows Mobile Based Device".
Plugging USB cable back in.
Kind regards
Adrian
I was successful in resolving a "stubborn" active Sync, by doing the following
Click to expand...
Click to collapse
But for how long?
I find that AS is very unstable.
I have installed the latest ROM and still get problems with both my devices.
If I play an MP3 in Windows Media Player, AS drops the connection and I have to unplug my MDA Vario (or my XDA Mini S) and reconnect it again.
If I soft reset for any reason while still connected to AS, it drops the connection and on re-connect it hangs at 'Looking for changes' and I have to re boot the PC to get a connection again.
Other times without warning it will drop the connection and not re-connect without a re-boot of the PC
etc. etc etc.
Fortunately all my contacts, calendar and tasks are held on my PC in Thunderbird (I don't use Outlook) and I have a seperate sync programme for syncing them so I don't need to rely on AS for data sync.
But I do wish there was an alternative for enabling the connection to the PC.

Activesync only sees me as guest

Activesync has been driving me nuts for the past 3 days.
I have been happily syncing my s100 with my desktop for several months, when all of a sudden it is only as Guest. What's most annoying, the help section of AS tells me that as soon as I plug in my device, the Connection Wizard will pop up. Merlin must be on holiday, because nothing turns up on my screen...
I have tried the following:
1. Uninstall - reinstall Activesync (acts the same way)
2. Restore a backup of the device (but Activesync will tell me it cannot complete the operation)
3. The "Get Connected" menu item - usb available, but no device found (then how can it see a "guest"?)
4. Looked helplessly or advice on MS's help topics, with a monumental headache as my only result.
I figure I must have toyed around with the connection settings on the S100 (although my growing suspicion is my brother has, as he intends to get a ppc as well and has been playing with mine to convince himself). I'm hoping the knowledge of the senior members here can help me out - I'd hate to do a hard reset and loose all my sms (about 700 inbox only).
Thanks for any help anybody can give!
C'mon... Nodody has an idea?
Anybody?
Please?
what version of active sync
http://support.microsoft.com/kb/259954
Also copied from another forum
If yes, suggest you try registering the MSXML.DLL and MSXML3.DLL. To
register these dlls, do the following:
On your computer, click Start, Run and type:
regsvr32 msxml.dll
You should receive a message stating that the registratoin succeeded.
Repeat the step and register the other dll as well. Type -
regsvr32 msxml3.dll
Restart the computer and attempt to synchronize.
Click to expand...
Click to collapse
Did you delete all existing partnerships from Activesync ?
Sorry, forgot to mention the version: 3.8 (as suggested by microsoft)
Deleting parterships was the first thing I did, even before uninstalling/reinstalling it. Could the problem be the Jam?

Sync Problems with wizard and MS Active Sync 4.1

Hey guys,
Ok this sync is really bugging me, first it took me ages to work out why when i plugged it in the connection went green ina ctive sync and said connecting but wasnt working no matter how long i gave it - turns out it was a firewal problem,
but now when i plug in my wizard and the wizard says connecting under active sync but my computer active sync doesnt do anything, i tried switching usbs restarting both PC and Wizard to no avail, i know my PC is seeing somthing there because it says at first (when i plug into new USB port) found device etc etc, but then it installs it as a network connection and trys to aquire an IP/Network address from it!! that doesnt seem right to me!
Any advice would be great
Thanks
Nathan
hmm has anyone with a working active sync noticed if its installed as a network device for you? does the wizard work as a USB - GPRS modem? because that would explain that bit.
Thanks
Hmmm...
I'm gonna guess that no one is responding because you've basically said some things that lead everyone to believe you've not researched your device or problem before starting a new thread about issues that have been covered time and again.
First, by default Windows Mobile 5 (WM5) connects using the Network Connection method. If you want to use the old USB Serial connection your will need to upgrade to an AKU 2.2 or AKU 2.3 Rom.
Second, if you use the search function (see the top center of the screen) you will find numerous threads discussing several issues with ActiveSync.
Newbies are always welcome but you need to at least try to find your answers before just plopping donw a new thread.
Hi,
I did a search, and tried most of the suggestions, but i dont get this AKU2 thing? and couldnt find a deifnition.
but anyway im since broken the phone so thanks anyway guys
Check your vpn option and firewall option. If you using cisco vpn then uncheck "statefull firewall (always on)".

ActiveSync/PCtoUSB Problems

Hey guys,
i've got a very big problem.
I dont know why but every time i connect my Blackstone to the Computer it always open the "Internet Sharing" thing. Ive changed it over "Settings" back to Sync (and in settings/connections/USB to PC, check "Ask me first about USB connection type when I connect the device to the PC" also), but no change.
Then i canged in the registry the following key "HKLM\Software\HTC\USBToPCPopUP\" DWORD: OnlyTwoChoice=1
now the HTC Popup with the option "Sync" and "HDD" show up, but when i choose Sync it doesent connect and sync.
I want my three Options back and want the option that i can choose out of "Sync" "HDD" and "Internet Sharing"
Thank you
greetz
I started getting this problem when I used the Internet Sharing option for the first time. From then on it would automatically try IS instead of Activesysnc, no matter what I did.
I solved it by unticking the Enable faster data syncronization box in USB to PC tab, but this results in a clunky pile of tabs that come up when connecting to the PC.
Unticking the "Enable faster data syncronization" box in USB to PC tab, doesent solve the problem
Hello
I got the same problem where I did not get the "3 choices" screen while connecting to usb, and IS by default...
I just deleted all keys in the registry under //HKLM\Software\HTC\USBToPCPopUP\
and it went back to normal....
Hope it will the same for you..
I have the same problem since a while, but haven't found a solution yet... starting to get a little desperate...
dapezzz said:
Hello
I just deleted all keys in the registry under //HKLM\Software\HTC\USBToPCPopUP\
Click to expand...
Click to collapse
I guess you mean the registry on the device itself?
I been looking for that, but it looks i don't have this //HKLM\Software\HTC\USBToPCPopUP\...
in fact, i'm facing the exact same problem as described in this htcforum.com post:
"http://www.htcforums.com/post5958.html#p5958" (yes, i posted there too )
i'm pretty sure the problem is NOT pc-related, the data-connection fails at every possible system i tested it with (ranging from xp to vista to ubuntu to osX), at least the usb-diskmode worked before on all these systems before... not anymore...
the answer of HTC support wasn't of much help either:
Dear valued HTC customer, Thank you for contacting our Customer Support Center. We are dedicated to providing you with the best quality service and answering all of your questions and concerns. You recently wrote us about an issue that you have encountered with your device. To clarify your issue, you stated that you were unable to connect your device to the PC. . For this you will need a full version of Microsoft Outlook 2003 or newer and Microsoft Activesync for Windows XP or Windows Mobile Device Centre for Vista. Once these are installed simply connect your device to your PC and it will transfer your details to your PC. I hope this is of help to you. If you need any further help we recommend calling for a direct guidance on these steps for synchronising. If the above steps do not resolve your issue, we invite you to visit the support area on our Web site.
Click to expand...
Click to collapse
i suspect them of not even reading about my problem, and just firing some default answer back... not really helpfull.
so i keep looking around for possible solutions for now.
I'm seriously thinking to make use of the warranty, but hate to lose the device for a long periode... anybody has experience with that?
another PCtoUSB problem, i get all 3 options, HDD and Internet Work perfectly, ActiveSync however doesn't. Vista recognizes it as a USB Pocket PC, but Vista Sync Center and WMDC do not, nothing. On HTC i get the charging icon, but not the Sync icon. Also in the ActiveSync --> Connections menu i have "Sync all PCs using this connection:" ticked, however the drop down menu is empty, nothing to select.
in the ActiveSync start screen there's just the fake Microsoft Exchange account, nothing else
Everything was working fine till few days ago :/
dapezzz said:
Hello
I got the same problem where I did not get the "3 choices" screen while connecting to usb, and IS by default...
I just deleted all keys in the registry under //HKLM\Software\HTC\USBToPCPopUP\
and it went back to normal....
Hope it will the same for you..
Click to expand...
Click to collapse
I tried this but still get ICS opening when I connect my device up. It is driving me mad now trying to sort this - I may even resort to a hard reset before the end of the weekend.
The only way I can get sync to work is to disable the faster data sync option.
hmm, every system i test with gives the same result:
the htc device does charge, but the usb data-connection never works...
could it be a faulty connector?
http://forum.xda-developers.com/showthread.php?p=3764541#post3764541
I have the same problem and the above method solves the problem
Hope it helps.

Categories

Resources