|
HTREEITEM hRoot = m_tree.InsertItem(_T("(0)GrandParentA"));
HTREEITEM hParent = m_tree.InsertItem(_T("(1)ParentA"), hRoot);
m_tree.InsertItem(_T("(1.1)ChildA"), hParent);
hParent = m_tree.InsertItem(_T("(2)ParentB"), hRoot);
m_tree.InsertItem(_T("(2.1)ChildB"), hParent);
hParent = m_tree.InsertItem(_T("(3)ParentC"), hRoot);
m_tree.InsertItem(_T("(3.1)ChildC1"), hParent);
m_tree.InsertItem(_T("(3.2)ChildC2"), hParent);
|
|
|
|
|
Greetings:
I am trying to create a custom list control. Its just a specialized List Control that I will use repeatedly in several different dialogs and property pages. But I have hit a bit of a snag:
I was handling the LVN_ITEMCHANGED message with OnLvnItemchanged, generated by Class Wizard. That was working fine. But then I also needed to handle LVN_ENDLABELEDIT with OnLvnEndlabeledit. For some reason which I do not understand, the introduction of the LVN_ENDLABLEEDIT handler has stopped the LVN_ITEMCHANGED message from being issued.
Can anybody advise? I need to handle both of these messages...
Thank you,
Mark
-- modified at 9:14 Monday 17th July, 2006
|
|
|
|
|
Hello comunity,
when i start my application they use ca. 10mb ram, ok, than when i open a file, they have, for example if this is a big file, ca.100mb, this is ok to, but now when i close this file, and free all global variables, my application should have again ca. 10mb like from beginning, right?
But this is not the case, my application stil have ca.70MB, 60MB more then normal, where is the memory???!!!
How to find where is the used memory RAM???
I can't find any memory leaks! is there any tool to do this?
with best regards
break;
|
|
|
|
|
Sure, there are tools to find memory leaks.
First, though, consider that the memory count reported by windows will include both allocated memory (ie new or malloc'd memory) and memory held by the CRT. If you new enough memory and the CRT has to ask windows for more heap, it may hold on to it even after you delete / free it so it has enough for your (presumably also large) future requests.
If you are trying to debug memory leaks, try using Rational Purify, DevPartner Studio, or similar products. Be aware, though, that most of these start at $1000+ / seat, though they are more than worth the investment ITO dev time.
earl
|
|
|
|
|
Hi all,
I want to Replace My Menu which is Created From
Resouce -> Menu
After creating the Menu at Design Time i have to attach that menu to my CForm View Replacing the Default Menu Item which is created by the MFC Wizard. Please let me know the Process.
Because if i comment the Default Menu Created in CMainFrame::OnCreate(...) Member function it is giving error. How to Replace the Existing Default Menu with the New menu Which i have crated in CFormView Only.
uday.
|
|
|
|
|
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MENU1,
RUNTIME_CLASS(CXXXDoc),<br />
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CXXXView));<br />
AddDocTemplate(pDocTemplate);
|
|
|
|
|
HI,
Very Much Thanks to You!!! I have got it. Is is the Same with ToolBar for the CForm View?.
uday.
|
|
|
|
|
If you want to change the toolbar also, then in CMainFrame::OnCreate() replace IDR_MAINFRAME with your toolbar ID.
Eg:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP<br />
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||<br />
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))<br />
{<br />
TRACE0("Failed to create toolbar\n");<br />
return -1;
}
|
|
|
|
|
Hi,
I have a C++ project written on a linux system, that I would like to compile in Visual Studio and integrate with some other stuff I have.
Now I'm new to porting and have very little to no idea as to how I should proceed. I mean what are the differences? differences in syntax? differences in features? I pretty clueless. I don't know much about linux - I know some basic commands and I used SUSE for a while.
I've uploaded the project folder that I have: http://www.duke.edu/~arb25/rhessys5.10.13/
So how I should I proceed? Any guidance/comments/suggestions - really anything, would be greatly appreciated!!
Thanks
Developer in the making
|
|
|
|
|
The C++ language is perfectly portable. What is not portable is some of the libraries you are using and of course, everything that is related to the platform. If it is a console application, it should be quite easy to port but if you are running a GUI application, then it will be more complicated to do.
In general, you design your application with portability in mind (by using portable libraries like wxWidgets for example).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
The code looks like plain standard ANSI C (not C++) without any Linux-specific features. Just try compiling it and see if you get any errors.
|
|
|
|
|
Thanks for the quick response.
What kind of project should I compile it as? Win32 console application?
Also apart from the main.c file and the header files, should the other files be added to the resource folder in solutions explorer?
I tried compiling it before, but it kept giving me:
fatal error C1083: Cannot open include file: 'rhessys.h': No such file or directory
although I had the header file in the Header files folder in solutions explorer.
Well I'm going to compile it again, after I confirm the above questions and I'll post here.
Again thanx for your help
Developer in the making
|
|
|
|
|
I have found some problems in porting LINUX to WIN32 that contradict things that have been stated here. Specifically, the general idea of what is ANSI varies from person to person. The main problem I found is in these situations:
void some_function(char* string, long string_size) {
char buffer[string_size+1];
strcpy(buffer, string);
...
}
This code typically compiles with GCC, but not in WIN32 because "string_size" is not a constant. Technically, there is no real reason for this code not to compile, since it is perfectly possible to generate machine code for these kinds of instructions. However, I don't know how to get it to compile in WIN32. So, I find these compilations errors, and change them to something like:
void some_function(char* string, long string_size) {
char buffer[MAX_STRING_SIZE+1];
MyAssertSize(string_size, MAX_STRING_SIZE);
strcpy(buffer, string);
...
}
The MAX_STRING_SIZE is defined to be the maximum string size, and the MyAssertSize() is a macro (#define) that generates a controlled error if the requested size happens to be larger than the defined value.
Anyway, these are the hardest problems I have found. But, in general, you can expect code to compile but also expect tons of wornings. I have grown acustomed to living with them.
I hope this helps,
Rilhas
|
|
|
|
|
hello frnds.I am passing some parmtrs frm comndline to MFC exe.If syntax err ocurs ve to display in cmndLine.How to do.I ve tried cout.its not working.
kannan
|
|
|
|
|
Use
system( "pause" );
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
kanna_p wrote: I ve tried cout.its not working.
Why not? What symptoms are you seeing?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: symptoms
I dislike feeling at home when i am abroad. To all the virgins in the world thanks for Nothing
|
|
|
|
|
nothing is happening.Mine is a GUI application.So only AfxMessageBox is working.But I need the msg to be displayed in commandline shell which invoked the application.
|
|
|
|
|
You cannot mix AfxMessageBox() , which is for GUI apps, and cout , which is for console apps.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If your MFC program is a commandline app, you should be given handles to the appropriate output streams. If it is a GUI app, use AfxMessageBox.
earl
|
|
|
|
|
Dear all,
Iam using HWND CreateDialog(HINSTANCE hInstance,LPCTSTR lpTemplate, HWND hWndParent,DLGPROC lpDialogFunc); to create a dialog in DLL, how to get the parameter hInstance is correctly , it must be the dll module's instance..
Manjunath S
GESL
Bangalore
|
|
|
|
|
Manjunath S wrote: how to get the parameter hInstance is correctly ,
GetModuleHandle
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Why aren't you using the value passed to DllMain() ?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
I used the hinstance passed in the dll main,And i used it to create dialog model using createdialog . But in that dialog i have static control(having text "driver is loading please wait"),this static text is not displaying . but it display after i returned from that DLL function...
Manjunath S
GESL
Bangalore
|
|
|
|
|
I start threads using AfxBeginThread like :
<br />
AfxBeginThread(myproc,(LPVOID)data);<br />
<br />
UINT myproc(LPVOID lparam)<br />
{<br />
do<br />
{<br />
<br />
}while;<br />
<br />
return(0); ---------> is this enough to close the thread. ? <br />
}<br />
I read if p_AutoDelete in a CWinThread object is set to true(which is it's default) , the thread gets deleted automatically. But I'm not assigning my AfxBegin call to a CWinThread object, But still do you think it'll get deleted automatically? valid suggestions please..
Thanks,
|
|
|
|