Thank you Rik.
Your guidance helped us a lot.
Once again Thanks.
Post by r***@pen_fact.comOn Thu, 14 Aug 2008 03:23:02 -0700, NoushadAli
I admit I haven't checked in a while, but I'm quite sure repllog.exe
is "ActiveSync" on the device side. I _think_ you can stop it by
"running" it (use CreateProcess function), but I seem to stop it by
finding the window (use FindWindow with windowclassname ActiveSync and
then sending a WM_CLOSE message. I'm quite sure you can restart it by
running it without arguments. My uncertainty is because all this is
used in code I haven't touched in years, and I'm not in touch with all
the users (I'm pretty sure some still use the related feature, and
know I haven't received complaints about it).
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
Post by Rik AttrillHi,
You can certainly use the IOCTL_UFN_CHANGE_CURRENT_CLIENT to
dynamically swap between a mass-storage profile and a serial
(Activesync) one, so I think therefore it should also be possible to
do the same to effectively enable/disable Activesync (by picking a
http://msdn.microsoft.com/en-us/library/ms895475.aspx
Something like this should work...
HANDLE hUSBFn;
UFN_CLIENT_INFO info;
DWORD dwBytes;
// Open the USB function driver
hUSBFn = CreateFile(USB_FUN_DEV, DEVACCESS_BUSNAMESPACE, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(enableActiveSync)
{
// enable activesync
swprintf(info.szName, _T("Serial_Class"));
DeviceIoControl(hUSBFn, IOCTL_UFN_CHANGE_CURRENT_CLIENT,
info.szName, sizeof(info.szName), NULL, 0, &dwBytes, NULL))
}
else
{
// enable mass-storage, disable actviesync
swprintf(info.szName, _T("Mass_Storage_Class"));
DeviceIoControl(hUSBFn, IOCTL_UFN_CHANGE_CURRENT_CLIENT,
info.szName, sizeof(info.szName), NULL, 0, &dwBytes, NULL);
}
best regards,
Rik Attrill
Post by Rik AttrillHi,
These are all declared in is "usbfnioctl.h" (C:\WINCE600\PUBLIC\COMMON
\OAK\INC).
regards,
Rik