|
By seing the code, it looks like it is the name of the function. So, basically, you call the function and check the return for an error, if there is an error, you call ErrorExit and pass the function name.
|
|
|
|
|
Thanx for the reply .... I thought that would be the case, but had to make sure,
cause I was receiving the same error message the whole time
"The specified module could not be found : error code 126".
May it be that the function (name) can not be found, or why would I receive the same error
messages although I'm using different applications and methods? :confused: ?
-- modified at 4:06 Thursday 12th October, 2006
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
From where is this message ? And, no, it's not a problem that a 'function' cannot be found: if the function didn't exist, you'll get a compilation error (no declaration and no definition) or a linker error (a declaration exist but no definition). If you could explain from where this message is coming and give more details, then we might help you. But here, we don't have any information...
|
|
|
|
|
O.k, I'll try and explain again. So I call the function and send it a value of a function
that exists and is part of the same application. Then I let a error occur so that I can test the function and the output the messagebox will give me. As shown below.
<br />
wsprintf(szBuf,"%s failed with error %d: %s",lpszFunction, dw, lpMsgBuf); <br />
MessageBox(NULL, szBuf, "Error", MB_ICONHAND); <br />
And the output of the messagebox is:
<functionname> specified module could not be found : error code 126
But the error I caused, as mentioned earlier, was something like this:
<br />
bool a = true;<br />
printf("Value of a %s :",a);<br />
Makes sense??
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
First, please don't use the pre tag to format simple text, it screws the look of your message (need to use the scroll bar to read your message). Pre is used to post code that is quite long.
Programm3r wrote: Then I let a error occur so that I can test the function and the output the messagebox will give me
Which error ? How do you provoke this error ? How do you call the function ? Please post some code because it is totally unclear what you are doing.
Programm3r wrote: bool a = true;
printf("Value of a %s :",a);
This won't set any value for the GetLastError function... It's just a bug but this won't change the return of GetLastError. Some functions only will save an error code that can be retrieved by GetLastError and printf is not. If the function save the error, then it is explicitely stated in the documentation.
Here you are simply retrieving your previous error.
|
|
|
|
|
Huh?
Besides the problems Cédric mentioned...
You say this code...
wsprintf(szBuf,"%s failed with error %d: %s",lpszFunction, dw, lpMsgBuf);
MessageBox(NULL, szBuf, "Error", MB_ICONHAND);
...produced this in a message box:
specified module could not be found : error code 126
???
And what happened here:
bool a = true;
printf("Value of a %s :",a);
Isn't printf going to expect "a" to be a pointer to a character string?
That's not good
Mark
|
|
|
|
|
In my start-up i have a splash-screen which waits for 30 seconds and then the main application starts up.
Now i have to do this :--
Within this interval if any keyboard key is pressed i want to hide/close the splash-screeen and move to the application directly
I have implemented the splash-screen as :
BOOL CSplashWnd::ShowSplashScreen(UINT uTimeOut, UINT uBitmapID, CWnd* pParentWnd /*= NULL*/)
{
ASSERT(uTimeOut && uBitmapID);
if (!m_bShowSplashWnd || m_pSplashWnd != NULL) {
return FALSE;
}
// Allocate a new splash screen, and create the window.
m_pSplashWnd = new CSplashWnd;
if (!m_pSplashWnd->m_bitmap.LoadBitmap(uBitmapID)) {
return FALSE;
}
BITMAP bm;
m_pSplashWnd->m_bitmap.GetBitmap(&bm);
CString strWndClass = AfxRegisterWndClass(0,
AfxGetApp()->LoadStandardCursor(IDC_ARROW));
if (!m_pSplashWnd->CreateEx(0, strWndClass, NULL, WS_POPUP | WS_VISIBLE,
0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL))
{
TRACE0("Failed to create splash screen.\n");
delete m_pSplashWnd;
return FALSE;
}
// Center the window.
m_pSplashWnd->CenterWindow();
m_pSplashWnd->UpdateWindow();
// Set a timer to destroy the splash screen.
m_pSplashWnd->SetTimer(1, uTimeOut, NULL);
return TRUE;
}
where CSplashWnd is derived from CWnd
Can any body plz tell me how to do it?
|
|
|
|
|
Well one simple solution would be using WM_KEYDOWN message or OnKeyDown() in MFC which i hope you already know.
Another way out is to use Keyboard Hook. When the splash screen is created, create a keyboard hook and use a callback function to trap any(really any) key pressed. Destroy the Splash Screen window in the callback function. And also don't forget to unhook the Keyboard callback as soon as the splash screen is destroyed (important).
Refer to following functions in MSDN:
SetWindowsHookEx()
KeyboardProc()
UnhookWindowsHookEx()
|
|
|
|
|
Good morning
how can I add a bitmap into a button
|
|
|
|
|
Hi,
Hope this might help.
<a href="http://www.flounder.com/bitmapbutton.htm">http:
<a href="http://www.codeguru.com/cpp/controls/buttonctrl/bitmapbuttons/article.php/c5163/">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
first go to button properties and change the properties at the styles tab to
icon.
Then create a CButton variable for the IDC_BUTTON name
and then just use seticon()
|
|
|
|
|
See CButton::SetBitmap on MSDN it has an example.
|
|
|
|
|
How to send Trace message to file instead of debugger in Visual Studio 6.00?
ccp
|
|
|
|
|
Hi,
Hope this might help.
<a href="http://www.codeproject.com/debug/xytrace.asp?print=true">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
|
Did you search on the internet for this error but see here[^]
|
|
|
|
|
I am trying to recover my permanently deleted outlook mails through coding
I know that there are many software available in the market that can do so
But i want to do it through coding
I am able to import messages when they are present in inbox through code
but facing difficuly in recovering deleted messages
can anybody just help me in this
|
|
|
|
|
I dont think what you are looking for is going to be available in a ready algorithm . I think it involves specifics such as reading the disk and ascertaining that its a valid file .
I think you will need to analyze the structure of the file and then what is updated in the filesystem so that the file isnt visible and again restore it .
Try looking at some tools at sysinternals . You might find some tool that helps analyze this scenario .
Engineering is the effort !
|
|
|
|
|
Hi,
Please suggest a method to keep an array of smart pointers(IXMLDOMElementPtr) in an dynamic array.
Can we use any built-in collection classes for this purpose?
Please help by giving the best method.
Thanx in advance
|
|
|
|
|
STL vector
Engineering is the effort !
|
|
|
|
|
Actually, in general COM smart pointers can't be used in STL collections without adaption as they overide operator & .
Steve
|
|
|
|
|
So, any other solution?
How to adapt STL collections for keeping smart pointers.
|
|
|
|
|
In ATL you use the CAdapt class. Or you can use smart pointers that don't overload operator & . Another alternative would be to create or use collections that use similar techniques to Boost's addressof[^] template (or use it).
Steve
|
|
|
|
|
Hi guys,
I am developing a dialog based application and CListCtrl is one of its controls. I have selected the check box style for clistctrl. What i want is when user clicks a check box in ListCtrl, that row should be selected. When user selects another check box, selection should be on that row.
Please help me by giving some source code.
Thanks in Advance
Velayudhan
|
|
|
|
|
Use "SetSelectionMark" member function of CListCtrl class
|
|
|
|