473,799 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

serialize

i get an exeption and i do not know what else to do to continue
Dim sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Seriali zation.Formatte rs.Binary.Binar yFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Create , FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Windows .Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9' not serializable

Sep 9 '08 #1
9 1900
For now you are trying to serialize a mouse event argument (whihc is not
marked as serializable) to a file ? Is this what you are trying to do ? What
is the big picture ? If not, the eventsi argument should be likely replaced
by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
i get an exeption and i do not know what else to do to continue Dim sdf
As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Seriali zation.Formatte rs.Binary.Binar yFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Create , FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Windows .Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9' not serializable

Sep 9 '08 #2
yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a file
for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E******** *************** ***********@mic rosoft.com...
For now you are trying to serialize a mouse event argument (whihc is not
marked as serializable) to a file ? Is this what you are trying to do ?
What is the big picture ? If not, the eventsi argument should be likely
replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
>i get an exeption and i do not know what else to do to continue Dim sdf
As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Serial ization.Formatt ers.Binary.Bina ryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Creat e, FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Window s.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken =b77a5c561934e0 89' not serializable

Sep 9 '08 #3
So the problem is that this type is not marked as serializable. I'm not sure
you have a quick and easy solution to serialize something not marked as
being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would then
marked serializable) as I feel you'll need anyway some more info for replay
so I would likely just copy the interested members (and would perhaps do
that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a file
for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E******** *************** ***********@mic rosoft.com...
>For now you are trying to serialize a mouse event argument (whihc is not
marked as serializable) to a file ? Is this what you are trying to do ?
What is the big picture ? If not, the eventsi argument should be likely
replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
>>i get an exeption and i do not know what else to do to continue Dim
sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Seria lization.Format ters.Binary.Bin aryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Crea te, FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Windo ws.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToke n=b77a5c561934e 089' not serializable

Sep 9 '08 #4
thank you I will take a deep look at those informations
and give feedback

"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ******** ******@TK2MSFTN GP04.phx.gbl...
So the problem is that this type is not marked as serializable. I'm not
sure you have a quick and easy solution to serialize something not marked
as being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would
then marked serializable) as I feel you'll need anyway some more info for
replay so I would likely just copy the interested members (and would
perhaps do that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
>yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a
file for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E******* *************** ************@mi crosoft.com...
>>For now you are trying to serialize a mouse event argument (whihc is not
marked as serializable) to a file ? Is this what you are trying to do ?
What is the big picture ? If not, the eventsi argument should be likely
replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
i get an exeption and i do not know what else to do to continue Dim
sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Seri alization.Forma tters.Binary.Bi naryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Cre ate, FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Wind ows.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyTok en=b77a5c561934 e089' not serializable

Sep 9 '08 #5
thank you but that'a all in other languages

i need something in vb
"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ******** ******@TK2MSFTN GP04.phx.gbl...
So the problem is that this type is not marked as serializable. I'm not
sure you have a quick and easy solution to serialize something not marked
as being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would
then marked serializable) as I feel you'll need anyway some more info for
replay so I would likely just copy the interested members (and would
perhaps do that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
>yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a
file for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E******* *************** ************@mi crosoft.com...
>>For now you are trying to serialize a mouse event argument (whihc is not
marked as serializable) to a file ? Is this what you are trying to do ?
What is the big picture ? If not, the eventsi argument should be likely
replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
i get an exeption and i do not know what else to do to continue Dim
sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Seri alization.Forma tters.Binary.Bi naryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Cre ate, FileAccess.Writ e, FileShare.None)

Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If

exeption message :
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Wind ows.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyTok en=b77a5c561934 e089' not serializable

Sep 9 '08 #6
Gillard,

I have looked at your code before, and did not understand like Patrice what
you wanted to serialize.

Now I look again I get the idea that you want to serialize an already
serialized file.

Here is a link to our pages where you see a simple sample how easy
serializing is.

http://www.vb-tips.com/SerializeArrayList.aspx

However like Patrice wrote as well to serialize something the class (type)
needs the attribute that it is serializable.

A lot of .Net classes are marked as not serializable.

As this sample does not solve your problem, then try to bring your problem
back to the essention, as that does not help you then rephrase your problem
here.

Cor

"Gillard" <gillard_george s@@@@@@@@@hotma il.comschreef in bericht
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
thank you but that'a all in other languages

