Click here to Skip to main content
15,911,030 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questionget SafeArray data...... Pin
vijay.victory1-Feb-09 20:06
vijay.victory1-Feb-09 20:06 
AnswerRe: get SafeArray data...... Pin
Jonathan Davies1-Feb-09 23:44
Jonathan Davies1-Feb-09 23:44 
GeneralRe: get SafeArray data...... Pin
vijay.victory2-Feb-09 18:32
vijay.victory2-Feb-09 18:32 
GeneralRe: get SafeArray data...... Pin
Jonathan Davies2-Feb-09 23:21
Jonathan Davies2-Feb-09 23:21 
QuestionProblem in Registerign COM Add-In Pin
SNI29-Jan-09 22:12
SNI29-Jan-09 22:12 
AnswerRe: Problem in Registerign COM Add-In Pin
«_Superman_»1-Feb-09 1:02
professional«_Superman_»1-Feb-09 1:02 
QuestionATL Add-In and MFC DLL communication problem? Pin
SNI23-Jan-09 1:50
SNI23-Jan-09 1:50 
AnswerRe: ATL Add-In and MFC DLL communication problem? Pin
Roger Stoltz23-Jan-09 6:07
Roger Stoltz23-Jan-09 6:07 
SNI wrote:
But when i am trying to call this Interface from member function of the same DLL it is giving "-2147417843" error.


This error is a COM related error.
The description is this:
"An outgoing call cannot be made since the application is dispatching an input-synchronous call."

I'm not able to follow your explanation of how the different modules are connected, in what process the DLL is located, what calls are made from where to what and in what order.
And what do you really mean by "callback"?
Is it a COM event sink or what? I suspect it is.

However, I'm quite familiar with the error you've got.
It means that you are making a call to a COM server that resides in another apartment and that COM server wants to call you back in the same call chain.
This is not allowed since it would generate a deadlock.
I suppose you've heard that COM threads always have to process messages, at least the ones that create COM objects.... The reason is that when you make a call from one apartment to another, the call will generate a message that is sent from the calling apartment (the proxy) to the called apartment (the stub). When the call has been processed a message is sent back that the calling apartment is waiting for. During that time the calling apartment is not available for incoming COM calls and thus the COM library generates an error if you're attempting to do it.
This is the same problem you'll get if you're sending a message to another thread with ::SendMessage() instead of ::PostMessage(); if the receiving thread does not process messages you'll get a nice little deadlock.


SNI wrote:
Please suggest is there any possiblity to call CallBack / Interface implemented in ATL (EXE server) component from DLL.


I strongly recommend that you re-evaluate your design in a way that you don't make an outgoing call from the called interface function. You could post a message inside the server with the information needed.

There is another solution.
It will probably make your project increase in complexity ten fold at least, but you could make the servers free-threaded and let effected threads live in the multithreaded apartment of the process.
It's possible, but don't say I didn't warn you.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: ATL Add-In and MFC DLL communication problem? Pin
SNI29-Jan-09 2:12
SNI29-Jan-09 2:12 
GeneralRe: ATL Add-In and MFC DLL communication problem? Pin
Roger Stoltz29-Jan-09 3:14
Roger Stoltz29-Jan-09 3:14 
GeneralRe: ATL Add-In and MFC DLL communication problem? Pin
SNI30-Jan-09 2:16
SNI30-Jan-09 2:16 
GeneralRe: ATL Add-In and MFC DLL communication problem? Pin
SNI20-Feb-09 0:26
SNI20-Feb-09 0:26 
QuestionHow to deal with "Currently ATL objects may only be added to ATL projects, or certain types of MFC projects (EXE, Control, Regular DLL)."? Pin
huangdingjun21-Jan-09 14:51
huangdingjun21-Jan-09 14:51 
AnswerRe: How to deal with "Currently ATL objects may only be added to ATL projects, or certain types of MFC projects (EXE, Control, Regular DLL)."? Pin
Stuart Dootson21-Jan-09 21:26
professionalStuart Dootson21-Jan-09 21:26 
Questionneed help with wtl 8 owner drawn controls Pin
Babil_JR21-Jan-09 5:25
Babil_JR21-Jan-09 5:25 
AnswerRe: need help with wtl 8 owner drawn controls Pin
Stuart Dootson21-Jan-09 6:26
professionalStuart Dootson21-Jan-09 6:26 
Questionexports enum from COM Pin
vijay.victory20-Jan-09 22:13
vijay.victory20-Jan-09 22:13 
AnswerRe: exports enum from COM Pin
Jonathan Davies21-Jan-09 0:05
Jonathan Davies21-Jan-09 0:05 
GeneralRe: exports enum from COM Pin
Jonathan Davies21-Jan-09 0:28
Jonathan Davies21-Jan-09 0:28 
GeneralRe: exports enum from COM Pin
vijay.victory21-Jan-09 2:26
vijay.victory21-Jan-09 2:26 
AnswerRe: exports enum from COM Pin
Stuart Dootson21-Jan-09 0:07
professionalStuart Dootson21-Jan-09 0:07 
QuestionCAtlHttpClient Pin
TURK18-Jan-09 7:08
TURK18-Jan-09 7:08 
AnswerRe: CAtlHttpClient Pin
Stuart Dootson18-Jan-09 7:37
professionalStuart Dootson18-Jan-09 7:37 
GeneralRe: CAtlHttpClient Pin
TURK18-Jan-09 8:16
TURK18-Jan-09 8:16 
GeneralRe: CAtlHttpClient Pin
Stuart Dootson18-Jan-09 8:27
professionalStuart Dootson18-Jan-09 8:27 

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.