473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hashtable different in Compact Framework than in the normal Framework?

Hello NG!

I've got a short question:
Is there a difference of the internal representation of a Hashtable between
the Compact Framework and the normal Framework?

I've got the suspicion, because when I Serialize the same Object (with a
Hashtable in it) on a Computer with the normal .NET Framework and on a
mobile Device (which uses the Compact Framework) the byteStream is
different!
The byteStream of the mobile Device is always a little smaller!
And therefore the Desirialization of the Object on the other side fails :-(

For Serialization and Deserialization I use the CompactFormatter which works
pretty good. Locally (when I Serialize and Deserialize on the same Device
with the same Framework) it works!
Objects without a Hashtable also work (even the Deserialization on the other
side)!

So I guess that the representation of a Hashtable between the two Frameworks
might be different.

Could that be?
Or am I on the wrong way?
Any Ideas?

Greetings,
André
Nov 15 '05 #1
4 2011
André Giesing <an**********@gmx.de> wrote:
I've got a short question:
Is there a difference of the internal representation of a Hashtable between
the Compact Framework and the normal Framework?

I've got the suspicion, because when I Serialize the same Object (with a
Hashtable in it) on a Computer with the normal .NET Framework and on a
mobile Device (which uses the Compact Framework) the byteStream is
different!
The byteStream of the mobile Device is always a little smaller!
And therefore the Desirialization of the Object on the other side fails :-(
If you're trying to serialize something using one version of the
framework and deserialize it using another, I think you're almost
*bound* to run into problems. It's just not going to work.
Objects without a Hashtable also work (even the Deserialization on the other
side)!


Some objects will - others won't. Relying on it sounds like a really
bad idea to me.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Hi Jon!
If you're trying to serialize something using one version of the
framework and deserialize it using another, I think you're almost
*bound* to run into problems. It's just not going to work.
Why other versions of the framework?
I'm using the .NET Framework on the one side and the .NET
Compact Framework on the other side. And the CF should be
a subset of the full .NET Framework, shouldn't it?
Some objects will - others won't. Relying on it sounds like a really
bad idea to me.


Which object will do and which won't?
Or do I have to try and wait for failures?

So in your opinion serializing and deserialising between the .NET
Framework and the Compact Framework will not do?

Greetings,
André
Nov 15 '05 #3
André Giesing <an**********@gmx.de> wrote:
If you're trying to serialize something using one version of the
framework and deserialize it using another, I think you're almost
*bound* to run into problems. It's just not going to work.
Why other versions of the framework?
I'm using the .NET Framework on the one side and the .NET
Compact Framework on the other side. And the CF should be
a subset of the full .NET Framework, shouldn't it?


It's a subset though - a different version. Some objects will have
fewer fields; some may even have more.
Some objects will - others won't. Relying on it sounds like a really
bad idea to me.


Which object will do and which won't?
Or do I have to try and wait for failures?


No, just don't do it in the first place.
So in your opinion serializing and deserialising between the .NET
Framework and the Compact Framework will not do?


Indeed - it's just a bad idea.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
Most defenitely the binary serialization of different versions will be
different. You should try custom serialization

André Giesing wrote:
Hello NG!

I've got a short question:
Is there a difference of the internal representation of a Hashtable between
the Compact Framework and the normal Framework?

I've got the suspicion, because when I Serialize the same Object (with a
Hashtable in it) on a Computer with the normal .NET Framework and on a
mobile Device (which uses the Compact Framework) the byteStream is
different!
The byteStream of the mobile Device is always a little smaller!
And therefore the Desirialization of the Object on the other side fails :-(

For Serialization and Deserialization I use the CompactFormatter which works
pretty good. Locally (when I Serialize and Deserialize on the same Device
with the same Framework) it works!
Objects without a Hashtable also work (even the Deserialization on the other
side)!

So I guess that the representation of a Hashtable between the two Frameworks
might be different.

Could that be?
Or am I on the wrong way?
Any Ideas?

Greetings,
André


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: boble | last post by:
Sorry, it's may be off topic ;_((( The following article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/ht ml/winmob03.asp states that a.. Microsoft Windows .NET...
2
by: paul | last post by:
I have developed an application for pocket pc that requires multiple forms to be open at any one time. The user is able to flick from one to the other, making changes to each as and when necessary...
7
by: Joseph Lee | last post by:
Hi All, I am having problem when i am using hashtable to keep an array of bytes value as keys. Take a look at the code snippet below --------------------------------------------------- ...
33
by: Ken | last post by:
I have a C# Program where multiple threads will operate on a same Hashtable. This Hashtable is synchronized by using Hashtable.Synchronized(myHashtable) method, so no further Lock statements are...
1
by: Tomá¹ Machala | last post by:
To get startup path on normal Framework, I'd use Application.StartupPath but how can I do the same on Compact Framework? There isn't such method in Application class. Thanks.
1
by: Davie | last post by:
I am experiencing a problem with AuthHeaderValue. I have implemented web services which use authentication through AuthHeaderValue. This works perfectly for any Windows application but it fails...
0
by: news | last post by:
I am porting some code from a PC to a PocketPC. I want to read data from an XML-file into a hashtable. But since the soapformatter does not exist in the compact framework I have to find a...
8
by: Ashish Khandelwal | last post by:
-----See below code, string str = "blair"; string strValue = "ABC"; string str1 = "brainlessness"; string strValue1 = "XYZ"; int hash = str.GetHashCode() ; // Returns 175803953 int hash1 =...
9
by: raylopez99 | last post by:
Hello all— I’m trying to get the below to work and cannot get the format right. It’s from this example: http://msdn.microsoft.com/en-us/library/8627sbea(VS.71).aspx What it is: I’m trying...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.