i need something in vb
"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ******** ******@TK2MSFTN GP04.phx.gbl...
>So the problem is that this type is not marked as serializable. I'm not
sure you have a quick and easy solution to serialize something not marked
as being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would
then marked serializable) as I feel you'll need anyway some more info for
replay so I would likely just copy the interested members (and would
perhaps do that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
>>yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a
file for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E****** *************** *************@m icrosoft.com...
For now you are trying to serialize a mouse event argument (whihc is
not marked as serializable) to a file ? Is this what you are trying to
do ? What is the big picture ? If not, the eventsi argument should be
likely replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
i get an exeption and i do not know what else to do to continue Dim
sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Ser ialization.Form atters.Binary.B inaryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Cr eate, FileAccess.Writ e, FileShare.None)
>
Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If
>
exeption message :
>
>
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Win dows.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyTo ken=b77a5c56193 4e089' not serializable

Sep 10 '08 #7
Gillard,

Why are you not use the isolated storage for this.

You can make it for the user or for the computer.

http://msdn.microsoft.com/en-us/library/bdts8hk0.aspx

Cor

"Gillard" <gillard_george s@@@@@@@@@hotma il.comschreef in bericht
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
what i try to serialize is a list of mouse and keyboard eventarg for
later
playback
the code is in the attached zip file
"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:7F******** *************** ***********@mic rosoft.com...
>Gillard,

I have looked at your code before, and did not understand like Patrice
what you wanted to serialize.

Now I look again I get the idea that you want to serialize an already
serialized file.

Here is a link to our pages where you see a simple sample how easy
serializing is.

http://www.vb-tips.com/SerializeArrayList.aspx

However like Patrice wrote as well to serialize something the class
(type)
needs the attribute that it is serializable.

A lot of .Net classes are marked as not serializable.

As this sample does not solve your problem, then try to bring your
problem
back to the essention, as that does not help you then rephrase your
problem here.

Cor

"Gillard" <gillard_george s@@@@@@@@@hotma il.comschreef in bericht
news:%2******* *********@TK2MS FTNGP04.phx.gbl ...
>>thank you but that'a all in other languages

