473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Can not create CString in Managed C++ dll

Hi all,

If this question has been discussed before, I appologize for that,
please point me to the correct direction.

If I created Managed C++ console application, I can use ATL::CString
no problem, but after I created managed C++ dll, I can't use CString
at all in the dll. The code blows up at:

explicit CSimpleStringT( IAtlStringMgr*
pStringMgr ) throw()
{
ATLASSERT( pStringMgr != NULL );
--->>> CStringData* pData =
pStringMgr->GetNilString();
Attach( pData );
}

even when I just do:
[code:1:f37bb6ef75]
ATL::CString str("hello");
[/code:1:f37bb6ef75]

Any suggestion?

Thanks in advance!
Zhen

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 17 '05 #1
0 910

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

Similar topics

2
by: mirek | last post by:
Hi, I'm trying to import my old code to the .NET using managed wrappers. I've read "Managed Extensions for C++ Migration Guide" document and was trying to do what it stated in it. For example if...
7
by: Klaus Bonadt | last post by:
I have an existing VC6 application using the MFC. I am able to pass CString and other parameters from such a VC6 dll to an unmanaged MFC dll (compiled in Visual Studio .NET). Now I want to use...
0
by: Tony | last post by:
I have a managed C++ Console Application, and C++ Windows Forms application where I am trying to use an unmanaged header/lib file combo that exposes a class for functionality... The trouble I run...
1
by: SteveK | last post by:
Trying to wrap an unmanaged class. Here is the function I'm trying to wrap: bool Init(PCSTR filename, PCSTR username, PCSTR password, PCSTR working); In my managed C++ class, I have a method...
4
by: sklett | last post by:
I have dealt with converting managed C++ String* to PCSTR using the Marshal class, but now I need to get managed C++ String* converted to MFC CString. I can't seem to figure out how this is...
1
by: Klynt | last post by:
Project built using /CLR, but code is old and has not been converted specifically to "managed" (__gc or __value). Everything seemed to work great, until I got the following error. I have a...
2
by: Patrik via DotNetMonster.com | last post by:
Hi, I have simple managed C++ lib library with variable declaration of type CString. Another C# windows application reference this C++ library. When I try call method in C++ library from C#,...
4
by: rhaazy | last post by:
I have created this very primitive class for the purpose of performing some simple recursive functions. I am new to C++ and the concept of classes all together. I put this together using various...
4
by: Notre Poubelle | last post by:
Hello, I have a scenario where my CPP project is not compiled with CLR support, but some of the CPP files have the /clr option set. In file1.cpp, the /clr switch is not set. In file2.cpp, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.