Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, October 25, 2010 3:01:44 AM(UTC)
samit1984

Groups: Registered
Posts: 33


SIR BELOW IS MY CODE FOR LOADING THE  DICOM FILE FROM COMMAND PROMPT BUT IS IS NOT ABLE TO DO  IT I GET THE FILE NAME AND PATH FROM COMMAND PROMPT

 

int main(int argc, char **argv)

{

if(argc < 2)

{

cout << "Wrong number of arguments: Usage : test123.exe input=<inp file> "<<endl;

cin.get();

return 0;

}

L_INT nRet;

LDicomDS *pDS;

pDICOMELEMENT pElement;

BITMAPHANDLE Bitmap;

pDS = new LDicomDS(NULL);

 

nRet = pDS->LoadDS((L_TCHAR*)argv[1], 0);     // WHY I CANT GET FILENAME AND PATH       LIKE     THIS   WAY.  WHAT IS THE OTHER WAY TO GET IT //

if(nRet != DICOM_SUCCESS)

{

wcout<<" image load of file ["<< argv[1] << "] failed with error code [" << nRet << "]" <<endl;

wcout<<argv[0]<<endl;

wcout<<argv[1]<<endl;

cin.get();

return nRet;

}

.

.

.

THANKS SAMIT

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, October 25, 2010 3:08:46 AM(UTC)
samit1984

Groups: Registered
Posts: 33


1)SIR I AM NOT ABLE TO LOAD THE FILE IT RETURN WITH A ERROR 3 BUT PATH IS CORRECT ONLY AND EVEN FILE NAME

2)BUT WHEN I GIVE COUT -- ARGV[1] IT STILL GIVE ME PROPER PATH AND FILE NAME  ..WHICH WHEN I  USE DICOMDATASET:LOAD(TEXT("PATH AND FILE NAME"),O) ITS WORK I DONT UNDERSTAND WHY

I WANT TO GET MY FILE NAME AND PATH FROM COMAND PROMPT (USING ARGV[1] AS FILE NAME AND PATH ) BECOUSE MY APPLICATION IS CONSOLE APPLICATION

THANK YOU SAMIT

 
#3 Posted : Monday, October 25, 2010 5:58:15 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I'm not sure what you exactly mean. You wrote that the path and filename are correct and when you use DicomDataset::Load() it works. Can you please give me more details about the problem?
 
#4 Posted : Monday, October 25, 2010 7:18:04 AM(UTC)
samit1984

Groups: Registered
Posts: 33


ok sir i will try to put it this way there is 2 way u load the dicom file
1) FIRST method
int main()
{
L_INT nRet;

LDicomDS *pDS;

pDS = new LDicomDS(NULL);

nRet = pDS->LoadDS(TEXT("C:\\DICOM\\EXAMPLE.DCM"), 0); //THIS IS WORKING BUT I WANT TO PASS FILE NAME AND PATH AS A ARGUMENT FROM COMMAND PROMPT SO I CHANGE THE CODE AS .
if(nRet != DICOM_SUCCESS)

return nRet;

}

2) SECOND method WHICH IS NOT WORKING
EXAMPLE WHEN I CALL EXE C:>TEST.EXE
SO THAT I CAN PASS FILENAME AS ARGUMENT FROM COMMAND PROMPT

int main(int argc, char **argv)

{

if(argc "LoadDS((L_TCHAR*)argv[1], 0); // WHY I CANT GET FILENAME AND PATH LIKE THIS WAY. WHAT IS THE OTHER WAY TO GET IT //

if(nRet != DICOM_SUCCESS)

{

wcout<<" image load of file ["<< argv[1] << "] failed with error code [" << nRet << "]" <<endl;

wcout<<argv[0]<<endl;

wcout<<argv[1]<<endl;



cin.get();

return nRet;

}

.

 
#5 Posted : Monday, October 25, 2010 7:23:30 AM(UTC)
samit1984

Groups: Registered
Posts: 33


nRet = pDS->LoadDS((L_TCHAR*)argv[1], 0);
 
#6 Posted : Tuesday, October 26, 2010 5:47:09 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

It might be that the strings you in your "argv" parameter are not Unicode and you're trying to use them with our Unicode functions.
If that's the problem, there are 2 ways to solve it:
1. Either do not use Unicode (do not #define UNICODE, _UNICODE, or FOR_UNICODE in your project).
2. Or find a way to pass real Unicode strings to our functions instead of casting an ANSI string as (L_TCHAR*)
 
#7 Posted : Wednesday, October 27, 2010 1:41:04 AM(UTC)
samit1984

Groups: Registered
Posts: 33


thank you sir

i just use your second option i convert ansi to unicode and use it it works

samit

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.111 seconds.