473,396 Members | 1,938 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,396 software developers and data experts.

Compilation Error :placement arguments not allowed?

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.


Nov 17 '05 #1
1 1468

"Raed Sawalha" <ra**********@hotmail.com> wrote

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

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
Nov 17 '05 #2

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

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
2
by: Alex Wisnoski | last post by:
I have an A97 application that I am modifying. I have created an unbound form, "zfrmTestEnterPlacements", with a subform, "zsfrmSelectPlacement". The intent is to use a combo box on the primary...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
1
by: Raed Sawalha | last post by:
I don't I'm asking in right place , but I looked for a Managed C++ group to ask and didnt find i have the following scenario I've created MFC Application using Visual Studio 2003, then change the...
2
by: Zardoz | last post by:
I've created a new header file in which one will find : #using <mscorlib.dll> using namespace System; __gc class G { public: int k; int sum(int){return 0;}
0
by: Patrick | last post by:
My code uses SqlConnection * dataConnection=new SqlConnection(strConnection); to create a connection to a sql database This works fine when in 'Release' mode but in 'Debug' mode I get a compile...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
6
by: alban | last post by:
Hello I have got some problems of compilation on a AIX IBM, I use the XLC compilator (And I can't install another one). I try to compile code Pro*c ".pc" (oracle), I need do a pre-compilation...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
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...
0
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...
0
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,...

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.