Click here to Skip to main content
15,913,323 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SQLConnect --Invalid string or buffer length Pin
BlackDice24-Mar-04 10:09
BlackDice24-Mar-04 10:09 
GeneralMemory allocation failure Pin
AJarrett24-Mar-04 8:57
AJarrett24-Mar-04 8:57 
GeneralRe: Memory allocation failure Pin
l a u r e n24-Mar-04 9:02
l a u r e n24-Mar-04 9:02 
GeneralRe: Memory allocation failure Pin
AJarrett24-Mar-04 9:09
AJarrett24-Mar-04 9:09 
GeneralRe: Memory allocation failure Pin
Neville Franks24-Mar-04 9:16
Neville Franks24-Mar-04 9:16 
GeneralRe: Memory allocation failure Pin
AJarrett24-Mar-04 9:25
AJarrett24-Mar-04 9:25 
GeneralRe: Memory allocation failure Pin
John R. Shaw24-Mar-04 9:59
John R. Shaw24-Mar-04 9:59 
GeneralRe: Memory allocation failure Pin
axid3j1al24-Mar-04 11:37
axid3j1al24-Mar-04 11:37 
Thats right that the problem is almost definately not where you think it is.

I mean look at the definiton of new.

void* __cdecl operator new(size_t nSize)
{
void* pResult;
#ifdef _AFXDLL
_PNH pfnNewHandler = _pfnUninitialized;
#endif
for (;;)
{
#if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
pResult = _malloc_dbg(nSize, _NORMAL_BLOCK, NULL, 0);
#else
pResult = malloc(nSize);
#endif
if (pResult != NULL)
return pResult;

#ifdef _AFXDLL
if (pfnNewHandler == _pfnUninitialized)
{
AFX_MODULE_THREAD_STATE* pState = AfxGetModuleThreadState();
pfnNewHandler = pState->m_pfnNewHandler;
}
if (pfnNewHandler == NULL || (*pfnNewHandler)(nSize) == 0)
break;
#else
if (_afxNewHandler == NULL || (*_afxNewHandler)(nSize) == 0)
break;
#endif
}
return pResult;
}

Look at the for(;;)

It should not fail.

You have corrupted the heap.

Get MMGR from http://www.fluidstudios.com/publications.html .

It is an excellent class.

Ensure that you carefully read the instructions [ especially the order of includes].


Use it on Debug and Release builds.

Check that you have not used new and free or similar.
Check for resource leaks.



Regards,

axe

GeneralAccessing a COM object in a DLL Pin
aafflyer24-Mar-04 8:52
aafflyer24-Mar-04 8:52 
GeneralRe: Accessing a COM object in a DLL Pin
aafflyer26-Mar-04 7:58
aafflyer26-Mar-04 7:58 
GeneralMemory leak msg... Pin
0v3rloader24-Mar-04 8:39
0v3rloader24-Mar-04 8:39 
GeneralRe: Memory leak msg... Pin
David Crow24-Mar-04 9:12
David Crow24-Mar-04 9:12 
GeneralRe: Memory leak msg... Pin
0v3rloader24-Mar-04 9:22
0v3rloader24-Mar-04 9:22 
GeneralLowLevelKeyboardProc possible return values Pin
0v3rloader24-Mar-04 8:30
0v3rloader24-Mar-04 8:30 
GeneralSQLConnect connection string Pin
BlackDice24-Mar-04 7:49
BlackDice24-Mar-04 7:49 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 7:53
David Crow24-Mar-04 7:53 
GeneralRe: SQLConnect connection string Pin
BlackDice24-Mar-04 8:01
BlackDice24-Mar-04 8:01 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 8:10
David Crow24-Mar-04 8:10 
GeneralRe: SQLConnect connection string Pin
BlackDice24-Mar-04 8:18
BlackDice24-Mar-04 8:18 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 9:11
David Crow24-Mar-04 9:11 
QuestionMouse direction settings? Pin
DaFrawg24-Mar-04 7:31
DaFrawg24-Mar-04 7:31 
GeneralLink Error Pin
satcat24-Mar-04 6:27
satcat24-Mar-04 6:27 
GeneralRe: Link Error Pin
Navin24-Mar-04 6:35
Navin24-Mar-04 6:35 
GeneralRe: Link Error Pin
satcat24-Mar-04 7:21
satcat24-Mar-04 7:21 
GeneralRe: Link Error Pin
David Crow24-Mar-04 7:11
David Crow24-Mar-04 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.