473,770 Members | 4,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 CompactFormatte r 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 2027
André Giesing <an**********@g mx.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.co m>
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**********@g mx.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.co m>
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 CompactFormatte r 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
4977
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 Compact Framework-The .NET Compact Framework is in ROM in all new Pocket PC 2003 devices, and can be installed in RAM in Pocket PC 2000 and Pocket PC 2002 devices. The question is: how? Answers would be greatly appreciated
2
3585
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 The application uses a stacking system to hold instances of the forms, and an array to hold "previous navigation" information (information on this method was found on "http://smartdevices.microsoftdev.com/Learn/Articles/505.aspx") The problem I have...
7
6889
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 --------------------------------------------------- ASCIIEncoding asciiEncoder = new ASCIIEncoding();
33
3322
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 used before adding, removing or iterating the Hashtable. The program runs in a high workload environment. After running a few days, now it suddenly catchs this Exception when inserting a pair of key and object, stacktrace =...
1
5459
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
1649
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 for a Pocket Pc or Smartphone app. The code is the same, the thing compiles, but I always get a null reference exception when I try to run the app. I've seen examples in various books and online, and to my knowledge this should work fine in the...
0
1203
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 workaround. I have tried to use xmlserializer, but it always wants me to supply it with a type. If I use the type of hashtable I get an exception. Any help or hints would be highly appreciated. Below is the code as it more or less looks in my program :
8
5870
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 = str1.GetHashCode(); // Returns 175803953 Hashtable ht = new Hashtable(); ht.Add(hash ,strValue); ht.Add(hash1,strValue1); // ****ERROR****
9
3117
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 to store multicast delegates in a hash table, and then fire the delegates one of two ways (after registering/ creating the delegates, etc).
0
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.