Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

Compilation Error :placement arguments not allowed?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raed Sawalha - 30 Oct 2004 19:50 GMT
i have the following scenario

I've created MFC Application using Visual Studio 2003, then change the
project settings
to use Managed Extensions as follows:

1. Configuration Properties->General->use Managed Extension : Yes
2. C/C++->General->Debug Information Format : Program Database (/Zi)
3. C/C++->Code Generation->Enable Minimal Build : No
4. C/C++->Basic Run-Time Check : Default

then in the CMyClassDlg.cpp did the following:

#using <mscorlib.dll>
#using <System.dll>
using namespace System;
#using <System.Xml.dll>
#using <System.Data.dll>

and in the OnInitDialog() did :

XmlDocument *xmlDoc = new XmlDocument();
//Just this to try

and compile this error message appeared:

(105): error C3828: 'System::Xml::XmlDocument': placement arguments not
allowed while creating instances of managed classes

I dont know why this error generated ,though I did the same thing in my
ISAPI Filter DLL project and used XmlDocument
and SqlClient effectively.

why this happening in MFC application .
Any Idea? Regards.
Holger Grund - 31 Oct 2004 18:22 GMT
> and in the OnInitDialog() did :
>
[quoted text clipped - 5 lines]
> (105): error C3828: 'System::Xml::XmlDocument': placement arguments not
> allowed while creating instances of managed classes

This might due to some magic MFC applies to trace memory leaks.
In debug builds MFC used to redefine new to call a placement
version of the operator ( e.g.: new (__FILE__,__LINE__) XmlDocument ).

Placement syntax is not supported for managed objects.

Can you try to build in release mode or #undef new after the MFC
header #includes?
I'm not sure there is a good way to use MFC memory checks along
with managed functionality. Maybe you want to write a template
function to create GC objects.

-hg

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.