ProgressCallback find Problems

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

ProgressCallback find Problems

#1 Post by focus »

I have a class called PacsFind using this function to find the patients

DIMSE_findUser(assoc, presId, &req, mask,
progressCallback,NULL,
DIMSE_BLOCKING, 0,
&rsp, &statusDetail);

For every patients progresCallback is called,

void PacsFind::progressCallback(
void * /*callbackData*/ ,
T_DIMSE_C_FindRQ * /*request*/ ,
int responseCount,
T_DIMSE_C_FindRSP *rsp,
DcmDataset *responseIdentifiers
)

pogresCallback has to be a member class of PacsFind, because creates a list of patients, this list of patients is member of PacsFind Class, but when i try to compile appears the next error

error: argument of type `void (udg::PacsFind::)(void*, T_DIMSE_C_FindRQ*, int, T_DIMSE_C_FindRSP*, DcmDataset*)' does not match `void (*)(void*, T_DIMSE_C_FindRQ*, int, T_DIMSE_C_FindRSP*, DcmDataset*)'

The compiler doesn't allow me to call ProgressCallback as member function of PacsFind Class.
Is there any way that dcmtk returns automatic a list of patients? What I have thinked is that progresscallback inserts every patient in a list that i have created, but if ProgresCallback can't be a member of my class how I can create the list ? Or I'm calling ProgresCallback wrong ?

Thanks for your help in advancing!:)

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#2 Post by Thomas Wilkens »

See dcmwlm/libsrc/wlmactmg.cc at the very beginning (line 59 in our current CVS version of that file) for an example on how to declare a callback function (in this case: function "static void FindCallback(...)"). The callback function needs to be a global function and cannot be an element function of a class if a pointer to the function shall be passed somewhere as an argument.

This is the only way to do it.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest