Click here to Skip to main content
14,866,950 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Version of a console application Pin
_Flaviu23-Apr-21 1:29
Member_Flaviu23-Apr-21 1:29 
QuestionRe: Version of a console application Pin
CPallini16-Apr-21 8:01
mveCPallini16-Apr-21 8:01 
AnswerRe: Version of a console application Pin
_Flaviu23-Apr-21 1:28
Member_Flaviu23-Apr-21 1:28 
AnswerRe: Version of a console application Pin
Mircea Neacsu16-Apr-21 23:11
mvaMircea Neacsu16-Apr-21 23:11 
GeneralDLL with a callback Pin
Bodo240715-Apr-21 6:05
MemberBodo240715-Apr-21 6:05 
GeneralRe: DLL with a callback Pin
Richard MacCutchan15-Apr-21 6:27
mveRichard MacCutchan15-Apr-21 6:27 
GeneralRe: DLL with a callback Pin
Bodo240715-Apr-21 6:41
MemberBodo240715-Apr-21 6:41 
GeneralRe: DLL with a callback Pin
Richard MacCutchan15-Apr-21 6:55
mveRichard MacCutchan15-Apr-21 6:55 
Bodo2407 wrote:
I don't understand why it behaves that way.
It behaves that way because that is the way you have written the code.

1. So you need to change the code in public_func_taking_callback as follows:
C++
__declspec(dllexport) void public_func_taking_callback(callback_t evHnd)
{
 //   evHnd(333);//value just for testing // this was causing your problem
    callback_t = evHnd; // save the callback address for funcA.
}

And you need to change funcA to:
C++
if(a>10)                       //trigger the event in the main application
    callback_t(a);   // the callback is set to invoke void __stdcall CallB(unsigned int halfbeast)

Again, make these changes and then step through the code in the debugger to check that it is correct.
GeneralRe: DLL with a callback Pin
Bodo240715-Apr-21 7:33
MemberBodo240715-Apr-21 7:33 
GeneralRe: DLL with a callback Pin
CPallini15-Apr-21 20:51
mveCPallini15-Apr-21 20:51 
GeneralRe: DLL with a callback Pin
Richard MacCutchan15-Apr-21 22:44
mveRichard MacCutchan15-Apr-21 22:44 
PraiseRe: DLL with a callback Pin
Bodo240715-Apr-21 23:04
MemberBodo240715-Apr-21 23:04 
GeneralRe: DLL with a callback Pin
CPallini15-Apr-21 23:24
mveCPallini15-Apr-21 23:24 
GeneralRe: DLL with a callback Pin
Richard MacCutchan16-Apr-21 0:17
mveRichard MacCutchan16-Apr-21 0:17 
GeneralRe: DLL with a callback Pin
Bodo240716-Apr-21 3:47
MemberBodo240716-Apr-21 3:47 
GeneralRe: DLL with a callback Pin
Richard MacCutchan16-Apr-21 4:33
mveRichard MacCutchan16-Apr-21 4:33 
GeneralRe: DLL with a callback Pin
Bodo240716-Apr-21 4:46
MemberBodo240716-Apr-21 4:46 
GeneralRe: DLL with a callback Pin
Richard MacCutchan16-Apr-21 5:32
mveRichard MacCutchan16-Apr-21 5:32 
Questionmac desing: Pin
prasad 202114-Apr-21 23:09
Memberprasad 202114-Apr-21 23:09 
AnswerRe: mac desing: Pin
Richard MacCutchan14-Apr-21 23:12
mveRichard MacCutchan14-Apr-21 23:12 
AnswerRe: mac desing: Pin
Dave Kreskowiak15-Apr-21 4:35
mveDave Kreskowiak15-Apr-21 4:35 
AnswerRe: mac desing: Pin
David Crow15-Apr-21 5:39
MemberDavid Crow15-Apr-21 5:39 
QuestionEACCES when not running under VS debugger Pin
ForNow11-Apr-21 10:10
MemberForNow11-Apr-21 10:10 
AnswerRe: EACCES when not running under VS debugger Pin
Richard MacCutchan11-Apr-21 21:27
mveRichard MacCutchan11-Apr-21 21:27 
GeneralRe: EACCES when not running under VS debugger Pin
ForNow12-Apr-21 1:34
MemberForNow12-Apr-21 1:34 

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.