Hi Tyler,
I test the following managed class in my MC++ program, it works fine:
__gc class testClass{
public:
static void testM1(){
char* ptvszHexString = new char[100];
}
};
Would you please paste some corresponding code snippet(self-contain) and
give some information about your sample program to let us isolate your
problem?
Thanks!
Best regards,
Gary Chang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Tyler" <
[email protected]>
Subject: Memory Allocation in Managed C++ Results in Exception
Date: Mon, 31 May 2004 09:51:21 -0400
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vc
NNTP-Posting-Host: g252.lweb.net 209.167.237.252
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vc:37379
X-Tomcat-NG: microsoft.public.dotnet.languages.vc
I have what I imagine is a very simple Managed C++ memory allocation
question. I have the following line of code in a static method of a managed
C++ class that always generate a System.NullReferenceException ("Object
reference not set to an instance of an object."):
char * ptvszHexString = new char[100];
Can someone tell me what I am missing?
Thanks, Tyler