|
Hello Aavesh
hey u r still there
the code which i gave u is working man.
just 2 weeks before I was doing same task.
|
|
|
|
|
hi dude...
i have open the file successfully.but what abt ur second function.
i'm not getting how to use it.what will be the Parameters will be passed at the calling.becoz i have to print the XML information on the Active Document what will be the steps.
please dude help me.
now i'm feeling relax that u r with me.i hope i will do it today.
Reply ASAP
Aavesh
Aavesh
|
|
|
|
|
Thank god ur file got opened (& I hope by using my method)
after opening the file u just need to pass the tag name
as u know xml file contains user defined tags
ex: if in ur xml file there is a tag as
<aavesh>Iam a programmer</aavesh>
what u want is to print "iam a programmer" into a cntrl (I hope iam right)
if yes then call 2nd method as
GetProperty (or is it GetElement)
ok
GetProperty(_T("aavesh"), bstr);
declare bstr as
CComBSTR bstr;
u'll get bstr = "iam a programmer"
then convert bstr to CString as
USES_CONVERSION;
CString strTemp = W2A(bstr);
now u can assign the strTemp value to ur ctrl using appropriate method.
ok
|
|
|
|
|
hi dude,
thanx i haven't tried it but it seems to me that now it should be done.
dude what is ur name i think u r indian.
its not necessary to tell ur name but its my feeling so i shared with u.
Let me implement it.
if it will work then surely i will tell to u.
moreover,i have to print the data in the Active Document.
if i'll face any new problem then i will knock ur gate.
byeeeeee
Aavesh
|
|
|
|
|
Yes u got it right Iam an INDIAN (proud to b an Indian )
oh My name is Shoaib.
but how do u got it that i may be an indian.
|
|
|
|
|
hi Shoaib
first of all tha for such a beautiful answer.
ya i got it that u r indain becoz dear im also a indian I also proud be an
INDIAN.
now u asked me how i got it?
in the way u wrote me answer, that's concern or amible style only indian have.
i have tried it.....its abt to complete.its giving only one error on conversion of CComBSTR to String.
but i will solve it.
ok tell me right now u r in India or abroad.
byeeeee
Aavesh
|
|
|
|
|
Congrats!!!
WOW the Indian letter writing style amazing isn't it ( u recognized me by that style, Iam really very happy to know that)
right now Iam in India, u???
where do u stay in india,
give me ur email id mine is
patel.shoaib@gmail.com
ok that conversion problem (No Problem) Best of luck
|
|
|
|
|
hi shoaib
its giving Blank MessageBox.Why??Actually for a test a have show the data into Message box.
i'm sending u a Relevant code(Not the Full Source Code ).u tell me where i'm wrong.
void CMainFrame::OnLoadxmlLoadxmlfile()
{
// TODO: Add your command handler code here
if(OpenXMLFile("E:\WorkingBigBoss\BigBossApp\books.xml"))
{
GetElement(_T("Username"), bstr); //Here User Name is Tag
USES_CONVERSION;
CString strTemp = W2A(bstr); //(CString)(bstr);
AfxMessageBox(strTemp);
}
}
please tell me Dude.
Aavesh
|
|
|
|
|
I think the GetElement method itself opens the file u just need to initialize the member var.
ex:
class YourClass
{
public:
CComBSTR m_bstrFileName;
IXMLDOMDocument* m_pIDomDoc;
OpenXmlFile(...);
GetElement(...)
.....
...
};
now u'll do following
USES_CONVERSION;
m_bstrFileName = "E:\WorkingBigBoss\BigBossApp\books.xml";
GetElement(_T("Username"), bstrVal);
CString strTemp = W2A(bstrVal);
AfxMessageBox(strTemp);
|
|
|
|
|
Ok dude My job timing is over now
iam going
I look forward for ur mail.
I hope u'll solve the problem now only.
bye see u tomorrow
|
|
|
|
|
hi dude
Gud Morning.
how r u?
i have already mailed u i hope u read it. yaar problem solve hi nahi ho rahi hai.jaisa aone kaha th maine waisa hi kiya.....lekin ek confusion hai..
ex:
class YourClass
{
public:
CComBSTR m_bstrFileName;
IXMLDOMDocument* m_pIDomDoc;
OpenXmlFile(...);
GetElement(...)
.....
...
};
now u'll do following
USES_CONVERSION;
m_bstrFileName = "E:\WorkingBigBoss\BigBossApp\books.xml";
GetElement(_T("Username"), bstrVal);
CString strTemp = W2A(bstrVal);
AfxMessageBox(strTemp);
maine is code ko use kiya aur m_bstrFileName aur bstrval ko CCombBStr declare kar diya....is code mein aapne openXMlFile ka function declare to kiya hai..lekin call nahi kiya hai..maine bhi aise hi kiya..ye jo m_bstrFile Name variable hai ye use kaise ho raha hai i mean ye second function se Link kaise ho raha hai.....i hope app meri problem ko samagh gaye ho gaye honge bro.
i'm seding u my updated code too:-
void CMainFrame::OnLoadxmlLoadxmlfile()
{
// TODO: Add your command handler code here
//if(OpenXMLFile("E:\WorkingBigBoss\BigBossApp\books.xml"))
//m_bstrFileName = "E:\WorkingBigBoss\BigBossApp\books.xml";
USES_CONVERSION;
CComBSTR m_bstrFileName;
m_bstrFileName = "E:\WorkingBigBoss\BigBossApp\books.xml";
//OpenXMLFile(m_bstrFileName);
if(GetElement(_T("Username"), bstr))
{
CString strTemp = W2A(bstr);
AfxMessageBox(strTemp);
}
jab main ise run karat hun to ye Run time error deta hai..i don't know why??
i 'll wait for ur reply
gud day
Aavesh
Aavesh
|
|
|
|
|
Hello
ya I got ur mail
yesterday u said that u r getting empty message box.
I think there was some problem in W2A.
ok hv u checked ur mail
i have send u a sample application.
check it out
now this must work for u
good luck
|
|
|
|
|
hi dude
first of all thanx for ur concern that u have took pain for me.
boss ur knowledge is realy nice.u know now its working.i updated code in my project which u hav snd to me but when i give the path of XML File which is(c:\\file.xml) it show the value in box.but when i use my XML File books.xml it shows me blank box.Why? My File is also in C:\\books.xml.
wierd!!!!!!!!!!!!
dude could u tell me when i use ur file with some path let say..
"E:\WorkingBigBoss\BigBossApp\file.xml." it don't work.yaar what is the funda behind to put the xml file in c: drive cann't we give some path.
thanx once again
i'll wait for ur reply......
byeeeeee
gud day.
Aavesh
|
|
|
|
|
It's not that it'll work only if the xml file is in c:\ if u r copying it in some other folder then u should change the file path u may hav observed that in the sample application which i gave u OnFileNew event handler (in MainFram)
change bstrFileName as
bstrFileName = "E:\WorkingBigBoss\BigBossApp\file.xml"
make sure that u put double slashes here as
"E:\\WorkingBigBoss\\BigBossApp\\file.xml"
also see my xml file, copy the very first line of my file into urs
the line iam talking abt is
<?xml version="1.0"?>
I want u to read xml tutorial given on
www.w3schools.com
|
|
|
|
|
WHat man still STUCKED ???
|
|
|
|
|
hi shoiab
i put the double slash in pah.now its able to read from my folder.it is reading from my file too.
I read the Tute from ur guided site.it helps me more.
but(when this will disappear from my dictionry) its reading the first tag value.
such as my XML File Contents are:-
<crmclientsettings>
<nexthtmlpage>http://sip.net</nexthtmlpage>
<caller>
<Identity>sip:1000892@sip.net</Identity>
<Realm>sip.net</Realm>
<RealName>Swaraj</RealName>
<Username>208500501</Username>
<Password>ion123</Password>
<ProxyServer></ProxyServer>
<Enabler-port>0</Enabler-port>
<StunServer></StunServer>
</caller>
</crmclientsettings>
when i pass the tag name caller.then it give me the detail of Caller detail.if i want indivdual User name then it doesn't work.
what should i pass for (<Caller's><User Name>).
thank u bro i'm able to do this just becoz of u.
byeeeeee
take care
Aavesh
-- modified at 6:56 Tuesday 4th April, 2006
|
|
|
|
|
//what should i pass for (<caller's><user name="">).
Is there any other element called UserName apart from Caller's username???
If no
then simply pass "UserName" to GetElement method if yes, then change the other elements name
or see is there any help given about duplicate element names in that website
how to distinguish them & all other..
Finally congrats... that u at last releaved
|
|
|
|
|
hi (sorry yaar i didn't click on Voted 2 Intestinally)
thanx
don't congrates me yaar it just becoz of u.
Congrates to u too.
as i told u it don't give me UserName when pass only UserName.i'n not getting why?
when i pass caller then it give all the detail.userid,password whatever.
no other element in this inspite of Caller.i think it should work for every tag.....why its not working?
Let see?
what's ur comment.
ok tell me u know DotNet
Aavesh
Aavesh
-- modified at 8:01 Tuesday 4th April, 2006
|
|
|
|
|
No yar I don't know .net
Iam working in MFC VS 2005
but few month before when i started programming in MFC I was not knowing MFC
& now I think I know it little bit
.Net Whats a big deaL??? I can learn it
If u think u can u r right , if u think u can't think over it
Thats what I belive
Oh ur problem , why u r using caller tag remove it & then try passing other tags name
it shud work do some tril & error
ok best of luck
|
|
|
|
|
hi..
no doubt it that u have a gud knowledge.....hats of to u and to ur Confidece.
i know that its not a big deal that is why i'm working on simultaneously two project(one on VC++ & other one is on .Net).
dude.....what r the jobs requirment in pune.
for my problem.....i pass the UserName but not getting...... .
keep in touch
Aavesh
|
|
|
|
|
y don'u send me ur .xml file at my gmail account I'll tell u
tomorrow or if possible today
|
|
|
|
|
|
Please forgive my novity,
I am trying to add buttons to my mfc application. However they show up very basic (old style buttons "as rectangles with straight edges"). I have seen some examples where the buttons are similar to the windows buttons (rounded rectangles). I have tried to change the appearance of the buttons using their properties but I miserably failed
How can i do that ? Thank you
llp00na
-- modified at 8:01 Monday 3rd April, 2006
|
|
|
|
|
Add the manifest file to your project resources to get XP style round edged buttons, provided you are using XP.
Another option is to ownerdraw these buttons.
Nibu thomas
Software Developer
|
|
|
|
|
You can create the object of the CBitmapButton
The button style must be ownerdraw,
load the bitmap and see the fun
code snapets
CBitmapButton m_fun;
m_fun.Create(...); //write appropriate parameters
m_fun.LoadBitmaps(IDB_FUN);
m_fun.SizeToContent();
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|