|
Cvaji wrote: I am creating 200 process simultaneously
Hi,
Some humble comments:
1.) I would recommend redesigning your application so that it does not require 200 processes to be created. I cannot think of many reasons why this would be necessary. I can think of hundreds of reasons why this would be undesirable.
2.) The number of processes is mostly limited by the amount of RAM available to the OS. Adding more RAM will probably allow more threads/processes.
3.) You should investigate some of the linker options such as "/STACK" and "/HEAP" to minimize application resource usage. Try to minimize the amount of GDI objects and file descriptors used by your application.
4.) If your process is multi-threaded utilize the STACK_SIZE_PARAM_IS_A_RESERVATION creation flag when you create a thread.
Thats all I can think of for now.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi!
When running my application, it suddenly crashes and goes to this line:
m_pBackButton->draw(); . The variable m_pBackButton 's address is:
0x04ea5608. If I set a data break point at this address, the following are the contents:
0x04EA5608 ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee fe ee îþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþîþî
How to run my application without crash?
|
|
|
|
|
T.RATHA KRISHNAN wrote: m_pBackButton->draw();
Are you sure the m_pBackButton is a valid pointer?
|
|
|
|
|
Looks like m_pBackButton is not initialized.
|
|
|
|
|
No. I've initialised inside another function like this:
m_pBackButton = pManager->getGUIEnvironment()->addButton(recti(0,400,192,432), m_pCreditsImage, CREDITS_BACK_BUTTON, L"Back");
|
|
|
|
|
No information here that I can help you with.
I would recommend putting a breakpoint in the addButton function and debugging the code.
Looks like addButton is failing to return a valid pointer.
|
|
|
|
|
If I hover over m_pBackButton during debugging, it has this value :0x0516b488.
|
|
|
|
|
If you put a breakpoint at draw() are you able to step into it?
|
|
|
|
|
If I press F10 0r F11, it just goes to the next line not to the draw() function definition.
|
|
|
|
|
Are you debugging the Release mode?
Otherwise make sure to disable optimization in Project -> Properties -> Configuration Properties -> C/C++ -> Optimization -> Optimization .
|
|
|
|
|
Did u mean Full optimization i.e /Od? There's no Optimization in this Project -> Properties -> Configuration Properties -> C/C++ -> Optimization ->
If I set this, I got the following error:
Command line error D8016 : '/Ox' and '/RTC1' command-line options are incompatible
|
|
|
|
|
I meant optimization should be /Od.
If optimization is disabled and you're in debug mode, you should be able to step into the draw function by pressing F11 unless the draw function is in another DLL or library.
|
|
|
|
|
I'm in debug only. I misunderstood ur prev. post. It's Irrlicht Engine's function. I can't step into this by pressing F11. If I press F11, control moves to the next line. It's a virtual function and is defined in a file called IGUIElement.h like this:
virtual void draw()
{
if ( isVisible() )
{
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
(*it)->draw();
}
}
|
|
|
|
|
Is this the final version?
I mean have you overloaded it?
You could put a breakpoint inside this function and try to debug.
|
|
|
|
|
Not overloaded. I'm calling it with a derived class's object. All the Buttons and other elements are derived from IGUIElement.
|
|
|
|
|
T.RATHA KRISHNAN wrote: When running my application, it suddenly crashes and goes to this line:
You always forget to supply important information while asking a question. A really important information in this case is the exact error message. What does it say exactly ?
|
|
|
|
|
Is it possible you've deleted your pointer elsewhere? If so, NULL your pointer every time you delete it, so you can find this bug more easily.
Or the function that created the pointer did it badly, and returned a pointer to a stack variable. If so, it might work for a while, until the memory got re-used...
The 0x4ea5608 looks like a legitimate pointer value - so it was probably correct, even if only briefly.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Hi,
The data located at your m_pBackButton pointer address is the magic number 0xFEEEFEEE which is used by the MSVC debug heap and this would imply that your m_pBackButton has been deleted.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello,
I am getting this error :
0x80040111 ClassFactory cannot supply requested class
I already done regsvr32 for the C++ ATL dll file.
When I check the registry, I can find the entry at HKEY_CLASSES_ROOT\CLSID.
InProcServer32 has the dll path as the default while threading model is Apartment.
I verified that there are entries in regedit for :
- clsid
- typelib
- event
- interface.
I called the CoInitialize as below :
HRESULT hr_init = ::CoInitialize(NULL);
if (FAILED(hr_init))
{
return E_FAIL;
}
HRESULT hr_init2 = m_spIEventFiringObject.CreateInstance(__uuidof(EventFiringObject_OD));
if (FAILED(hr_init2))
{
return E_FAIL;
}
m_pIEventFiringObjectEventHandler = new IEventFiringObjectEventHandler(*this, m_spIEventFiringObject, &CManualTest::OnEventFiringObjectInvoke);
When I run debug, CWinApp::InitInstance() was successful.
It fails at _AtlModule.DllGetClassObject(rclsid, riid, ppv);
When I run the client software, it fails with ClassFactory cannot supply requested class error.
Your guidance on solving this problem is very much appreciated.
Thanks,
Goutam
|
|
|
|
|
How is m_spIEventFiringObject declared?
Did you do #import to instantiate the COM component?
|
|
|
|
|
Thank you for trying to help.
This is the declaration :
IEventFiringObject_ODPtr m_spIEventFiringObject;
This is from the tlh file (which shows declaration of IEventFiringObject_ODPtr) :
_COM_SMARTPTR_TYPEDEF(IEventFiringObject_OD, __uuidof(IEventFiringObject_OD));
The StdAfx.h contains :
#import "D:\Project\ODepth\ODepth\Debug\ODepth.dll"
using namespace ODepthLib;
I am using below project as sample/template file :
Understanding COM Event Handling[^]
I just made some changes to make sure my program does not clash with the sample file.
The sample file works fine, while my program errs.
|
|
|
|
|
Is there any other information I need to provide?
|
|
|
|
|
ggoutam7 wrote: Is there any other information I need to provide?
Hi,
The value of the HRESULT will tell you more information about why CreateInstance failed.
Best Wishes,
-David Delaune
|
|
|
|
|
HRESULT for CreateInstance has the value of :
0x80040111 ClassFactory cannot supply requested class
Can you please guide me on how to fix this 0x80040111 ClassFactory cannot supply requested class error?
|
|
|
|
|
hello guys....well im not master on reading the msdn documentation. Can you plz tell me how to find the right topic(i mean, where it is located)...am i the only one in this universe to ask this question??
|
|
|
|