OpenNETCF desktop communcation codes issue.

N

netcfadmirer

Hi,
I'm new to .net compact framework development and recently i've been
assigned to work out a desktop application to perform silent
installation of cab files as well as extracting information from the
windows mobile 5.0 devices using vs.net 2005

I found out that OpenNETCF have an desktop.communication.dll which able
to help me to accomplish the above tasks and managed to wrote an simple
application to copy the cab to the devices and launch the wceload to
perform silent install. This worked perfectly but i have a few
questions below which i need to sort it out.


Questions:
1.) I tried to retrieve the OS version by using the
openNETCF.Desktop.Communication(ver 2.9) in vs 2005 by writting below
codes:

Private Function GetCB() As String
Dim vi As New OSVERSIONINFO
Dim a As String
a = ""

SL_RAPI.Connect()
SL_RAPI.GetDeviceVersion(vi)
a = vi.dwMajorVersion
SL_RAPI.Disconnect()

GetCB = a
End Function

I tried to run the application in debug and found out that the codes
are able to retrieve the Major Version. But when the application hit
the End function statement, it will prompt out :

FatalExecutionEngineError was detected
The runtime has encountered a fatal error. The address of the error was
at 0x7a2b5aec, on thread 0x69c. The error code is 0xc0000005. This
error may be a bug in the CLR or in the unsafe or non-verifiable
portions of user code. Common sources of this bug include user
marshaling errors for COM-interop or PInvoke, which may corrupt the
stack.

Any idea ?



2. I've noticed that by using the openNETCF.Desktop.Communication(ver
2.9) to retrieve device memory status, its only allow to retrieve
program memory and there is no API to retrieve storage memory.

in windows mobile 5.0, the memory have divided into 2 portion, program
and storage. Any idea on how to retrieve the storage memory ?

Dim ms As New MEMORYSTATUS

SL_RAPI.Connect()
SL_RAPI.GetDeviceMemoryStatus(ms)

info += "Total memory: " & String.Format("{0:###,###,###}",
ms.dwTotalPhys) & vbCrLf

info += "Available memory: " & String.Format("{0:###,###,###}",
ms.dwAvailPhys) & vbCrLf



3. Is it possible to write codes to wait for the for the
createProcess("\Windows\wceload.exe", "a.cab /noui") to complete
installation before the next cab installation taken place ?


4 Possible to write codes to display the application installed in the
device using CERegistry ?


5 I've wrote below codes to manually switch on the bluetooth as below :

SL_RAPI.Connect()
Dim wmKey As CERegistryKey

wmKey = CERegistry.LocalMachine.OpenSubKey("System\State\Hardware\",
True)
If wmKey.GetValue("Bluetooth") = "8" Then
wmKey.SetValue("Bluetooth", "9")
End If
wmKey.Close()

The vs.net 2005 prompted Error writing to the RegistryKey, any idea on
how to solve this ?


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top