473,657 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to serialize a C++ object through .Net Remoting

Below is a custom exception class that I created to be shared by my C+
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationIn fo and StreamingContex t as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???

Also, how do I write the construction (right now is just a printf
statemet :-) so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.

Thanks in advance,

Ben

=============== =============== =============== ===============
[Serializable]
public __gc class FtException : public System::Excepti on
{
public:
String *_errMsg;
int _errNo;

FtException(Sys tem::Runtime::S erialization::S erializationInf o __gc*
info,
System::Runtime ::Serialization ::StreamingCont ext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime. Serialization.S erializationExc eption: The constructor
to deserialize an object of type Ft.ServiceUtils .FtException was not
found.

Server stack trace:

at
System.Runtime. Serialization.O bjectManager.Co mpleteISerializ ableObject(Obje ct
obj, SerializationIn fo info, StreamingContex t context)
at
System.Runtime. Serialization.O bjectManager.Fi xupSpecialObjec t(ObjectHolder
holder)
at System.Runtime. Serialization.O bjectManager.Do Fixups()
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.De serialize(Heade rHandler
handler, ISerParser serParser)
at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream, HeaderHandler handler)
at
System.Runtime. Remoting.Channe ls.CoreChannel. DeserializeSoap ResponseMessage (Stream
inputStream, IMessage requestMsg, Header[] h, Boolean bStrictBinding)
at
System.Runtime. Remoting.Channe ls.SoapClientFo rmatterSink.Des erializeMessage (IMethodCallMes sage
mcm, ITransportHeade rs headers, Stream stream)
at
System.Runtime. Remoting.Channe ls.SoapClientFo rmatterSink.Syn cProcessMessage (IMessage
msg)

Exception rethrown at [0]:
at Ft.FTConsole.Op tionsDialog.tbP olicyServer_Key Up(Object sender,
KeyEventArgs e) in ....

Jul 31 '07 #1
3 2154
be*****@gmail.c om wrote:
Below is a custom exception class that I created to be shared by my C+
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationIn fo and StreamingContex t as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???

Also, how do I write the construction (right now is just a printf
statemet :-) so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.
[Serializable]
public __gc class FtException : public System::Excepti on
{
public:
String *_errMsg;
int _errNo;

FtException(Sys tem::Runtime::S erialization::S erializationInf o __gc*
info,
System::Runtime ::Serialization ::StreamingCont ext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime. Serialization.S erializationExc eption: The constructor
to deserialize an object of type Ft.ServiceUtils .FtException was not
found.
I think you need a constructor with no arguments.

Arne

PS: This is a C# group.
Aug 1 '07 #2
On Jul 31, 5:47 pm, Arne Vajhøj <a...@vajhoej.d kwrote:
benk...@gmail.c om wrote:
Below is a custom exception class that I created to be shared by my C+
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationIn fo and StreamingContex t as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???
Also, how do I write the construction (right now is just a printf
statemet :-) so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.
[Serializable]
public __gc class FtException : public System::Excepti on
{
public:
String *_errMsg;
int _errNo;
FtException(Sys tem::Runtime::S erialization::S erializationInf o __gc*
info,
System::Runtime ::Serialization ::StreamingCont ext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime. Serialization.S erializationExc eption: The constructor
to deserialize an object of type Ft.ServiceUtils .FtException was not
found.

I think you need a constructor with no arguments.

Arne

PS: This is a C# group.
Thanks for the reply. I added an constructor w/ no arguments
"FtException()" .
But the same error of
"System.Runtime .Serialization. SerializationEx ception" is
still there.

Ben

PS. I believe my question is still C# related. And I hope I am not the
only
C# developer that needs to struggle with the integration with an
existing
C++ library...

Aug 1 '07 #3

If you look at your assembly in a decompiler (Reflector) is the
constructor there? Seems like an odd problem, the only thing that
causes that error is missing the SerializationIn fo, StreamingContex t
constructor but you have it declared.

Not that it matters for this problem, but the serialization
constructor is usually declared protected.

While this may be related to c# integration, sounds like a weird
c++/cli problem and you may have better luck in a different group.

HTH,

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On Tue, 31 Jul 2007 15:05:31 -0700, be*****@gmail.c om wrote:
>============== =============== =============== =============== =
[Serializable]
public __gc class FtException : public System::Excepti on
{
public:
String *_errMsg;
int _errNo;

FtException(Sys tem::Runtime::S erialization::S erializationInf o __gc*
info,
System::Runtime ::Serialization ::StreamingCont ext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime .Serialization. SerializationEx ception: The constructor
to deserialize an object of type Ft.ServiceUtils .FtException was not
found.

Server stack trace:

at
System.Runtime .Serialization. ObjectManager.C ompleteISeriali zableObject(Obj ect
obj, SerializationIn fo info, StreamingContex t context)
Aug 1 '07 #4

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

Similar topics

2
6357
by: Rachel Suddeth | last post by:
? I have seen apparently different meanings... If you say "designer serialization", it seems to mean that a setting is put into "InitializeComponent" by the designer. Then remoting stuff talks about serialization that has a different meaning that I can't seem to understand. None of the articles I've looked at explain what it means -- they seem to feel it's something standard. I've done network programming, but not with Windows (or even...
14
14295
by: vince | last post by:
Can I add (append) to an xml file that already contains a serialized object, and be able to deserialize to either or both objects from the same file...??? How is this done...?? thanks, vince
5
24697
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
4148
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
0
1548
by: Ken Durden | last post by:
I'm getting the following exception coming out of a block of unmanaged C++ code. Thread executed for 1.03 sec and died with the following exception: External component has thrown an exception. ==== Primary Call Stack ==== at ?Setup@EdgeTopImageProcessor@Edge@InspectionAlgorithm@August@@$$FQAEXHHHHW4eBayerFormatType@BayerImage@234@ABUEdgeTopParam@1234@PAVErrorTraveler@Unmanaged@Infrastructure@4@@Z(EdgeTopImageProcessor* , Int32 , Int32...
3
5926
by: GoodMorningSky | last post by:
I have long term question about object serialization. Object serialization is used in many ways. In .net I heard XML is used for object serialization. I understand how object values are serialized and read many books about it. But, I don't understand how those methods are serialized? Are instance methods serialized? I think it does so, remoting object method call is possible. If so how the method is serialized? Instance values are just...
1
39693
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
2
3137
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
oop Q: If I serialize an interface array, then later deserialize it, do I need the original assembly to deserialize it??? Eg: // Inside of "globaly assembly" public interface Ianimal {
3
5549
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am using dotnet remoting with a binarry formatter. I have a property that returns a memorystream that has had a file loaded into it. When I try to access this property though I get an error regarding "the proxy has no channel sink.......or no suitable Client channel to talk to the server."
0
8403
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
8316
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
8833
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
7345
agi2029
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...
1
6174
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
4168
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...
1
2735
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
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
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.