|
sujandasmahapatra wrote: It's crashing with this code (ASSERT failure in appcore.cpp)
appcore.cpp is a big place! Whenever you ask for help and say an ASSERT is failing for the love of god paste in the code around the ASSERT statement.
Steve
|
|
|
|
|
Is there any tool which can tell types of control is being used by runing software?
|
|
|
|
|
Not completely sure what you mean but try Spy++, it comes with Visual Studio, you can use it to find out what class windows/controls on windows have.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
|
I made a tool window, and then made a treeview, with the tool window being the parent.
I also have a class, that populates the treeview with folder contents.
How do I access the treeview, to populate it?. What I mean is when I make the treeview in the main window, I can just call the HWND to connect to it, but when the treeview is a child of the tool window, I can't access it.
My goal is to have the treeview a child of the tool window, so they always stay together.
I had trouble creating the tool window successfully for awhile, and then I moved the code below to the main window cpp page. The tool window has it's own WndProc.
tbProjectExplorer = CreateWindowEx(
WS_EX_TOOLWINDOW,
szProjectExplorer_Class,
TEXT( "Project Explorer" ),
WS_POPUP | WS_SYSMENU | WS_THICKFRAME | WS_CAPTION | WS_VISIBLE,
winWidth - tvWidth, 1,
tvWidth, tvHeight,
hWnd,
NULL,
GetModuleHandle(0),
NULL
);
ShowWindow( tbProjectExplorer, SW_SHOW);
tvProjectExplorer = CreateWindowEx(
WS_EX_TRANSPARENT,
WC_TREEVIEW,
TEXT( "Project Explorer" ),
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_DISABLEDRAGDROP | TVS_TRACKSELECT | TVS_HASBUTTONS | TVS_EDITLABELS | TVS_SHOWSELALWAYS | TVS_SINGLEEXPAND,
0, 0,
tvWidth, tvHeight,
tbProjectExplorer,
(HMENU) IDM_PROJECT_EXPLORER,
GetModuleHandle(NULL),
NULL
);
SendMessage( tvProjectExplorer, WM_SETFONT, (WPARAM) hFont_lbl, FALSE);
ShowWindow( tvProjectExplorer, SW_SHOW);
|
|
|
|
|
I'm going to scape this idea and try something else.
|
|
|
|
|
For what it's worth, the way to achieve this task is to populate the TreeView inside the WindowProc for the tool window.
Just handle the WM_CREATE message of the tool window, then:
- create the treeView
- populate it
|
|
|
|
|
Thanks
I moved the WndProc for the Toolbar Popup, and the Treeview CreateWindow to the Class that populates the Treeview with Folder Contents in a new function. So now I just make the window, position it, and then create the treeview on the fly when loading the folder contents.
Sort of confusing of how it works, but I get it now.
Thanks for giving me the low down on it, was getting frustrated with it.
|
|
|
|
|
I'm not exactly sure what I was expecting with this, but when multi-column sorting is enabled, I do not see anything special happening with the virtual OnCompareItems() function. When I click the first column, that function is called the appropriate number of times, with iColumn set to the index of the column I clicked. All items are sorted fine. When I shift-click the second column, again that function is called the appropriate number of times, with iColumn set to the index of the second column I clicked (i.e., no mention of the first column). Both of the columns I clicked have a "sort" arrow in its header, however.
Any ideas?
Thanks.
- DC
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
So, I had memory leaks and I was helped by a benevolent programmer (Chuck...) and kicked to the ground by another (Richard...); both of which helped me solve the problem.
Now that we/I solved the memory leaks in my program, is there anything I need to do since I ran the program forever not knowing there were leaks?
|
|
|
|
|
Member 7990715 wrote: ...is there anything I need to do since I ran the program forever not knowing there were leaks? Wouldn't you be in a better position to know what needs to be done to your program?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
My program now has no memory leaks. I thought since there were memory leaks for a while, the memory on my computer might need attention; l; like go delete the huge amounts of variables I left un-deleted.
No?
Are you saying once I fix my program from memory leaks that there are no lasting problems with the computer?
|
|
|
|
|
assertfailed wrote: I thought since there were memory leaks for a while, the memory on my computer might need attention; Not if your program has since been shut down.
assertfailed wrote: Are you saying once I fix my program from memory leaks that there are no lasting problems with the computer? That is correct.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
The memory that "leaked" is the address space of the program you are running. What happens to long running programs is that they lose track, i.e. leak, allocated memory so they grow over time, eventually running out of memory (virtual address space). At that time, malloc(), new, or other such calls that request more memory fail and the program will probably start misbehaving.
However, when you stop the program, kill it with task manager, click the big "X" to close the window, or other such ways to stop programs in Windows (or Linux or whatever), the program is removed from physical memory and all that "lost" memory is given back.
The Operating System (Windows, Linux, etc) never really loses track of the memory, only the program running does. All is recovered when the program dies (in natural or unnatural ways).
Back in the '60s, we used to say that certain operations (like right or left shifts) dropped the discarded bits in the "bit bucket". We'd tell Computer Science 1 students that the bit bucket needed to be periodically emptied Same thing here, we don't need to go back and mop up the leaks
|
|
|
|
|
|
you should go have a beer. your work is done!
|
|
|
|
|
|
Sorry to contradict those other nice folk, but your job is *not* done!
You might be leaking GDI objects too!
Ie, pens, brushes, DCs, and so on. And they're harder to track down...
I have no idea what framework you're using. With pure win32, you need to be nice and careful. With MFC, most of the work of grabbing and releasing is done for you, but you can still mess up.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
how can convert BSTR to DWORD ?
|
|
|
|
|
Have you searched the internet? Sounds way too trivial to me.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
i didnt find about this, just from DWORD to BSTR !!
|
|
|
|
|
Just pass the BSTR like any other string object or character array to atoi() or _tstoi() and cast the returned value to a DWORD .
|
|
|
|
|
It's a delayed answer, but there are two answers:
1) A BSTR is just a pointer, so you can just treat that as a big fat integer. Be careful of 32bit vs 64 bit compiles though.
2) A BSTR is a way of representing a string (it's a counted string), and as such depends on what the string is.
Do you mean the number in the string? "1234" -> 1234?
In which case scanf and friends.
What about "apple" ? Is that 0?
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
hi all,
please can anybody help me
6F00 return on reading of smard card.
i dont know how can i solve out please help me for this.
thanks.
|
|
|
|
|