ActiveSync

The activesync version I'm using is 3.8, and i'm developing in Visual Studio .NET 2003 in C#. I'm also using the mscomm.ocx for communication to the serial ports.

I currently have an application open when I cradle my PocketPC. That works fine. But the point of that Application is to read data. I expect it to be just random characters, I just need to know that it is in fact communicating with the PPC. Any ideas on how I would go about this. I currently have the following as code (InitComPort is a subrouting I created that is initiated in the constructor)

private void InitComPort()

{

com.CommPort = 1;

com.RThreshold = 1;

com.Settings = "9600,n,8,1";

com.DTREnable = true;

com.InputMode = MSCommLib.InputModeConstants.comInputModeText;

com.InputLen = 0;

com.NullDiscard = false;

this.com.OnComm += new System.EventHandler(this.com_OnComm);

//com.PortOpen = true;

}

private void com_OnComm(object sender, EventArgs e)

{

if (com.InBufferCount > 0)

{

ProcessComData((string) com.Input);

}

}

private void ProcessComData(string input)

{

this.rtfTerminal.AppendText(input + "\n");

}

if I were to uncomment that com.PortOpen line, it would give me an error stating that ActiveSync can't communicate because the COM1 port is unavailable.

Any clues would be helpful.

Cheers,



Answer this question

ActiveSync

  • Pure Krome

    I have the program that I created to activate when the PPC is cradled. AS kicks in and then it would do its thing. I need to receive data from the PPC (the Pocket Access DB specifically). I'm sure this isn't the answer to your question, but just describing the situation and scenario that I'm in.
  • Wellnow

    I don't see the relevance of AS to the serial port. Except may be if AS is using serial port, in that case it can't be used for anything else. Similar, if some other application is using serial port it can't be used by AS. Is that the problem



  • Andrew Chapman

    like Ilya said, if AS is using the port, other applications cannot, and if you attempt to instantiate a new connection, ActiveSync will fail. I'm not certain if it's the physical port as a whole, or a logical port, but you might try using a port other than COM1 for your application, or vice versa, use a different logical port for ActiveSync.

    furthermore, I believe you can detect cradling without ActiveSync activating.


  • pars382985

    That's a valid scenario but I don't see what serial port has to do with it. Do you have a serial port connection between your PC and PPC (as in serial cable between them or virtual serial port set up over BT or similar)

    Or are you saying you have completely unrelated application on PC which is using serial port and that somehow creates problem with AS

    As to getting file from PPC, you can use RAPI to do that. There’s managed wrapper available from OpenNetcf.org.



  • ActiveSync