473,462 Members | 1,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C3828 compiler error

I am trying to use "FolderBrowserDialog". I copied the
code out of the online help (VC++) and put it into a
file. I can compile this file, but when I try and use the
class I get a a C3828 error (Placement arguements not
allowed when using managed classes ...). I looked at the
online help and it looks like my code matches what it says.

The following is the line that is causing the grief, and I
don't think I am using placemnt arguements in this line?

FolderBrowserDialogExampleForm *folderBrowseDialog = new
FolderBrowserDialogExampleForm();

My project was based on a Visual C++ application, not a
windows form application, but I did turn on the /clr
compiler option and I believe I have all the approrpriate
#using included.

Nov 16 '05 #1
3 2239
In MFC, debug mode, 'new' is #defined to be something else.

Aren't macros wonderful?

You'll need to undef it before you can make a new managed object.
And then you may want to redefine it back again.

Try right-clicking over new and using the 'go to definition' option to find
the evil.
"David Hardek" <dh*****@vocollect.com> wrote in message
news:00****************************@phx.gbl...
I am trying to use "FolderBrowserDialog". I copied the
code out of the online help (VC++) and put it into a
file. I can compile this file, but when I try and use the
class I get a a C3828 error (Placement arguements not
allowed when using managed classes ...). I looked at the
online help and it looks like my code matches what it says.

The following is the line that is causing the grief, and I
don't think I am using placemnt arguements in this line?

FolderBrowserDialogExampleForm *folderBrowseDialog = new
FolderBrowserDialogExampleForm();

My project was based on a Visual C++ application, not a
windows form application, but I did turn on the /clr
compiler option and I believe I have all the approrpriate
#using included.

Nov 16 '05 #2
In my App.cpp file I deleted the following

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

cleaned the projet and rebuilt and it worked, I then put
the lines back in and cleaned the project again and it
worked again, so i am not really sure what action resolved
my issue, but the problem is gone.

Just as a note I had done a clean and rebuild several
times including one before I removed the lines (just after
I read the posting on how to solve the issue).
-----Original Message-----
In MFC, debug mode, 'new' is #defined to be something else.
Aren't macros wonderful?

You'll need to undef it before you can make a new managed object.And then you may want to redefine it back again.

Try right-clicking over new and using the 'go to definition' option to findthe evil.
"David Hardek" <dh*****@vocollect.com> wrote in message
news:00****************************@phx.gbl...
I am trying to use "FolderBrowserDialog". I copied the
code out of the online help (VC++) and put it into a
file. I can compile this file, but when I try and use the class I get a a C3828 error (Placement arguements not
allowed when using managed classes ...). I looked at the online help and it looks like my code matches what it says.
The following is the line that is causing the grief, and I don't think I am using placemnt arguements in this line?

FolderBrowserDialogExampleForm *folderBrowseDialog = new
FolderBrowserDialogExampleForm();

My project was based on a Visual C++ application, not a
windows form application, but I did turn on the /clr
compiler option and I believe I have all the approrpriate #using included.

.

Nov 16 '05 #3
For the record, the definitions which lead to this problem are:

void* AFX_CDECL operator new(size_t nSize, LPCSTR lpszFileName, int nLine);
#define DEBUG_NEW new(THIS_FILE, __LINE__)
#define new DEBUG_NEW

so when you do 'new ManagedClass(...)'
it's actually doing 'new("C:\...", 1234) ManagedClass(...)', and you can't
use placement-new to instantiate managed objects.

Not that it matters particularly now you've got it working.
"David Hardek" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
In my App.cpp file I deleted the following

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

cleaned the projet and rebuilt and it worked, I then put
the lines back in and cleaned the project again and it
worked again, so i am not really sure what action resolved
my issue, but the problem is gone.

Just as a note I had done a clean and rebuild several
times including one before I removed the lines (just after
I read the posting on how to solve the issue).
-----Original Message-----
In MFC, debug mode, 'new' is #defined to be something

else.

Aren't macros wonderful?

You'll need to undef it before you can make a new managed

object.
And then you may want to redefine it back again.

Try right-clicking over new and using the 'go to

definition' option to find
the evil.
"David Hardek" <dh*****@vocollect.com> wrote in message
news:00****************************@phx.gbl...
I am trying to use "FolderBrowserDialog". I copied the
code out of the online help (VC++) and put it into a
file. I can compile this file, but when I try and use the class I get a a C3828 error (Placement arguements not
allowed when using managed classes ...). I looked at the online help and it looks like my code matches what it says.
The following is the line that is causing the grief, and I don't think I am using placemnt arguements in this line?

FolderBrowserDialogExampleForm *folderBrowseDialog = new
FolderBrowserDialogExampleForm();

My project was based on a Visual C++ application, not a
windows form application, but I did turn on the /clr
compiler option and I believe I have all the approrpriate #using included.

.

Nov 16 '05 #4

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

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
0
by: silviu | last post by:
Hello I'm trying to install Microsoft SQL 2005 Server Express Edition but I'm getting the following error: SQL Server Setup unexpectedly failed... Then it says something about a log file. Here's...
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
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...
1
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.