|
When debugging an application select “Debug”->”Exceptions...”. The “Exceptions” dialog will appear. Select the exception type in the list and press the “Stop always” button then press "OK". When the exception is generated your debugger will break and you can view the call stack ("View"->"Debug Windows"->"Call Stack"). Remember to change things back when you’re done.
Steve
|
|
|
|
|
You can do some things:
- To aisle the code that makes that exception and try to solve it (I think that you've already tried that).
- To use TRY/CATCH (exception handling) in order to help you to find where it came from or to handle strange situations.
Also there is a nice feature in VC++6 (I'm still using that one) that I suppose that will also be in the newer IDE's: you can go back from the point in which the problem has raised using a combobox named context (it appears in the top of the listboxes that allow you to debug).
Hope this helps...
|
|
|
|
|
In the continue with Steve see this[^] if its helpfuls
|
|
|
|
|
HI Experts
How can i handle the return value of this function
inline iRDOStoresPtr IRDOSession::GetStores ( )
{
struct iRDOStores * _result = 0;
HRESULT _hr = get_Stores(&_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return iRDOStoresPtr(_result, false);
}
manu
|
|
|
|
|
Try this
iRDOStoresPtr pRDOStores = IRDOSession::GetStores()
but replace the "IRDOSession::" bit the name of your variable that represents the IRDOSession class/structure, e.g.
iRDOStoresPtr pRDOStores = mySessions.GetStores()
|
|
|
|
|
Dear all,
Anybody knows from where AfxWinMain gets the CWinApp global object pointer ?
When i looked the MFC source file (winmain.cpp) i can see the following lines.
nt AFXAPI AfxWinMain(..../*params*/)
{
int nReturnCode = -1;
CWinThread* pThread = AfxGetThread();
CWinApp* pApp = AfxGetApp();
}
Surely AfxGetApp() returns that global object. me again looked the AfxGetApp function , it is calling a AfxGetModuleState state function and this function returns the CWinApp object. AfxGetModuleState gets this value from CThreadLocal class's object.
My question is How MFC getting the pointer of my CWinApp derived class object.
Share your ideas please..
-- modified at 0:51 Friday 5th January, 2007
If u can Dream... U can do it
|
|
|
|
|
The following line is from CWinApp::CWinApp :
pModuleState->m_pCurrentWinApp = this;
That's how it gets the app.
Steve
|
|
|
|
|
Thanks Steve. .
If u can Dream... U can do it
|
|
|
|
|
I'm trying to add a new string value to HKEY_LOCAL_MACHINE Software\\Microsoft\\Windows\\CurrentVersion\\run\\. I'm trying to give users a choice if they want to have the program start up with computer. I'm having some difficulty programming this with C++. Im using VC 7.1 on a windows XP. Ps. Using console. Any help would be greatly appreciated. Thanks in advance.
|
|
|
|
|
You have a problem but what?
|
|
|
|
|
would it be possible for somebody to give me an example on how I would do this kind of registry editing?
|
|
|
|
|
|
arbster wrote: I'm having some difficulty programming this with C++. Im using VC 7.1 on a windows XP
What difficulty you are facing ?
|
|
|
|
|
to be honest i know what the functions exist but I'm having trouble implementing them. An example would help greatly.
|
|
|
|
|
arbster wrote: An example would help greatly.
This example would create a key named "arbster" under HKLM->System in the registry.
HKEY hKey;
DWORD dwMyVal;
if ( RegCreateKeyEx(HKEY_LOCAL_MACHINE,
_T("SYSTEM\\arbster"), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE,
NULL, &hKey, &dwMyVal) == ERROR_SUCCESS )
{
AfxMessageBox(_T("Key created successfully"));
}
else
AfxMessageBox(_T("Unable to create key"));
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Use RegOpenKeyEx() and open the key and then use RegSetValueEx() to write into it. You may also want to look into the documentation for CRegKey.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
what if the key does not exist (im trying to add a key). Will RegOpenKeyEx() still work or will i have to use RegCreateKey() ?
|
|
|
|
|
RegOpenKeyEx() is used to open an existing key. For adding a key, use RegCreateKey or RegCreateKeyEx(). Have a look at Registry Functions[^] in MSDN.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Just to add on, you probably want to create your registry entry under HKEY_CURRENT_USER instead, so that any changes will not affect other users accounts on that same machine.
<font=arial>Weiye Chen
Give me the Death Note, and I'll cleanse the world...
|
|
|
|
|
Take a look at this article, it's poorly written but the class is decent and works.
Adding your application to the Windows Startup[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
arbster wrote: +. Im using VC 7.1 on a windows XP. Ps. Using console. Any help would be greatly appreciated. Thanks in advance.
Try CRegkey , include <atlbase,h>
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
If we select GS option, what else we should do?
Is error handler a must?
What is the effect of selecting GS without having error handler?
Thanks & Regards,
Suman
|
|
|
|
|
This[^] link will help you.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Dear All,
How can i start my ATL Service program that is done by VC 6.0 as a Windows Service ?
Kindly Help me.
Thanks
-- modified at 0:08 Friday 5th January, 2007
Nice things do nice works
|
|
|
|
|
Hello Sakthiu,
First of all you must register that service.
Then, once it is registered, you can go to the [start menu]->[Setup]->[administrative tools]->[Services] and start the desired service.
You can find information here in the CP in order to register a service.
Hope this helps.
|
|
|
|