Click here to Skip to main content
15,915,975 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: the different between "WM_GETTEXT" and GetWindowText() Pin
David Crow28-Apr-06 2:30
David Crow28-Apr-06 2:30 
Questionminimize icon display Pin
WillTian27-Apr-06 23:26
WillTian27-Apr-06 23:26 
AnswerRe: minimize icon display Pin
Russell'27-Apr-06 23:56
Russell'27-Apr-06 23:56 
GeneralRe: minimize icon display Pin
WillTian28-Apr-06 15:07
WillTian28-Apr-06 15:07 
Questionhow to monitor the network Pin
zt978827-Apr-06 23:19
zt978827-Apr-06 23:19 
QuestionVideo Mixing??? Pin
jeykumars27-Apr-06 23:04
jeykumars27-Apr-06 23:04 
AnswerRe: Video Mixing??? Pin
Justin Tay28-Apr-06 2:51
Justin Tay28-Apr-06 2:51 
QuestionIdentifying OLE DB errors Pin
panzerdivisionmarkus27-Apr-06 22:35
panzerdivisionmarkus27-Apr-06 22:35 
Hi,
Hope someone can help me with this.

I want to identify a specific OLE DB error and display an error message that my users can understand.

The way it is displayed right now is like this:
Source:"Microsoft OLE DB Provider for SQL Server"
Description:"Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."
hr = 0x80040e14

The hr should be equal to DB_E_ERRORSINCOMMAND, but this error code is used for other errors as well.

How can I identify that it is the "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)" message that is displyed? I'd really like to change it to something that my users can understand. But I can't find anything to go on, please help me.

I've included my error messaging function.

void DisplayOLEDBErrorRecords(HRESULT hrErr) {
	CDBErrorInfo ErrorInfo;
	ULONG        cRecords;
	HRESULT      hr;
	ULONG        i;
	CComBSTR     bstrDesc, bstrHelpFile, bstrSource;
	GUID         guid;
	DWORD        dwHelpContext;
	WCHAR        wszGuid[40];
	USES_CONVERSION;

	LCID lcLocale = GetSystemDefaultLCID();

	hr = ErrorInfo.GetErrorRecords(&cRecords);
	if (FAILED(hr) && ErrorInfo.m_spErrorInfo == NULL) {
		OLEDBErrorMessageBox( "No OLE DB Error Information found: hr = 0x%x\n", hr);
		return;
	}

	for (i = 0; i < cRecords; i++) {
		hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, &dwHelpContext, &bstrHelpFile);
		if (FAILED(hr)) {
			OLEDBErrorMessageBox("OLE DB Error Record dump retrieval failed: hr = 0x%x\n", hr);
			return;
		}

		StringFromGUID2(guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR));
    
                OLEDBErrorMessageBox( "Source:\"%s\"\nDescription:\"%s\"\nhr = 0x%x\n\n", OLE2T(bstrSource), OLE2T(bstrDesc), hrErr);

		bstrSource.Empty();
		bstrDesc.Empty();
		bstrHelpFile.Empty();
	}
}

Questionhexadecimal to decimal-newbie Pin
antonaras_marcou27-Apr-06 21:49
antonaras_marcou27-Apr-06 21:49 
AnswerRe: hexadecimal to decimal-newbie Pin
Nibu babu thomas27-Apr-06 21:55
Nibu babu thomas27-Apr-06 21:55 
AnswerRe: hexadecimal to decimal-newbie Pin
Nishad S27-Apr-06 22:26
Nishad S27-Apr-06 22:26 
GeneralRe: hexadecimal to decimal-newbie Pin
antonaras_marcou27-Apr-06 22:36
antonaras_marcou27-Apr-06 22:36 
GeneralRe: hexadecimal to decimal-newbie Pin
Nishad S27-Apr-06 22:54
Nishad S27-Apr-06 22:54 
GeneralRe: hexadecimal to decimal-newbie Pin
Aryan S27-Apr-06 23:20
Aryan S27-Apr-06 23:20 
GeneralRe: hexadecimal to decimal-newbie Pin
Nishad S27-Apr-06 23:49
Nishad S27-Apr-06 23:49 
QuestionRe: hexadecimal to decimal-newbie Pin
Aryan S28-Apr-06 0:16
Aryan S28-Apr-06 0:16 
AnswerRe: hexadecimal to decimal-newbie Pin
Nishad S28-Apr-06 0:29
Nishad S28-Apr-06 0:29 
GeneralRe: hexadecimal to decimal-newbie Pin
Aryan S28-Apr-06 0:35
Aryan S28-Apr-06 0:35 
AnswerRe: hexadecimal to decimal-newbie Pin
Roger Stoltz28-Apr-06 2:30
Roger Stoltz28-Apr-06 2:30 
AnswerRe: hexadecimal to decimal-newbie Pin
David Crow28-Apr-06 2:32
David Crow28-Apr-06 2:32 
QuestionGraph Control in MFC Pin
QuickDeveloper27-Apr-06 21:28
QuickDeveloper27-Apr-06 21:28 
QuestionMDI Child Window + top most Pin
Sarvan AL27-Apr-06 21:14
Sarvan AL27-Apr-06 21:14 
AnswerRe: MDI Child Window + top most Pin
Nibu babu thomas27-Apr-06 21:15
Nibu babu thomas27-Apr-06 21:15 
GeneralRe: MDI Child Window + top most Pin
Sarvan AL27-Apr-06 21:35
Sarvan AL27-Apr-06 21:35 
GeneralRe: MDI Child Window + top most Pin
Nibu babu thomas27-Apr-06 21:39
Nibu babu thomas27-Apr-06 21:39 

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.