Home > Archive > SQL Anywhere Mobile > October 2005 > Thread issue Activesync









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Thread issue Activesync
Mark

2005-10-27, 8:20 am

Version 9.02 b3198

I have a question regarding the synchronization thread in .net.

I have implemented the ULActiveSyncListener
and the ULSynProgressListene
r in
my main form.
I have added a panel to the form on which I want to show synchronization
progress. However the panel get's displayed only after synchronization is
complete. Now I know this has something to do with threading, but I can't
seem to figure out how to get it updated during synchronization. I've added
my code, hope you can help me.

public void ActiveSyncInvoked(bo
ol launchedByProvider)
{
this.Invoke( new EventHandler( ActiveSyncHandler ) );
}

internal void ActiveSyncHandler(ob
ject sender, EventArgs e )
{
panelSync.Visible = true;
panelSync.BringToFront();

database.Conn.SyncParms.Stream = ULStreamType.ACTIVE_SYNC;
database.Conn.SyncParms.StreamParms = "stream=tcpip";
database.Conn.SyncParms.UserName = "Dolphin";
database.Conn.SyncParms.Version = "Default";
database.Conn.Synchronize( this );
// MessageBox.Show( "Result is " +
database.Conn.SyncResult.StreamErrorCode.ToString() + " | " +
database.Conn.SyncResult.StreamErrorContext.ToString() + " | " +
database.Conn.SyncResult.StreamErrorID.ToString() + " | " +
database.Conn.SyncResult.StreamErrorSystem.ToString() );
}

public bool SyncProgressed( ULSyncProgressData data )
{
lblBytesRec.Text = data.ReceivedBytes.ToString();
lblBytesSent.Text = data.SentBytes.ToString();

switch( data.State )
{
case ULSyncProgressState.STATE_CANCELLED : lblStatus.Text =
"Geannuleerd" ; break;
case ULSyncProgressState.STATE_CONNECTING : lblStatus.Text =
"Verbinding maken" ; break;
case ULSyncProgressState. STATE_RECEIVING_DATA
: lblStatus.Text =
"Ontvangen" ; break;
case ULSyncProgressState.STATE_SENDING_DATA : lblStatus.Text =
"Versturen" ; break;
case ULSyncProgressState.STATE_DISCONNECTING : lblStatus.Text = "Bezig
met afsluiten"; break;
case ULSyncProgressState.STATE_DONE : lblStatus.Text = "Gereed";
break;
case ULSyncProgressState.STATE_ERROR : lblStatus.Text = "Fout";
break;
}

return false;
}

private void btnSyncClose_Click(o
bject sender, System.EventArgs e)
{
panelSync.SendToBack();
panelSync.Visible = false;

lblBytesRec.Text = "";
lblBytesSent.Text = "";
lblStatus.Text = "";
}





David Fishburn

2005-10-27, 8:20 am

"Mark" <mark@3wt.nl> wrote in news:434667f5@forums
-1-dub of
sybase.public.sqlanywhere.mobilink:

M> Version 9.02 b3198
M>
M> I have a question regarding the synchronization thread in .net.

Did you have a look at:
" %ASANY9%\Samples\Ult
raLite. NET\CustDB\desktop\C
ustDB.sln"

It has a sync progress meter in it.

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

Mark

2005-10-27, 8:20 am

Version 9.02 b3198

I'm looking at the sample now.
I used the same idea, since I'm using c#, creating my own version of
ShowDialog. However, I still have the same problem which is that the sync
progress form only shows itself after Activesync( using version 4 build
4343) says Synchonization is complete.
I'm now trying to run the custdb sample on a pocketpc however it gives an
exception when starting the app.

An unhandled exception of type 'System. MissingMethodExcepti
on' occurred in
iAnywhere.Data.UltraLite.dll

It is triggered on line 134 of CustDB.vb (
" %ASANY9%\Samples\Ult
raLite. NET\CustDB\ce\CustDB
.sln )


"David Fishburn" <fishburn_spam@off.ianywhere.com> schreef in bericht
news:Xns96E8945A0C1F
Afishburnsybasecom@1
27.0.0.1...
> "Mark" <mark@3wt.nl> wrote in news:434667f5@forums
-1-dub of
> sybase.public.sqlanywhere.mobilink:
>
> M> Version 9.02 b3198
> M>
> M> I have a question regarding the synchronization thread in .net.
>
> Did you have a look at:
> " %ASANY9%\Samples\Ult
raLite. NET\CustDB\desktop\C
ustDB.sln"
>
> It has a sync progress meter in it.
>
> --
> David Fishburn
> Certified ASA Developer Version 8
> iAnywhere Solutions - Sybase
> Professional Services
> Please only post to the newsgroup
> Please ALWAYS include version and MORE importantly BUILD number with
> EACH post (dbeng9 -v).
>
> EBFs and Maintenance Releases
> http://downloads.sybase.com/swx/sdmain.stm
>
> Developer Community / Whitepapers
> http://www.ianywhere.com/developer
>
> CaseXpress - to report bugs
> http://casexpress.sybase.com
>
> CodeXchange - Free samples
> [url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
>



Mark

2005-10-27, 8:20 am

Version 9.02 b3198

Never mind the error, ul9net.dll was missing.

In VB.net the sync form is shown during synchronization, but in c# I can't
get it to work. I does synchronize, but it won't show the progress form
until after synchronization is complete.



"Mark" <mark@3wt.nl> schreef in bericht news:434a3bf1$2@foru
ms-1-dub...
> Version 9.02 b3198
>
> I'm looking at the sample now.
> I used the same idea, since I'm using c#, creating my own version of
> ShowDialog. However, I still have the same problem which is that the sync
> progress form only shows itself after Activesync( using version 4 build
> 4343) says Synchonization is complete.
> I'm now trying to run the custdb sample on a pocketpc however it gives an
> exception when starting the app.
>
> An unhandled exception of type 'System. MissingMethodExcepti
on' occurred in
> iAnywhere.Data.UltraLite.dll
>
> It is triggered on line 134 of CustDB.vb (
> " %ASANY9%\Samples\Ult
raLite. NET\CustDB\ce\CustDB
.sln )
>
>
> "David Fishburn" <fishburn_spam@off.ianywhere.com> schreef in bericht
> news:Xns96E8945A0C1F
Afishburnsybasecom@1
27.0.0.1...
>
>



David Fishburn

2005-10-27, 8:20 am

"Mark" <mark@3wt.nl> wrote in news:434a5598$4@foru
ms-1-dub of
sybase.public.sqlanywhere.mobilink:

M> Version 9.02 b3198
M>
M> Never mind the error, ul9net.dll was missing.
M>
M> In VB.net the sync form is shown during synchronization, but in c# I
M> can't get it to work. I does synchronize, but it won't show the
M> progress form until after synchronization is complete.

So is everything golden now?
Your message is a bit mixed.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com