472,363 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Desirealize CString into System::String

Is there a way to read an MFC serialized class containing CStrings, ints, and
doubles using a CLR-based class? Specifically, to get CString into
System::String?

Bye the Bye, is System:: String the same as system.string (VB) ?
--
Tony H
Nov 17 '05 #1
8 1822
Tony H wrote:
Is there a way to read an MFC serialized class containing CStrings,
ints, and doubles using a CLR-based class? Specifically, to get
CString into System::String?'
You'll have to use MFC facilities to deserialize the data.

Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd
Nov 17 '05 #2
Tony H wrote:
Is there a way to read an MFC serialized class containing CStrings,
ints, and doubles using a CLR-based class? Specifically, to get
CString into System::String?'
You'll have to use MFC facilities to deserialize the data.

Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd
Nov 17 '05 #3
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
Is there a way to read an MFC serialized class containing CStrings,
ints, and doubles using a CLR-based class? Specifically, to get
CString into System::String?'


You'll have to use MFC facilities to deserialize the data.

Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd

Nov 17 '05 #4
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
Is there a way to read an MFC serialized class containing CStrings,
ints, and doubles using a CLR-based class? Specifically, to get
CString into System::String?'


You'll have to use MFC facilities to deserialize the data.

Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd

Nov 17 '05 #5
If you are using CString, you already have MFC included in the project.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Tony H" <To***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
> Is there a way to read an MFC serialized class containing CStrings,
> ints, and doubles using a CLR-based class? Specifically, to get
> CString into System::String?'


You'll have to use MFC facilities to deserialize the data.
>
> Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd

Nov 17 '05 #6
If you are using CString, you already have MFC included in the project.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Tony H" <To***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
> Is there a way to read an MFC serialized class containing CStrings,
> ints, and doubles using a CLR-based class? Specifically, to get
> CString into System::String?'


You'll have to use MFC facilities to deserialize the data.
>
> Bye the Bye, is System::String the same as system.string (VB) ?


Yes.

-cd

Nov 17 '05 #7
Yes, but . . . therein lies the problem.

If I make it a MFC project and then create a CLR class, it won't compile
because of the MDd switch - multi-threaded.

If I make a CLR project - it won't let me add a MFC class - they can only be
added to MFC projects.

I can't seem to get a valid reference so that "using namespace System" will
work in an MFC class.

I can't find anything that "defines" CString for a CLR class.

--
Tony H
"Nishant Sivakumar" wrote:
If you are using CString, you already have MFC included in the project.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Tony H" <To***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
> Is there a way to read an MFC serialized class containing CStrings,
> ints, and doubles using a CLR-based class? Specifically, to get
> CString into System::String?'

You'll have to use MFC facilities to deserialize the data.

>
> Bye the Bye, is System::String the same as system.string (VB) ?

Yes.

-cd


Nov 17 '05 #8
Yes, but . . . therein lies the problem.

If I make it a MFC project and then create a CLR class, it won't compile
because of the MDd switch - multi-threaded.

If I make a CLR project - it won't let me add a MFC class - they can only be
added to MFC projects.

I can't seem to get a valid reference so that "using namespace System" will
work in an MFC class.

I can't find anything that "defines" CString for a CLR class.

--
Tony H
"Nishant Sivakumar" wrote:
If you are using CString, you already have MFC included in the project.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Tony H" <To***@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
How do I add MFC support to this CLR project?
--
Tony H
"Carl Daniel [VC++ MVP]" wrote:
Tony H wrote:
> Is there a way to read an MFC serialized class containing CStrings,
> ints, and doubles using a CLR-based class? Specifically, to get
> CString into System::String?'

You'll have to use MFC facilities to deserialize the data.

>
> Bye the Bye, is System::String the same as system.string (VB) ?

Yes.

-cd


Nov 17 '05 #9

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

Similar topics

27
by: Trep | last post by:
Hi there! I've been having a lot of difficult trying to figure out a way to convert a terminated char array to a system::string for use in Visual C++ .NET 2003. This is necessary because I...
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
8
by: Ioannis Vranos | last post by:
In .NET (and C++/CLI) there is an overloaded String == operator for handles. That is when we do comparison of two String handles the contents of the Strings are compared instead of their addresses....
0
by: Tony H | last post by:
Is there a way to read an MFC serialized class containing CStrings, ints, and doubles using a CLR-based class? Specifically, to get CString into System::String? Bye the Bye, is System:: String...
2
by: Bae,Hyun-jik | last post by:
Hi, My managed C++ library frequently takes LPCTSTR from managed exe. Due to the fact that my library doesn't modify string buffer if its parameter type is LPCTSTR, it won't be required to copy...
3
by: Imran Aziz | last post by:
Hello All, I am getting the following error on our production server, and I dont get the same error on the development box. Unable to cast object of type 'System.Byte' to type 'System.String'. ...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
24
by: Marcus Kwok | last post by:
Hello, I am working on cleaning up some code that I inherited and was wondering if there is anything wrong with my function. I am fairly proficient in standard C++ but I am pretty new to the .NET...
1
by: fade | last post by:
Good night I'm trying to convert a CString into a System::String on a MFC project, this way: CString t1("Hello, World!"); #pragma push_macro("new") #undef new System::String *s1 = new...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.