|
A callback function is a user defined function that a generic API function can use (call back) to do non generic work.
For example, when you have a collection (array, vector, list) of use defined data (struct or class), you want to be able to sort that collection depending on a user defined criteria, you will use the default sorting API, and give that default sorting function a pointer to a callback function that will actually do the comparison between the member of the struct/class.
Another example, is when working with threads; there are multiple generic API to create and manage threads, but all of them needs a callback function; that function will be the actual code that will be run (or a starting point to) by the different threads.
Good luck.
Max.
Nihil obstat
|
|
|
|
|
|
Now I have the crash info:
TestAPP caused an Access Violation (0xc0000005)
in module XCrashReportTest.exe at 0023:5763c230.
Context:
EDI: 0x002aee0c ESI: 0x002ad7f4 EAX: 0x00000000
EBX: 0x00000000 ECX: 0x57635670 EDX: 0x028c1d27
EIP: 0x5763c230 EBP: 0x002aee18 SegCs: 0x00000023
EFlags: 0x00010246 ESP: 0x002ad554 SegSs: 0x0000002b
Bytes at CS:EIP:
8b 08 52 50 8b 41 18 ff d0 8b 0d c8 e0 66 57 8b
Stack:
0x002ad554: 576504f7 002aee0c 002ad7f4 002ad570 ..eW..*...*.p.*.
0x002ad564: 002aee0c 5763c201 002aee18 002ad59c ..*...cW..*...*.
0x002ad574: 576490b1 5763c201 002aee0c 00000100 ..dW..cW..*.....
0x002ad584: 002ad5f4 57648d9f 75785eaa 57668e70 ..*...dW.^xup.fW
0x002ad594: 002aee0c 00000001 002ad604 5764d4d2 ..*.......*...dW
0x002ad5a4: 002aee0c 57668e70 5763c201 00000000 ..*.p.fW..cW....
0x002ad5b4: 00000100 75785d2a 57668e5c 002aee0c ....*]xu\.fW..*.
0x002ad5c4: 57668e4c 002add84 00000000 00000000 L.fW..*.........
I refer to XCrashReport[XCrashReport : Exception Handling and Crash Reporting - Part 1
But I find that sometimes the EIP differed when I run the same *.exe in the same machine. So, sometimes I can't match the crash line of code with EIP(the methods descriped in XCrashReport : Exception Handling and Crash Reporting - Part 1. I don't know how to use the stack info.
Anyone can help me?
|
|
|
|
|
Try running your program through the debugger and look at the stack trace at the point of failure. This will usually help you to narrow the search to the actual function causing the crash.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi, all. I need anything program or game on C++ Builder 6 with graphic interface, which was realized with Pattern Abstract Factory.
|
|
|
|
|
People here do not hand out completed projects. If you're having trouble with something specific, ask a question and someone will try to help you.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I need to enable re-sizing window without using WS_THICKFRAME style to avoid the thick border.
|
|
|
|
|
Have you experimented with WS_EX_PALETTEWINDOW or WS_EX_TOOLWINDOW ?
Extended Window Styles[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes.. but it didn't work.
|
|
|
|
|
Use Spy++ to see what message is sent when you click the window frame.
Here is a related topic.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi Team,
I have create modeless dialog, which contain Edit Box, and put it in Excel.
The problem is every time I enter a text to my edit, the text disappear in Edit Box instead it show in a active cell in Excel.
Does someone has any suggestion?
Below is a code snipped
<pre lang="c++">BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_COMMAND:
break;
case WM_GETDLGCODE:
return TRUE;
case WM_SETFOCUS:
return TRUE;
case WM_KILLFOCUS:
return TRUE;
default:
return FALSE;
}
return TRUE;
}
void CWPFInDialog::CreateMyDialog(HWND a_hwnd)
{
m_dialogHwnd = CreateDialog(g_hinstDLL, MAKEINTRESOURCE(IDD_DIALOGHOST), a_hwnd, ToolDlgProc);
if(m_dialogHwnd == NULL)
{
ShowWindow(m_dialogHwnd, SW_SHOW);
}
}
Thanks,
PS
|
|
|
|
|
if(m_dialogHwnd == NULL)
{
ShowWindow(m_dialogHwnd, SW_SHOW);
}
Are you sure about this?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Sorry for the typo
It should be
if(m_dialogHwnd != NULL)
{
ShowWindow(m_dialogHwnd, SW_SHOW);
}
|
|
|
|
|
Given the amount of code you have shown it's anyone's guess what may be happening. However, I did notice that your return value for the WM_GETDLGCODE[^] message is not one of the valid options.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
This is full class definition of creating dialog.
This class is an export class.
header file
#pragma once
#include "WPFInDialogDefs.h"
#include "WPFWrapper.h"
class WPFINDIALOG_API CWPFInDialog {
public:
CWPFInDialog(void);
void CreateMyDialog(HWND a_hwnd);
private:
HWND m_dialogHwnd;
CWPFWrapper m_wrapper;
};
cpp file
#include "stdafx.h"
#include "WPFInDialog.h"
#include "resource.h"
extern HINSTANCE g_hinstDLL;
CWPFInDialog::CWPFInDialog()
{
}
BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_COMMAND:
break;
default:
return FALSE;
}
return TRUE;
}
void CWPFInDialog::CreateMyDialog(HWND a_hwnd)
{
m_dialogHwnd = CreateDialog(g_hinstDLL, MAKEINTRESOURCE(IDD_DIALOGHOST), a_hwnd, ToolDlgProc);
if(m_dialogHwnd != NULL)
{
ShowWindow(m_dialogHwnd, SW_SHOW);
}
}
To create the the dialog, I just
CWPFInDialog* l_atsWrapper = new CWPFInDialog();
l_atsWrapper->CreateMyDialog(l_hwndExcel);
l_hwndExcel is an excel handle
to get the excel handle I call
CComPtr<Excel::_Application> l_excelApp;
HRESULT l_hr = g_excelMgrSingleton.GetExcelApplication(&l_excelApp);
HWND l_hwndExcel;
l_hr = l_excelApp->get_Hwnd((long*)&l_hwndExcel);
no clean up for l_atsWrapper
|
|
|
|
|
You may need to contact the provider of this class, or check its documentation. I can find no information about it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard MacCutchan wrote: However, I did notice that your return value for the WM_GETDLGCODE[^] message is not one of the valid options. While DLGC_WANTARROWS is a valid return code, I'm not sure it makes sense in this context.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi!
I got the following erros during compilation.
Error 2 error BK1506 : cannot open file '.\Compilations\PlugIn_Debug_Win32\PlugIn.sbr': No such file or directory BSCMAKE
Error 1 fatal error C1902: Program database manager mismatch; please check your installation d:\plugin\stdafx.cpp 1
The source is transferred from another machine. When I rebuild the code for the first time(I've not modified the code),it compiles fine.
But when I made changes to the code and recompile it shows the above two errors. Both machines have SP1 for VS2005. How to resolve the above two errors?
|
|
|
|
|
You probably did not only copied the source but also some output files.
Try a complete rebuild to overwrite the copied output files. If this does not help, delete all files except the source and project files and rebuild.
|
|
|
|
|
Jochen Arndt wrote:
delete all files except the source and project files and rebuild.
I deleted the Program Database (.pdb) file. By all files you mean what other files?
|
|
|
|
|
All generated output files (all files in the output directories; e.g. the Debug and Release sub-directories) and (optionally) project generated files in the project directory (.aps, .ncb, .suo).
|
|
|
|
|
I've deleted not only the mentioned file but also the folders like Debug and Release. But the error remains as such. Can you tell me the error is due to
Service Pack or redistributable? I forgot to mention the VS version. VS 2005 on both the machines.
|
|
|
|
|
It seems that you are not the only one (try to Google for the error). You have multiple versions or the wrong mspdb80.dll.
See this Visual Studio Forum post[^].
|
|
|
|
|
Deleting mspdb80.dll file didn't work. It seems a virus problem. Will a repair install of VS2005 work?
|
|
|
|
|
Did you check if there are multiple versions on your new system? If so, see the forum post messages. A repair install might help.
A virus is rather unlikely. But if you have one on the system, the best solution is a clean re-install of the whole system.
|
|
|
|