|
I need to parse xml files in an C++ SDI application. But to me as a beginner it seem's quite difficult how to use MSXML parser. Can anyone give me some hints?
|
|
|
|
|
Can't help with MSXML but I think you'll find articles here on CP if you do a search. Another option is to use pugXml, also here on CP which you may find easier.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Hi,
I'm having a problem or let's say that I don't know how to insert an image in a clasic CTreeCtrl. I found some samples but it doesen't work.
Plaese help!!
|
|
|
|
|
You can do it like this,
of course you can Add some extra images into a imagelist
I hope this frgment will be clear
CImageList m_imageList;
CTreeCtrl m_myTree;
......
m_imageList.Create( ........ );
m_myTree.SetImageList(&m_imageList, TVSIL_NORMAL);
m_myTree.SetItemImage( .., 0, 1);
viliam
|
|
|
|
|
Hi,
how can I programmaticly create and delete a folder???
|
|
|
|
|
raul.simcic wrote:
how can I programmaticly create and delete a folder???
CreateDirectory()
RemoveDirectory()
suhredayan There is no spoon.
|
|
|
|
|
This code is working for...
Open and Read the file "login.rec" in "RECENT" folder and add "USER_NICK" info for a combobox and enumerate "USER_NICK" for same combobox from all existing "USER_NICK.use" file.
this may have a assertion failure error
please fix this code for good working and no error.
BOOL CLogin::OnInitDialog()
{
CDialog::OnInitDialog();
CMainFrame *pMainWnd=(CMainFrame*)AfxGetMainWnd();
CDiet_caloView *pView=(CDiet_caloView*)pMainWnd->GetActiveView();
CString one1;
CString one;
CString RecentUser;
one1.Format("%s\\RECENT",pView->m_strInstallPath);
CFileStatus status;
if( CFile::GetStatus( one1, status ))
{
}
else
{
CreateDirectory(one1, NULL);
}
one.Format("%s\\RECENT\\login.rec",pView->m_strInstallPath);
if( CFile::GetStatus( one, status ))
{
CFile file;
file.Open(one,CFile::modeRead);
char ch[300];
int FileLength=file.GetLength();
file.Read(ch, FileLength);
char seps[]="#";
char *token;
token=strtok(ch,seps);
token=strtok(NULL,seps);
RecentUser.Format("%s",token);
file.Close();
}
CString sPath2;
sPath2.Format("%s",pView->m_strInstallPath);
WIN32_FIND_DATA stFindData;
HANDLE hFindFile;
CString sFile,sTextFile;
CString UserNick;
BOOL nRet;
int nCount;
int num;
char* sPtr=NULL;
sTextFile = sPath2;
sPath2 += "\\user\\*.use";
CString DD;
hFindFile = FindFirstFile(sPath2,&stFindData);
int doit=0;
((CComboBox *)GetDlgItem(IDC_COMBO1))->ResetContent();
while(hFindFile != INVALID_HANDLE_VALUE)
{
if(stFindData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
{
sFile = stFindData.cFileName;
num=sFile.Find(".");
UserNick.Format("%s",sFile.Left(num));
((CComboBox*)GetDlgItem(IDC_COMBO1))->InsertString(doit,UserNick);
nCount = ((CComboBox *)GetDlgItem(IDC_COMBO1))->GetCount();
if(UserNick==RecentUser)
((CComboBox *)GetDlgItem(IDC_COMBO1))->SetCurSel(doit);
doit++;
}
nRet = FindNextFile(hFindFile,&stFindData);
if( !nRet ) break;
}
FindClose(hFindFile);
UpdateData(FALSE);
return TRUE; //return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.
|
|
|
|
|
You failed to mention what part of the code was in error? It's doubtful you will get much help, if at all, by posting a bunch of code, most of which is irrelevant, and asking folks to look at it and find the problem. You need to have gone through it and narrowed the problem down to just a few lines of code and ask for help with those.
If you are going to use MFC, there is no need to use char , FindFirstFile() , strtok() , etc. That's not to say it won't work, but it makes no sense to bounce back and forth between the two unless you need something that MFC does/can not provide.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Please let me know from initial stage onwards
to learn the VC++ and need to master it.
I know very well C,C++,is it helpfull in developing in VC++
Please let me know regarding this asap,I greatly appriciate your response .
Thanks
Munisamy
|
|
|
|
|
Munisamy wrote:
is it helpfull in developing in VC++
Very helpfull.
Learn about MFC, search for MFC. Good luck.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
DEPENDS ON WHAT YOU PROGRAM FOR !!!!
hey, you know what ? i love C++, but no language is THE language...
i'm sure one day i'll learn the klsdfhlskdh+++ !!! and perhaps you won't like it... :->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
i'm sure one day i'll learn the klsdfhlskdh+++
HOpe so i think me also want to learn that tooo
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
toxcct wrote:
klsdfhlskdh+++
Hey, when will it be released? I try to google and couldn`t find that language. Did microsoft created it?
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Yulianto AKA goodmast3r wrote:
I try to google and couldn`t find that language
normal, it doesn't exist yet.
Yulianto AKA goodmast3r wrote:
Did microsoft created it?
how could they ??? the language don't exist anymore (see previous answer )
So who will create it ? I will... in concordance with anybody who want to help... (will Mr GoodMast3r play this game ? :->)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I would like to help. I can see the future now. "A new language is created by us", quoted from cnn.com.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
how to show *.rpt in visul c++ or edit crystal report?
thank you.
|
|
|
|
|
hi all,
i do want to refresh my desktop or any open window .Can it be done using InvalidateRect().if so how ?.I have tried most of the options like update,redrawwindow..etc but no change.Iam working on Vc++ 6.0.
thanks in advance.
help required ASAP.
udaykumar
|
|
|
|
|
you can refresh your Desktop Window by sending
::PostMessage(::GetDesktopWindow(),WM_PAINT,0,0);
or
RECT rect,
GetWindowRect(::GetDesktopWindow(),&rect);
InvalidateRect(::GetDesktopWindow(),rect,TRUE); i never tried that but hope that will work
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
hi alok,
i really thank u for u r time .I am really very new to Vc++,hope iam not asking very silly questions. i added the code which u had sent but i was getting some errors like ...
error:GetWindowRect doesnt take 2 parameters
.....:
error C2660: 'InvalidateRect' : function does not take 3 parameters
.....
so i made some changes like ...
RECT rect;
RECT *lprect;
lprect = ▭
::GetWindowRect(::GetDesktopWindow(),&rect);
::InvalidateRect(::GetDesktopWindow(),rect,TRUE);
i am able to compile it ,but not able to achieve the refreshing of the desktop.
hoping 4 u r reply.
thanking u.
regards uday
udaykumar
|
|
|
|
|
Try this instead, you were missing sending afddress of rectangle to InvalidateRect:
InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
RECT TheRect;<br />
HWND hDesktop = ::GetDesktopWindow();<br />
::GetWindowRect ( hDesktop, &TheRect );<br />
::InvalidateRect( hDesktop, &TheRect, TRUE );
If that does not do it for you, you can just invalidate entire client area of window:
::InvalidateRect( ::GetDesktopWindow(), NULL, TRUE );
|
|
|
|
|
hi blake ,
thnx i lot 4 u r suggestion ,i was able to solve the issue by using
::InvalidateRect(0,0,TRUE);
but still i have a sillly doubt .... i work on Vc++ 6.0 & refering to the msdn ,in Msdn it states that InvalidRect supports only two parameters ,but that never works .can u just brief me about the difference b/w
::InvalidateRect();
InvalidateRect();
bcoz only the ::InvalidateRect works and not InvalidateRect().
thnx in advance
regards
uday
udaykumar
|
|
|
|
|
When you are using MFC programs, typically the function without the colons means it will invoke the MFC version of the function – some function that is a member of an MFC or other C++ class will be invoked.
CWnd::InvalidateRect
void InvalidateRect(<br />
LPCRECT lpRect,<br />
BOOL bErase = TRUE <br />
);
If you want to make sure you call the WIN32 API or GDI version of a function that has the same name as an MFC version of the function, then you put the two colons “::” in front of the function name.
This means the function is invoked at ‘global’ scope and not as a member function of some class.
Here is an example of calling it at global scope:
::InvalidateRect(<br />
::GetDesktopWindow(),
NULL,
TRUE
);
|
|
|
|
|
hi Blake,
Thnx a lot...It was really very kind of u!!!
Thnx again
regards
uday
|
|
|
|
|
hi blake,
thnx a lot!!!It was really good.
thnx again.
regards
uday
|
|
|
|