Make a Findscu dll

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Aaron1
Posts: 24
Joined: Tue, 2005-11-01, 08:55
Location: China xi'an

Make a Findscu dll

#1 Post by Aaron1 »

Hello!
I want make a findscu dll based on DCMTK using MS VC6.0, I coded my program as findscu tool in DCMTK, but when testing my findscu dll, a Debug Error appeared:

"Debug Error!
Program E:\dcmSearch.exe
Module:
File: i386\chkesp.c
Line: 42

The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.”

I declared the dll export function like this:
int WINAPI dcmFindScu(const SearchObject searchObject,TagObject *resultList,char *logFile)
{
int argc=15;
char *argv[15];
//findscu -v -P -aec BSSERVER -k 0008,0052="PATIENT" -k 0010,0020= -k 0010,0010= -k 0010,0040= 127.0.0.1 104
argv[1]="-v";
argv[2]="-P";
argv[3]="-aec";
argv[4]="BSSERVER";
argv[5]="-k";
argv[6]="0008,0052=\"PATIENT\"";
argv[7]="-k";
argv[8]="0010,0020=";
argv[9]="-k";
argv[10]="0010,0010=";
argv[11]="-k";
argv[12]="0010,0040=";
argv[13]="127.0.0.1";
argv[14]="104";

T_ASC_Network *net;
T_ASC_Parameters *params;
const char *opt_peer;
OFCmdUnsignedInt opt_port = 104;
DIC_NODENAME localHost;
DIC_NODENAME peerHost;
T_ASC_Association *assoc;
const char *opt_peerTitle = PEERAPPLICATIONTITLE;
const char *opt_ourTitle = APPLICATIONTITLE;
OFList<OFString> fileNameList;
OFBool opt_secureConnection = OFFalse; /* default: no secure connection */
…………………
}

In the testing application, I declared the function with same calling convention.
I debugged my findscu dll, found error appeared in the function
static void addOverrideKey(OFConsoleApplication& app, const char* s),
when running into line (covered by ****):
if (overrideKeys == NULL) overrideKeys = new DcmDataset;
****if (overrideKeys->insert(elem, OFTrue).bad())**** {
sprintf(msg2, "cannot insert tag: (%04x,%04x)", g, e);
app.printError(msg2);
the debug error will appear.

Waiting for helps!!!

Best regards

Post Reply

Who is online

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