|
Similar question[^] has appeared on this forum few days before. It should give you idea.
|
|
|
|
|
I am getting an exception while start running my project. i am included some 6 dll's and each dll is working and verified.
The error message shows,
"The application failed to initialize properly (0xc0000142). Click on OK to terminate the application"
"Unhandled exception in LFATE.exe (NTDLL.DLL): )xc0000142: DLL Initialization Failed"
|
|
|
|
|
|
I would guess DLLMain is returning FALSE in response to the DLL_PROCESS_ATTACH notification and you're statically linking to the DLL.
Steve
|
|
|
|
|
I am linking 10 dlls statically. how can i figure out?
|
|
|
|
|
Just run the app in a debugger and watch the output. I made a test app to reproduce the problem and here's the output MSVC6 produced:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded symbols for 'C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll'
First-chance exception in StaticLinkProblem.exe (NTDLL.DLL): 0xC0000142: DLL Initialization Failed.
The line in question is "Loaded symbols for 'C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll'"; the last DLL load reported before the problem occured.
Steve
|
|
|
|
|
Thankx. But i am getting error message as follows...
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hp34401_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\visa32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\NiViSv32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt20.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DP5022DLL.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DP5301DLL.DLL', no matching symbolic information found.
Loaded 'D:\DP PROJECTS\PEA0430_SEAKING_1\LFATE_APP_MODIFIED_KARTHI\LFATE_Modified ver-0.11_13_12_06_Karthi\Debug\DP5031DLL.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPCPCI4509DRV.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI4035.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI4140.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI4158Drv.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI4305.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI2709Drv.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\DPcPCI4341.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
First-chance exception in LFATE.exe (NTDLL.DLL): 0xC0000142: DLL Initialization Failed.
Whether can i concluded the probelm in
C:\WINDOWS\system32\oleaut32.dll file. is this system dll?
How can i solve it?
Reg,
Parthiban
|
|
|
|
|
Try turning on "loader snaps". Follow these steps:
1. Download and install the latest version of WinDBG[^].
2. Select “Start”->”All Programs”->”Debugging Tools for Windows”->”Global Flags”.
3. The “Global Flags” dialog appears. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter your exe name with extension; not the full path, just the filename.
5. Press the “Tab” key.
6. Tick the “Show loader snaps” tick box.
7. Press the “Apply” button.
8. Run the application in a debugger. Here’s some sample output:
Loaded 'ntdll.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.<br />
Loaded symbols for 'C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll'<br />
[9b4,f48] LDR: Real INIT LIST for process C:\Projects\Scratch\StaticLinkProblem\Debug\StaticLinkProblem.exe pid 2484 0x9b4<br />
[9b4,f48] C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll init routine 100011C0<br />
[9b4,f48] LDR: ProblemDLL.dll loaded - Calling init routine at 100011C0<br />
[9b4,f48] LDR: DLL_PROCESS_ATTACH for dll "C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll" (InitRoutine: 100011C0) failed<br />
LDR: LdrpInitializeProcess - Failed running initialization routines; status c0000142<br />
LDR: _LdrpInitialize - call to LdrpInitializeProcess() failed with ntstatus c0000142<br />
First-chance exception in StaticLinkProblem.exe (NTDLL.DLL): 0xC0000142: DLL Initialization Failed.
9. When done un-check the “Show loader snaps” tick box and press "OK".
The line of interest is the following:
[9b4,f48] LDR: DLL_PROCESS_ATTACH for dll "C:\Projects\Scratch\StaticLinkProblem\Debug\ProblemDLL.dll" (InitRoutine: 100011C0) failed
Steve
|
|
|
|
|
In my program, I have the following code.
struct Stru_A{
char Name[30];
int Age;
}
struct Stru_A * pA1 = new Stru_A();
struct Stru_A * pA2 = new Stru_A();
strcpy(pA1->Name, pA2->Name);
'BoundsChecker' reports the following error,
You have passed an invalid memory address as a pointer to a Windows API function.
However, the program can compile and run successfully ignoring the above BoundsChecker error.
I cannot understand why BoundsChecker report the error.I wonder if ignoring of the error is a correct way.
|
|
|
|
|
As long as you've initialized the Name member of struct Stru_A then there is no problem
in the code you've posted.
If Name is uninitialized then there's a problem
|
|
|
|
|
Thanks,
Yes, I did not initialze 'Name'.
One further question is if uninitialization of 'Name' may cause the following error:
************************
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!
Program: C:\PatternDecompose_1_061220\Debug\testing.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
************************
Currently, my program can run successfully with small-scale dataset. However, when it run with a slightly large dataset, the above message will pop up and the program terminates. To solve this problem, I use BoundChecker to test my program and found the error about
<br />
strcpy(pA1->Name, pA2->Name);<br />
|
|
|
|
|
That error usually happens when you're just out of memory (which seems likely, as you mention using a large data set)
You'll probably need to optimise your workflow, so that you don't need to keep so much in memory.
If you don't seem to have a high memory usage when it dies, the other option is extreme memory fragmentation, which can be a much trickier beast to solve (you'd probably want to implement some sort of memory pooling)
|
|
|
|
|
Sorry , I forgot a line in the illustration
struct Stru_A{
char Name[30];
int Age;
}
struct Stru_A * pA1 = new Stru_A();
struct Stru_A * pA2 = new Stru_A();
strcpy(pA2->Name, "123");//<====== omitted line
strcpy(pA1->Name, pA2->Name);
Does it make sense with the originaly omitted line added?
|
|
|
|
|
Which version of IDE you are using ?
|
|
|
|
|
Thanks,
The IDE i am using is Visual C++ 6.0 SP6.Enterprise Edition
|
|
|
|
|
The error you are getting, "You have passed an invalid memory address as a pointer to a Windows API function", is not really correct. Presuming that both pA1 and pA2 allocated correctly, the memory referenced by the Name arrays will be correct, so you did pass valid addresses to the strcpy(...) function.
However, if you do not initialize the data in the memory for the Name arrays, then the strcpy(...) function will start to copy memory from the start of the two array locations, which is correct, but it may continue past the valid memory for the arrays until it encounters a NUL character.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Sorry , I forgot a line in the illustration
struct Stru_A{
char Name[30];
int Age;
}
struct Stru_A * pA1 = new Stru_A();
struct Stru_A * pA2 = new Stru_A();
strcpy(pA2->Name, "123");//<====== omitted line
strcpy(pA1->Name, pA2->Name);
Does it make sense with the originaly omitted line added?
|
|
|
|
|
Yes that's fine with the line added. You've initialized pA2->Name before using strcpy to
copy it to pA1->Name.
Like James R Twine stated, without doing this, strcpy will continually copy chars until a
0 is found in the source string.
Mark
|
|
|
|
|
Hi,
Can anyone tell me whether it is possible to draw vertical text. using the CDC class. I want to output vertical text to show the lables of the X axis of my bargraph control.
thanks.
|
|
|
|
|
|
Sorry, I want to drae Vertical text not horizontal text .
That method doesn't work. I want to draw a string from bottom to top, letters rotated 90 degrees left?
|
|
|
|
|
You need to play around with the LOGFONT structures members. I think it was the escapement member that you need to alter. Another method would be to draw to an offscreen bitmap, and rotate the whole thing. The latter method would probably be the best solution since modifying the font will yield an ugly output.
|
|
|
|
|
oh;P I think you want to draw a vertical text I think you get your answer of WalderMort reply
|
|
|
|
|
Type something like this:
CPaintDC dc(this);
LOGFONT lf;
lf.lfHeight = -MulDiv(10, GetDeviceCaps(dc, LOGPIXELSY), 72);
lf.lfWidth = 0;
lf.lfEscapement = 900;
lf.lfOrientation = lf.lfEscapement;
lf.lfWeight = FW_DONTCARE;
lf.lfItalic = FALSE;
lf.lfUnderline = FALSE;
lf.lfStrikeOut = FALSE;
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
_tcscpy(lf.lfFaceName, _T("Arial"));
CFont fnt;
fnt.CreateFontIndirect(&lf);
CFont *pOldFont = dc.SelectObject(&fnt);
dc.TextOut(50, 50, _T("Vertical text"));
dc.SelectObject(pOldFont);
Steve
|
|
|
|
|
Hi, May i know how to solve this problem?
I'm using a dialog based MFC application. I have a custom control to display a square. I need it to display the square only after i click on a button. However i notice that, after inserting a button in the dialog, and using the wizard to add the member variable "m_button" and adding the message "OnClickButton" the program dun execute. May i know the reason for this. What should i do to ensure that it is able to execute? Thanks for any help.
|
|
|
|