Click here to Skip to main content
15,899,313 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: iPhone application(Please help) Pin
Richard MacCutchan14-Jun-10 21:20
mveRichard MacCutchan14-Jun-10 21:20 
Questiondatagrid Pin
jashimu14-Jun-10 4:51
jashimu14-Jun-10 4:51 
QuestionMaking a connection through serial from mobile to pc Pin
ant-damage12-Jun-10 14:01
ant-damage12-Jun-10 14:01 
AnswerRe: Making a connection through serial from mobile to pc Pin
Joel Ivory Johnson30-Jun-10 3:47
professionalJoel Ivory Johnson30-Jun-10 3:47 
GeneralRe: Making a connection through serial from mobile to pc Pin
ant-damage30-Jun-10 3:53
ant-damage30-Jun-10 3:53 
QuestionAccessing the Mobile Phone from the Desktop Pin
Buddha_Joe11-Jun-10 11:32
Buddha_Joe11-Jun-10 11:32 
AnswerRe: Accessing the Mobile Phone from the Desktop Pin
KingsGambit13-Jun-10 6:17
KingsGambit13-Jun-10 6:17 
QuestionHow can I convert a Class to byte[] then back to Class for Windows Mobile? [modified] Pin
Kiotaya10-Jun-10 16:26
Kiotaya10-Jun-10 16:26 
I have a class that I need to convert to a byte array for a Windows Mobile device. The byte array is sent using ssl to a server, which needs to rebuild the class. I have used BinaryFormatter on a PC client that worked great. However I can't use that with the compact framework. This is the code I am currently trying to use but its giving me the error message "Type 'PackageTrans' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.".
public byte[] ClassToBytearray(object obj)
        {    
            int Length = Marshal.SizeOf(obj);       <----------This is where I get the error.
            byte[] bytearray = new byte[Length];     
            IntPtr ptr = Marshal.AllocHGlobal(Length);
            Marshal.StructureToPtr(obj, ptr, false);
            Marshal.Copy(ptr, bytearray, 0, Length);
            Marshal.FreeHGlobal(ptr);
            return bytearray;
        } 


This is my first time using Marshal. Why wouldn't a meaningful size or offset be computed? What is it that I am missing? Is there a different way I should be doing this? Any and all help would be greatly appreciated.

Thanks
-Kio

modified on Friday, June 11, 2010 1:25 AM

AnswerRe: How can I convert a Class to byte[] then back to Class for Windows Mobile? Pin
Sir Dot Net11-Jun-10 13:00
Sir Dot Net11-Jun-10 13:00 
AnswerRe: How can I convert a Class to byte[] then back to Class for Windows Mobile? Pin
1eyhk120-Aug-10 17:34
1eyhk120-Aug-10 17:34 
QuestionCan not connect to SSL web service from windows mobile. Pin
Chetan Ranpariya2-Jun-10 19:37
Chetan Ranpariya2-Jun-10 19:37 
AnswerRe: Can not connect to SSL web service from windows mobile. Pin
Joel Ivory Johnson4-Jun-10 8:28
professionalJoel Ivory Johnson4-Jun-10 8:28 
GeneralRe: Can not connect to SSL web service from windows mobile. Pin
Chetan Ranpariya5-Jun-10 20:09
Chetan Ranpariya5-Jun-10 20:09 
GeneralRe: Can not connect to SSL web service from windows mobile. Pin
Justin Stolle1-Sep-10 14:41
Justin Stolle1-Sep-10 14:41 
AnswerRe: Can not connect to SSL web service from windows mobile. Pin
Chetan Ranpariya10-Jun-10 0:10
Chetan Ranpariya10-Jun-10 0:10 
Questionhow to control electrical appliainces from s60 mobiles (python) and serial to blue tooth converter from sparkfun.com Pin
santoshaxl1-Jun-10 17:00
santoshaxl1-Jun-10 17:00 
QuestionDetecting if connected to WiFi or GPRS or USB Pin
AmitDey31-May-10 22:58
AmitDey31-May-10 22:58 
QuestionDebug mode was stopped! Pin
buffering8325-May-10 14:33
buffering8325-May-10 14:33 
QuestionHow can read and access Nokia Mobile Phone? Pin
Le@rner17-May-10 20:50
Le@rner17-May-10 20:50 
AnswerRe: How can read and access Nokia Mobile Phone? Pin
Richard MacCutchan17-May-10 21:51
mveRichard MacCutchan17-May-10 21:51 
QuestionSQL Server n SQL Server CE..... Pin
AmbiguousName13-May-10 8:59
AmbiguousName13-May-10 8:59 
AnswerRe: SQL Server n SQL Server CE..... Pin
PavanPareta17-May-10 20:53
PavanPareta17-May-10 20:53 
QuestionHow can Send SMS by BlackBerrry curve 8520 from the PC? [modified] Pin
Le@rner12-May-10 20:59
Le@rner12-May-10 20:59 
QuestionDevelop 3D app for iPhone / Android / WinMo Pin
Fordfanboi11-May-10 9:59
Fordfanboi11-May-10 9:59 
AnswerRe: Develop 3D app for iPhone / Android / WinMo Pin
Fordfanboi11-May-10 11:06
Fordfanboi11-May-10 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.