I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.
I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.
Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).
This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?
Stepping through the serialisation (done using the BinaryFormatter ), I
can't see any obvious problems and certainly no errors are being
thrown.
I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.
For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).
Please spare me from insanity!
Greg 2 1326
Greg,
Can you post simple compilable sample the demonstrates the problem and we
can fiddle with.
--
Stoitcho Goutsev (100)
"Greg" <gr************ *@yahoo.co.ukwr ote in message
news:11******** **************@ d34g2000cwd.goo glegroups.com.. .
>I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.
I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.
Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).
This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?
Stepping through the serialisation (done using the BinaryFormatter ), I
can't see any obvious problems and certainly no errors are being
thrown.
I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.
For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).
Please spare me from insanity!
Greg
Stoitcho,
Thanks, I sorted it in the end. I was using a relative file path for
the serialisation, and the opening of the openfiledialog box was
changing the working file path.
Regards,
Greg.
Stoitcho Goutsev (100) wrote:
Greg,
Can you post simple compilable sample the demonstrates the problem and we
can fiddle with.
--
Stoitcho Goutsev (100)
"Greg" <gr************ *@yahoo.co.ukwr ote in message
news:11******** **************@ d34g2000cwd.goo glegroups.com.. .
I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.
I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.
Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).
This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?
Stepping through the serialisation (done using the BinaryFormatter ), I
can't see any obvious problems and certainly no errors are being
thrown.
I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.
For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).
Please spare me from insanity!
Greg
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jorge Schramm |
last post by:
Hi,
a collegue of mine is trying to write a serialisable container (reads at
construction, writes at destruction).
The writing part is pretty easy: simply iterate through the container and
write into the file.
Reading from the file is (should) be easy too:
while you're getting data from the file (stream) insert it into your
container.
Unfortunatly this fails with the container map, because the
|
by: BrentonMCA |
last post by:
I want to be able to serialise an object and then pass the serialisation text
as a string to a Web service without serialising to a file first.
I also want to be able to deserialise from the text without using a file.
How can I do these?
Brenton
|
by: BoloBaby |
last post by:
I have an extremely vexing problem occurring in a program that I am writing.
Consider the following block of code:
Dim pDancer As New BEDancer
mintIndex = mintIndex + 1
pDancer.DancerName = "Dancer #" & mintIndex
pDancer.DancerStatus = BEDancerStatus.BE_AVAILABLE
pDancer.CardID = mintIndex
oBEDancerList.AddDancer(pDancer)
|
by: Danny Tuppeny |
last post by:
Hi All,
I've been going through Google Groups, but nothing seems to quite match
my problem. It's hard to post a WSDL or anything at the moment (it's not
my service, I'm just using it), but maybe someone will be able to make
suggestions anyway.
I'm using .NET, the server is using Axis. The web method I'm calling
returns a simple complex type with two properties - a string and an int.
In the soap envelope, these are set to values fine,...
|
by: David Herbst |
last post by:
Enterprise Library Jan 2006 with Visual Studio 2005 on Windows 2000
Server sp4.
My custom exception formatter fails with a "Unable to handle exception:
'LoggingExceptionHandler'." exception. When I attached the debugger to
the process and stepped into the code it executed without error. In
both cases I was running a Debug build, the only difference in the case
that works is that I attached the debugger to the same exact binaries....
| |
by: OrionLee |
last post by:
I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's serialiser and then SaveToStream() which will serialises the chart object into a stream for you, which is all well and good...
Now for the problem: If I create a standalone application and use the serialiser to serialise charts it all works fine....
|
by: =?Utf-8?B?Sm9obiBPbGJlcnQ=?= |
last post by:
We have an application that merges menus. It is written in English but we
expected it to run without problems on a copy of a French XpSp2 installation
(in English of course). It does run but the point at which the menus are to
be merged ends up with no merging taking place.
The code appears to use ToolStripManager.Merge(PostRunMenu, TopMenu);
The normal menu entries work fine but the ones to be added by merging do not
show up on the...
|
by: Michael Sharman |
last post by:
Hi guys,
I'm somewhat new to PHP, so please excuse what I hope is an easy
question.
I've experienced some issues lately where the code on my development
environment throws no errors, but when I upload to a shared hosting
server errors are thrown.
The latest was when I had output before calling header(); which should
|
by: JDeats |
last post by:
I'm in a situation where it's difficult to get on-site and
troubleshoot, so I'm looking for scenarios from those experienced on
what might be causing this problem.
I have a .NET 2.0 WinForms based application that that has a few web
references. The application makes the first web service/SOAP call when
the user first launches the app to submit product registration
information. The user is getting an generic "network error message"
that...
|
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...
|
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...
| |
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| | |