i need something in vb
"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ****** ********@TK2MSF TNGP04.phx.gbl. ..
So the problem is that this type is not marked as serializable. I'm not
sure you have a quick and easy solution to serialize something not
marked as being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would
then marked serializable) as I feel you'll need anyway some more info
for replay so I would likely just copy the interested members (and
would
perhaps do that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()
>
I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1
>
the code i have do all the job but i can't find how to save that to a
file for later play back
and that's the problem i have
>
thank you forthe time you take to help me
>
Georges
>
>
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E**** *************** *************** @microsoft.com. ..
>For now you are trying to serialize a mouse event argument (whihc is
>not marked as serializable) to a file ? Is this what you are trying
>to
>do ? What is the big picture ? If not, the eventsi argument should be
>likely replaced by something else...
>>
>--
>Patrice
>>
>"Gillard " <gillard_george s@@@@@@@@@hotma il.coma écrit dans le
>message de groupe de discussion :
>#G******** ******@TK2MSFTN GP02.phx.gbl...
>>i get an exeption and i do not know what else to do to continue
>>Dim
>>sdf As New SaveFileDialog
>> With sdf
>> .AddExtension = True
>> .DefaultExt = ".record"
>> .FileName = Now.ToLongDateS tring
>> .Filter = "recorder (*.record)|*.re cord"
>> End With
>> If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
>> Dim Serializer As New
>>Runtime.S erialization.Fo rmatters.Binary .BinaryFormatte r
>> Dim DataFile As New FileStream(sdf. FileName,
>>FileMode. Create, FileAccess.Writ e, FileShare.None)
>>>
>> Serializer.Seri alize(DataFile, eventsi)
>> DataFile.Close( )
>> ' Data = Nothing
>> End If
>>>
>>exeptio n message :
>>>
>>>
>>type 'System.Windows .Forms.MouseEve ntArgs' in assembly
>>'System.W indows.Forms, Version=2.0.0.0 , Culture=neutral ,
>>PublicKey Token=b77a5c561 934e089' not serializable
>>
>>
Sep 10 '08 #8
For ISerializationS urrogate try perhaps :
http://bytes.com/forum/thread349594.html

It lloks to be still in C# but as the MSDN magazine likely give detailed
explanation it should be possible to translate this to VB quite easily.

For journalrecord/journalplayback try :
http://social.msdn.microsoft.com/for...-93f1d2e429c0/

I can't do much more than searching Google using those keywords...

--
Patrice
"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message de
groupe de discussion : #l************* *@TK2MSFTNGP02. phx.gbl...
thank you I will take a deep look at those informations
and give feedback

"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ******** ******@TK2MSFTN GP04.phx.gbl...
>So the problem is that this type is not marked as serializable. I'm not
sure you have a quick and easy solution to serialize something not marked
as being serializable. A quick search gave :

http://www.codeproject.com/KB/dotnet...alization.aspx

I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.

My personal preference would be likely to use my own type (that I would
then marked serializable) as I feel you'll need anyway some more info for
replay so I would likely just copy the interested members (and would
perhaps do that at the WndProc level).

A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
>>yes i'm trying to serialize mouse event
Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()

I need to do this for a mouse and keyboard recorder
i 'm trying to do a smal utility like it was one in win3.1

the code i have do all the job but i can't find how to save that to a
file for later play back
and that's the problem i have

thank you forthe time you take to help me

Georges
"Patrice" <http://www.chez.com/scribe/wrote in message
news:7E****** *************** *************@m icrosoft.com...
For now you are trying to serialize a mouse event argument (whihc is
not marked as serializable) to a file ? Is this what you are trying to
do ? What is the big picture ? If not, the eventsi argument should be
likely replaced by something else...

--
Patrice

"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le message
de groupe de discussion : #G************* *@TK2MSFTNGP02. phx.gbl...
i get an exeption and i do not know what else to do to continue Dim
sdf As New SaveFileDialog
With sdf
.AddExtension = True
.DefaultExt = ".record"
.FileName = Now.ToLongDateS tring
.Filter = "recorder (*.record)|*.re cord"
End With
If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
Dim Serializer As New
Runtime.Ser ialization.Form atters.Binary.B inaryFormatter
Dim DataFile As New FileStream(sdf. FileName,
FileMode.Cr eate, FileAccess.Writ e, FileShare.None)
>
Serializer.Seri alize(DataFile, eventsi)
DataFile.Close( )
' Data = Nothing
End If
>
exeption message :
>
>
type 'System.Windows .Forms.MouseEve ntArgs' in assembly
'System.Win dows.Forms, Version=2.0.0.0 , Culture=neutral ,
PublicKeyTo ken=b77a5c56193 4e089' not serializable

Sep 10 '08 #9
i do not know how so i 'll take a look at the documentation first

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:0E******** *************** ***********@mic rosoft.com...
Gillard,

Why are you not use the isolated storage for this.

You can make it for the user or for the computer.

http://msdn.microsoft.com/en-us/library/bdts8hk0.aspx

Cor

"Gillard" <gillard_george s@@@@@@@@@hotma il.comschreef in bericht
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>what i try to serialize is a list of mouse and keyboard eventarg for
later
playback
the code is in the attached zip file
"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:7F******* *************** ************@mi crosoft.com...
>>Gillard,

I have looked at your code before, and did not understand like Patrice
what you wanted to serialize.

Now I look again I get the idea that you want to serialize an already
serialized file.

Here is a link to our pages where you see a simple sample how easy
serializing is.

http://www.vb-tips.com/SerializeArrayList.aspx

However like Patrice wrote as well to serialize something the class
(type)
needs the attribute that it is serializable.

A lot of .Net classes are marked as not serializable.

As this sample does not solve your problem, then try to bring your
problem
back to the essention, as that does not help you then rephrase your
problem here.

Cor

"Gillard" <gillard_george s@@@@@@@@@hotma il.comschreef in bericht
news:%2****** **********@TK2M SFTNGP04.phx.gb l...
thank you but that'a all in other languages

i need something in vb
"Patrice" <http://www.chez.com/scribe/wrote in message
news:eJ***** *********@TK2MS FTNGP04.phx.gbl ...
So the problem is that this type is not marked as serializable. I'm
not
sure you have a quick and easy solution to serialize something not
marked as being serializable. A quick search gave :
>
http://www.codeproject.com/KB/dotnet...alization.aspx
>
I didn't gave a close look but it looks like a suggested pattern to
serialize class not marked as serializable.
>
My personal preference would be likely to use my own type (that I
would
then marked serializable) as I feel you'll need anyway some more info
for replay so I would likely just copy the interested members (and
would
perhaps do that at the WndProc level).
>
A quick search gave :
http://www.codeproject.com/KB/applic.../winmacro.aspx
>
>
--
Patrice
>
"Gillard" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le
message
de groupe de discussion : OD************* *@TK2MSFTNGP03. phx.gbl...
>yes i'm trying to serialize mouse event
>Private eventsi As List(Of MacroEvent) = New List(Of MacroEvent)()
>>
>I need to do this for a mouse and keyboard recorder
>i 'm trying to do a smal utility like it was one in win3.1
>>
>the code i have do all the job but i can't find how to save that to a
>file for later play back
>and that's the problem i have
>>
>thank you forthe time you take to help me
>>
>Georges
>>
>>
>"Patrice " <http://www.chez.com/scribe/wrote in message
>news:7E*** *************** *************** *@microsoft.com ...
>>For now you are trying to serialize a mouse event argument (whihc is
>>not marked as serializable) to a file ? Is this what you are trying
>>to
>>do ? What is the big picture ? If not, the eventsi argument should
>>be
>>likely replaced by something else...
>>>
>>--
>>Patrice
>>>
>>"Gillar d" <gillard_george s@@@@@@@@@hotma il.coma écrit dans le
>>message de groupe de discussion :
>>#G******* *******@TK2MSFT NGP02.phx.gbl.. .
>>>i get an exeption and i do not know what else to do to continue
>>>Dim
>>>sdf As New SaveFileDialog
>>> With sdf
>>> .AddExtension = True
>>> .DefaultExt = ".record"
>>> .FileName = Now.ToLongDateS tring
>>> .Filter = "recorder (*.record)|*.re cord"
>>> End With
>>> If sdf.ShowDialog = Windows.Forms.D ialogResult.OK Then
>>> Dim Serializer As New
>>>Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er
>>> Dim DataFile As New FileStream(sdf. FileName,
>>>FileMode .Create, FileAccess.Writ e, FileShare.None)
>>>>
>>> Serializer.Seri alize(DataFile, eventsi)
>>> DataFile.Close( )
>>> ' Data = Nothing
>>> End If
>>>>
>>>exepti on message :
>>>>
>>>>
>>>type 'System.Windows .Forms.MouseEve ntArgs' in assembly
>>>'System. Windows.Forms, Version=2.0.0.0 , Culture=neutral ,
>>>PublicKe yToken=b77a5c56 1934e089' not serializable
>>>
>>>
>
Sep 10 '08 #10

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

Similar topics

7
5831
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a brand new object when deserializing. In my case I have an existing object that I'd like to pass some XML to for the object to repopulate its member variables. Similarly I'd like it to be able to populate an XML string from the values of its member...
5
24730
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream s); public void Deserialize(Stream s); Within the MyUserControl class, there is a field of type MyInnerClass
10
4168
by: Dan | last post by:
All I Am Attempting To Serialize An Object To An XML File. Here Is The Code For That public string SaveNewSurvey( MutualSurveyObject mso_TempObject, int i_JobID ) { string s_RootFileName; string s_FinalFileName; try
3
10389
by: MAY | last post by:
Hi, I have a problem about serialize the form controls. I wrote a test program to test serialize a from but fail (->An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll) . Thx in advance. Here is the part of the code: Regards MAY
2
8890
by: films | last post by:
I understand the concept. Serialization of a class will add all the sub-objects of the class to the stream if there are also serializible. So say I have: class Author {
1
1468
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. Database.cs DatabaseFactory.cs DatabaseProviderFactory.cs DBCommandWrapper.cs
8
5468
by: cd~ | last post by:
I can provide a test app, the news server won't allow me to post the files because they are too large (93KB and 1.2KB) I downloaded the ESRI ArcXml schema and generated the classes from the schema using xsd.exe, which took a while because xsd doesn't handle recursive elements very well (StackOverFlow exception during generation). Now that I have the classes I am trying to serialize them to an xml document to send to ArcIMS to generate...
1
39709
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same
4
7145
by: =?Utf-8?B?Qnlyb24=?= | last post by:
When I try to serialize an instance of the LocationCell below (note Building field) I get an error in the reflection attempt. If I remove the _Building field it serializes fine. I tried renaming Building._Name to Building._BName in case the duplicate name was the issue, but that didn't help. Is there a native way to serialize nested objects, or will I have to write my own? public class LocationCell
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
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
10250
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
10026
tracyyun
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...
1
7564
isladogs
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...
0
6805
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
5463
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...
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.