|
Is it[^] helpful?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
try with MSXML2......and if not works then mention the line where you are getting the error
Thanks A Ton
Ash_VCPP
|
|
|
|
|
I have used MSXML2 then also I am getting same errors.
I am using Visual Studio 2006.
|
|
|
|
|
Actually this code works under .net platform but its doubtful with one you are using.....i worked for quite a while with xml parsing but did not get this.....if i find anything i will let you know....just do googling....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
You should prefix
IXMLDOMDocumentPtr with your defined namespace MSXML
like :
MSXML::IXMLDOMDocumentPtr
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
thanks for your reply.Now errors are not coming.
|
|
|
|
|
Did you forget to mark my reply as "Good Answer"? . Anyway never mind
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hi All
How can i identify root is file or folder?I have a String Path="C:\\Tets\\tr.txt" and String Path1="C:\\abc.txt".How can i identify Path root is Folder and Path1 root is File.Plz help me
|
|
|
|
|
Im not sure its your answer or no do you need to CString::Mid or CString::Right?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i use find ,mid and Right.But i need to check only root is Folder or Not?
|
|
|
|
|
See WIN32_FIND_DATA and use FILE_ATTRIBUTE_DIRECTORY, FILE_ATTRIBUTE_NORMAL etc
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
As you reply i use this code.
CFileFind finder;
BOOL bWorking = finder.FindFile(_T(Path));
while (bWorking)
{
bWorking = finder.FindNextFile();
if (finder.MatchesMask(FILE_ATTRIBUTE_HIDDEN |
FILE_ATTRIBUTE_SYSTEM))
{
_tprintf_s(_T("%s\n"), (LPCTSTR) finder.GetFileName());
}
}
Path="C:\\Test\\abc.txt" or Path="C:\\tets.txt".In the both case currsor enter in while loop.But I need to check String have only file or Files/Folder Both.
Plz help me
|
|
|
|
|
If the path is always the absolute path, why not check if \\ occurs more that once.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
can you give me some dummy code?
CFileOperation fo;
CString string1;
finalString=strFileName;
char * szMyString = (char *)(LPCTSTR)finalString;
CString string = _T(szMyString);
int nPosp = strFileName1.Find( _T("\\Windows"));
if( nPosp >= 0)
{
CString DirPath21 = strFileName1.Mid( 0, nPosp +1 );
return;
}
int nPosp1 = strFileName1.Find( _T("\\Backup"));
if( nPosp1 >= 0)
{
CString DirPath211 = strFileName1.Mid( 0, nPosp1 +1 );
return;
}
int nPosp2 = strFileName1.Find( _T("\\Users"));
if( nPosp2 >= 0)
{
CString DirPath212 = strFileName1.Mid( 0, nPosp2 +1 );
return;
}
CString DirPath121;
int nPos = string.Find( _T('\\') ,3);
if( nPos >= 3)
{
DirPath121 = string.Mid( 0, nPos );
LPCSTR pF1=DirPath121;
LPCSTR pT1="c:\\Backup";
if (!fo.Copy(pF1,pT1));
}
else
{
string1=string;
string1 +='\0';
if(string1=="")
{
}
int nLen = string1.GetLength();
LPCSTR lpszBuf = string1.GetBuffer(nLen);
string1.ReleaseBuffer();
LPCSTR pF=lpszBuf;
LPCSTR pT="c:\\Backup";
if (!fo.Copy(pF,pT));
}
modified on Wednesday, March 18, 2009 8:39 AM
|
|
|
|
|
if (strchr(string, '\\') != strrchr(string, '\\'))
root is folder.
else
root is file.
Here i'm checking if the first instance of '\\' is equal to the last instance of '\\'.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
You might be searching for PathIsRoot API...
- ns ami -
|
|
|
|
|
Have you checked out _splitpath() ? The dir argument will contain "\tets\" for the former and "\" for the latter.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi ,
Can you please tell me how shuold i check compiler setting in visual studio 20005.
Thanks,
|
|
|
|
|
by going to Project->Properties, if you are looking for compiler setting for your specific project
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
modified on Friday, March 6, 2009 6:26 AM
|
|
|
|
|
Is this your question? "Tools->Option"
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
I want to Parse a Command line Argument of the format
Application -d<filename><filesize> -r <fiename> <no of="" files="">
where application name is application name, <filename> and <filesize> are optional arguments for -d and similiar is the case od -r.
I m using getopt() for parsing, but I am not able to get the third argument of -d.
Can you please help me.
Its urgent..!
Thanks in advance,
Purusottam Mishra
Purusottam Mishra
Systems Executive
|
|
|
|
|
- What has your question to do with
Visual C++/MFC ? Raj-Ekoham DwitiyoNasti wrote: I m using getopt() for parsing, but I am not able to get the third argument of -d.
Raj-Ekoham DwitiyoNasti wrote: Its urgent..!
This makes your question automatically falling down to the bottom of the stack.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Although this has nothing to do with MFC,this is completely related to C++(GNU Compiler).
Purusottam Mishra
Systems Executive
|
|
|
|
|
Could you please elaborate a bit your question (for instance make an example)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if I am to Parse a Command line of type:
MyApplication [-v] [-i [filename] | -c [filename] [(-s e|c|v ) | ( -m c|V|v num_passes ) | (-r read:write ratio number_of cycles ) | -id ] [ -d devicenumber] [-o filename]
I m parsing it like:
int main(int argc,char* argv[])
{
char *options,*value;
while(int Opt = getopt(argc,argv,"s ::v:")!=-1)
{
switch(Opt)
{
case 'v':
//Do Something
break;
case 'm':
options = optarg;
while(*options != '\0')
{
switch(getsubopt(&options,&myopts,&value))
{
case 'r' :
cout<<optarg<<endl;
break;
case 'p' :
cout<<optarg<<endl;
break;
}
++optind;
}
break;
}
}
}
then suppose I give the command Like:
My Application -m v 5
Then I should Be able to retrieve 'v' Value and the value 5(Please refer to Comand Line format above).
Thanks agai for ur quick reply.
Purusottam Mishra
Systems Executive
|
|
|
|