|
Hi all,
i'm trying to isert a new item to the tree control when i click on a button.It's working fine if i'm inserting the new item as a child to the another item which is already having child items,but when i try to add the new item to a leaf item (leaf item as parent to the new item)new item is inserted but not visible.
How can i come out from this problem.Any one please help me .
Thanks in advance.
|
|
|
|
|
Try calling - YourTreeCtrl.Expand(hParent, TVE_EXPAND)
where "hParent" is the leaf which is now the parent of the new item
|
|
|
|
|
Thank you for your reply Mr GuyM
I already tried in this manner but the item was not visible .Any alternative to this .
|
|
|
|
|
//I have a problem reading a text file which I have
//created using Notepad and saved at c:\test.txt in
//"Unicode" format.
//The file contains just a single word: "Test"
//The following is a C++ program to read the file
#include <wchar.h>
#include <fstream>
using namespace std;
typedef basic_ifstream<wchar_t> ifs;
void main () {
ifs is ("c:\\test.txt");
wint_t c;
while ((c = is.get()) != WEOF) {
wprintf (L"%c", c);
}
}
//The output was:
//..T.e.s.t.
//Note that the loop went for 10 times while I expected it
//to run only 4 times for word "Test".
//The following is an equivalent C program that does all correctly.
/*
#include <stdio.h>
void main () {
FILE *fp = _wfopen (L"c:\\test.txt", L"rb");
wint_t c;
while ((c = fgetwc(fp)) != WEOF) {
wprintf (L"%c", c);
}
fclose (fp);
}
*/
//Output: Test
//Do you have any suggestions? Please help. Thanks in advance!
B2C
|
|
|
|
|
balu_codeproject wrote: typedef basic_ifstream ifs;
Try:
typedef wifstream ifs;
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for your help! I hope the problem is solved.
|
|
|
|
|
Unicode Text File c:\test.txt contents:
"Test" (without quotes).
wchar_t is defined as unsigned short as it should be.
typedef unsigned short wchar_t;
But wifstream which is defined as
typedef basic_ifstream<wchar_t, char_traits<wchar_t> > wifstream;
cannot read unicode file correctly.
#include <fstream>
using namespace std;
void main () {
wifstream is ("c:\\test.txt");
wchar_t c;
while ((c = is.get ()) != WEOF) {
wprintf (L"%c", c);
}
}
output was:
..T.e.s.t.
When I tried short instead of wchar_t all went ok;
#include <fstream>
using namespace std;
void main () {
typedef basic_ifstream<short, char_traits<short> > ifs;
ifs is ("c:\\test.txt");
wchar_t c;
while ((c = is.get ()) != WEOF) {
wprintf (L"%c", c);
}
}
output was:
Test
Should wchar_t be defined as short or this is a bug
in standard C++ library shipped with VC++ 6.0?
B2C
|
|
|
|
|
Hello, i'm fairly new to c++ and programming in general, I'm looking for a decent alternative to microsoft visual c++ 2005 express edition, that is, any code that would work in that compiler would function the same.
I've already tried dev c++ but that uses mingu? So my code comes out with lots of errors when I compile, is there a free compiler that I can download that uses the same standard as express edition?
The reason that I am looking for an alternative is I'm experiencing some difficulty with running express edition in windows vista, I'm a college student studying programming so I need a compiler that works for my studies.
|
|
|
|
|
spacegrass wrote: So my code comes out with lots of errors when I compile
What kind of application did you use ? console ? Win32 ? Normally, this should work with DevC++. What are the compilation errors that you get ?
|
|
|
|
|
I am not an expert about Vista, but IMHO if you experience troubles with MS compiler, then probably you will experience more troubles with other ones.
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.
|
|
|
|
|
There's a service pack that fixes the vista issues, I believe. And you won't find a more standards compliant compiler than VC2005, not for free.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how to write a mfc code to search on start menu for installed software
-- modified at 6:31 Wednesday 16th May, 2007
|
|
|
|
|
Sorry, I can not answer you. But other times I have read about the people looked for installed software in Registry, not in StartMenu. I don't know if it is better, I only wanted to tell you about.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
working on CString
I want to add [ ] in the begin and end of "abc xyz"
I want to display "[abc xyz]"
help me ...
Thanks in advance
Ashok
|
|
|
|
|
CString str = _T("abc xyz");
str = _T("[") + str + _T("]");
|
|
|
|
|
ashokbngr wrote: working on CString
I want to add [ ] in the begin and end of "abc xyz"
I want to display "[abc xyz]"
CString csStr;
csStr.Format( _T( "[%s]" ), _T( "abc xyz" ));
|
|
|
|
|
You can use the CString.Insert method and the += operator:
CString myString = "abc xyz";
myString.Insert(0, '[');
myString += "]";
See MSDN CString.Insert[^]
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
CString s1 = "abc xyz";
CString s2 = "[" + s1 + "]";
|
|
|
|
|
Hello Friends,
Can i use ctwain class to implement barcode detection. I like to develop a barcode detection programe using twain.How i can get more documentation on ctwain class.
Looking forward you
Sujith.s
-RisKhan-
|
|
|
|
|
Helo...I have my inteface in c++ and I want to take the data from the interface in the main program like this:
int main(array<system::string ^=""> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
int container = Convert::ToInt32(forminterface::Form1::ContainerWidthtextBox, System::Globalization::CultureInfo::CurrentCulture);
.........}
in the interface I have a TextBox...ContainerWidthtextBox in which I introduce the data ...haw can I use this value in my main ....because it doesn't let me to use:
int container = Convert::ToInt32(forminterface::Form1::ContainerWidthtextBox->Text, System::Globalization::CultureInfo::CurrentCulture);
it give me an error like Error 5 error C2227: left of '->Text' must point to class/struct/union/generic type
please help me.......
|
|
|
|
|
|
Man, you really have to learn to post to the correct forum[^]. It is not the first time you post managed code in the C++ forum and people have already told you to post in the managed forum.
Please, be carefull in the future.
|
|
|
|
|
ok...I wilt try..sorry for the problem
|
|
|
|
|
Hi Experts,
In which view i can display html text.
Thanks in advance.
|
|
|
|
|
pther wrote: how to display html
You can use of CDHtmlDialog class or CHtmlView class .
|
|
|
|