none
OpenNETCF Desktop.Communication Duvida / Erro RRS feed

  • Pergunta

  • Bom Dia,

    A minha seguinte Duvida é, quando corro essa aplicação no Windows App, Funciona... Agr no Emulador/PDA não Funciona, Da-me sempre esse erro:

    Ja instalei o .cab da OpenNETCF, para detectar mas mesmo assim continua a dar erro.

    Será que essas referencias n funcionam no Pocket, isso é que me pergunto mas e quase impossivel Digo eu...

    Qualquer Resposta e valida lol:P

    Cumprimentos

    Pocket PC Novato.

    Erro:

    System.MissingMethodException was unhandled
      Message="Can't find PInvoke DLL 'rapi.dll'."
      StackTrace:
        at OpenNETCF.Desktop.Communication.RAPIException..ctor()
        at OpenNETCF.Desktop.Communication.ActiveSync..ctor()
        at OpenNETCF.Desktop.Communication.RAPI..ctor()
        at DeviceApplication1.Form1.MenuItem1_Click()
        at System.Windows.Forms.MenuItem.OnClick()
        at System.Windows.Forms.Menu.ProcessMnuProc()
        at System.Windows.Forms.Form.WnProc()
        at System.Windows.Forms.Control._InternalWnProc()
        at Microsoft.AGL.Forms.EVL.EnterMainLoop()
        at System.Windows.Forms.Application.Run()
        at DeviceApplication1.Form1.Main()

    Codigo:

    Private WithEvents m_activesync As ActiveSync

    Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click

    Dim m_rapi As New RAPI

    Try

    If Not m_rapi.Connected Then

    m_rapi.Connect()

    btnConnect.Text = "Disconnect"

    Dim si As New SYSTEM_INFO

    Dim vi As New OSVERSIONINFO

    Dim sps As New SYSTEM_POWER_STATUS_EX

    Dim ms As New MEMORYSTATUS

    Dim info As String

    m_rapi.GetDeviceSystemInfo(si)

    m_rapi.GetDeviceVersion(vi)

    m_rapi.GetDeviceSystemPowerStatus(sps)

    m_rapi.GetDeviceMemoryStatus(ms)

    Select Case si.wProcessorArchitecture

    Case ProcessorArchitecture.Intel

    info = "Intel Processor" & vbCrLf

    Case ProcessorArchitecture.MIPS

    info = "MIPS Processor" & vbCrLf

    Case ProcessorArchitecture.ARM

    info = "ARM Processor" & vbCrLf

    Case Else

    info = "Unknown Processor" & vbCrLf

    End Select

    info = info & "CE Version: " & vi.dwMajorVersion & "." & vi.dwMinorVersion & "." & vi.dwBuildNumber & vbCrLf

    info = info & "AC Power: " & IIf(sps.ACLineStatus = 1, "ON", "OFF") & vbCrLf

    info = info & "Batteria: " & sps.BatteryLifePercent & "%" & vbCrLf

    info = info & "Memoria: " & String.Format("{0:###,###,###}", ms.dwAvailVirtual) & vbCrLf

     

    txtInfo.Text = info

    Else

    m_rapi.Disconnect()

    txtInfo.Text = ""

    btnConnect.Text = "Connect"

    End If

    Catch ex1 As OpenNETCF.Desktop.Communication.RAPIException

    MsgBox(ex1.Message)

    Catch ex As Exception

    MsgBox(ex.Message)

    End Try

    End Sub

     

    Erro:

    System.MissingMethodException was unhandled
      Message="Can't find PInvoke DLL 'rapi.dll'."
      StackTrace:
        at OpenNETCF.Desktop.Communication.RAPIException..ctor()
        at OpenNETCF.Desktop.Communication.ActiveSync..ctor()
        at OpenNETCF.Desktop.Communication.RAPI..ctor()
        at DeviceApplication1.Form1.MenuItem1_Click()
        at System.Windows.Forms.MenuItem.OnClick()
        at System.Windows.Forms.Menu.ProcessMnuProc()
        at System.Windows.Forms.Form.WnProc()
        at System.Windows.Forms.Control._InternalWnProc()
        at Microsoft.AGL.Forms.EVL.EnterMainLoop()
        at System.Windows.Forms.Application.Run()
        at DeviceApplication1.Form1.Main()

    terça-feira, 16 de maio de 2006 07:32

Respostas

  • Bem eskeci-me de postar aki :P

    E o Seguinte esse Codigo so Funciona para o Windows App. Para PDA n funciona e por isso e que n dava

    Cumprimentos.:P

     

    quinta-feira, 25 de maio de 2006 12:32