|
This tree control is used as a part of a combo box (that is, a hierarchic tree instead of the list). Search for the ComboTree class here: http://codeproject.com/combobox/combotree.asp.
However, there is a new version of ComboTree out there now, so there is no need for the WS_POPUP flag.
|
|
|
|
|
First, I'm not 100% sure that a CTreeCtrl can be WS_POPUP, however I can't find any documentation that says it can't.
I'm assuming you are using VS.NET or later as the VC6 version of CTreeCtrl doesn't look like it has it's own CreateEx, so it must be calling the CWnd::CreateEx
Looking at the source for VS2003, CTreeCtrl has it's own CWnd, and like you said calls Create and then using ModifyStyleEx to add the Ex-styles. As this is the same for all the classes, I'm hard pressed to think this is a bug.
What line does the ASSERT happen?
You can of course, derive a class from CTreeCtrl and create your own CreateEx as the function is declared virtual in the base class.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
First, I'm not 100% sure that a CTreeCtrl can be WS_POPUP, however I can't find any documentation that says it can't.
Neither do I. Anyway, a given piece of code requires it at the moment (see my other comment).
I'm assuming you are using VS.NET or later as the VC6 version of CTreeCtrl doesn't look like it has it's own CreateEx, so it must be calling the CWnd::CreateEx
I tried the stuff with VC6 - it doesn't have a CTreeCtrl::CreateEx , and Create gives assertion failure just as it should. The project is now in VS.NET (MFC 7.0, now 7.1).
What line does the ASSERT happen?
wincore.cpp(732) in MFC 7.0 or wincore.cpp(734) in MFC 7.1.
You can of course, derive a class from CTreeCtrl and create your own CreateEx as the function is declared virtual in the base class.
Well, you're right. Still, I don't feel like writing an own CreateEx as the "official" one in MFC may change later and call other things besides Create and ModifyStyleEx (though I don't think so for the near future).
|
|
|
|
|
Yogurt wrote:
Still, I don't feel like writing an own CreateEx as the "official" one in MFC may change later and call other things besides Create and ModifyStyleEx (though I don't think so for the near future).
You could always create a new window class which acts as a popup window. And then let it host the tree control. That ought to be pretty safe for the future
--
C'est normal!
|
|
|
|
|
I am currenly looking for a method (efficient) for streaming live images over a network. This image will then be processed further when receieved. Grabbing the images using directshow (or intels opencv) is easy. I have thought of using some codec for compressing the images and somehow send it. Does anyone have a good solution for my problem?
Best
Dan
|
|
|
|
|
hello,
as you know, kernel32.dll is loaded at windows startup and remains in memory until reboot or shutdown. Furthermore every .exe and .dll which is going to be executed uses the kernel32.dll which means that it is loaded into the adresse space of the calling process. So far so good! At the moment a dll is loaded into memory its dllmain function should recieve 3 parameters whereas one of those descripes wheather the dll is attached by a process/thread or detached.
But in my understanding, a system dll which is already loaded (at startup like kernel32.dll), doesn't get a notification if it is loaded or unloaded into/from a process' adresse space because it is already in the memory! Now is that true or false and how can i examine that ?
Thanks in advance!
|
|
|
|
|
It doesn't sound logical
The Kernel32.dll behaves just like any other DLL would. Here is a link to the MSDN site[^] depicting the different reasons for call.
According to the MSDN:
It is safe to call other functions in Kernel32.dll, because this DLL is guaranteed to be loaded in the process address space when the entry-point function is called.
Following this logic, the Kernel32.dll's entry-point function gets called each time it is loaded into the process' address space. For each process that starts, this DLL provides the basic system services. According to the "Virtual Machine" thinking, each process runs seperately, and believes that it is the only process in the system. Thus, each process needs to access basic system services, and they are provided by this DLL.
You can use the Dependency Walker to see what DLL's your executable loads when it is started (that is, what executables it needs in order to start up). You cannot track the usability of Kernel32.dll in the whole process, because it gets loaded into the system core memory area. Tampering with this area easily causes an access violation or a machine-wide crash.
In conclusion: the Kernel32.dll is active in the system code memory area. From there, it gets loaded into the address space of each process that uses it (all Win32 programs). The entry-point function gets called each time.
If you want to test this yourself, create a system-wide service DLL and debug-run it with RunDll32.exe, that loads it into the memory. Now, create a set of new application that load this DLL. Then track it's DllMain-calling sequences by putting a breakpoint there. Not sure if this works though, no guarantees given...
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks for your help!
Actually i hoped that i am right, but i have expected that! What i try to do is the following:
I have written a patch which injects some code into the kernel32.dll (Win98) which should load a specific .dll evertime the kernel32.dll is loaded. I have switched the original kernel32.dll with a boot disk. To get a little bit more specific: i have changed the adresse of the entry-point function, so it jumps to my code, where a specific dll should be loaded, and then jump back to the "real" entry-point-function!
The strange but funny thing is, that windows98 starts up as if there is no manipulation in its kernel32.dll! I also have changed the code into something that makes no sense to see what happens, and yes, after that i have gotten a beautiful blue screen! The code to load the additional dll within the kernel32.dll is absolutely correct (that's what i think it is)! I don't have an idea why i doesn't load the dll!
Any ideas ?
Thanks in advance!
|
|
|
|
|
With a tool like dependencywalker for example I can see the function exports of a dll. Is it possible to figure out the parameter list of such an export function (certainly not the names, but perhaps the number and the data types) ?
MS
|
|
|
|
|
if the names are decorated (they looks funny)
you may find out the parameterlist. but usualy they are not decorated and you have no chance.
|
|
|
|
|
Hi All programers,
i need help with macro for my com class that will be working like this :
class ComObject
ComObject.#anything# (...) will be convert as ComObject.Invoke(anything, ...)
or
ComObject->#anything# (...) will be convert as ComObject->Invoke(anything, ...)
i am not master of c++ my know is this :
template <t>
typedef T::##name(...)
(T::Invoke(#name, ....)
can by this working ???
Thanks !!!!
Anthonius
|
|
|
|
|
Hi,
I have an MDI application with views derived from CHtmlView, and my problem is with Undo,Cut, and Copy menu items under the Edit menu, which is always found disabled. Can anyone tell me how can I enable those menu items when a selection is made in the view.
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Handle an ON_UPDATE_COMMAND_UI message for appropriate IDs (ID_EDIT_UNDO etc.)
Robert-Antonio
|
|
|
|
|
Handle each menu item in your CHTMLView derived class like:
[...]
ON_COMMAND(ID_EDIT_CUT, OnEditCut)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_SELECTALL, OnEditSelectAll)
[...]
Below is the implementation for each member function:
void CWebView::OnEditCut()
{
ExecWB(OLECMDID_CUT, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
}
void CWebView::OnEditCopy()
{
ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
}
void CWebView::OnEditPaste()
{
ExecWB(OLECMDID_PASTE, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
}
void CWebView::OnEditSelectAll()
{
ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
}
I got this code from an article somewhere, but unfortunately, I can't find where the article is again. Anyway, this should help you out.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
My application is in VC++ and it needs to notify the user [may be a message box] whenever there is a change in system password.
How can this be achieved? Is there any simple event registered with the system and handled in the application?
I searched on the web and got to know something about password filters and credential managers but those seem to non-trivial. Is there any other way by which my application can get to know the passwprd change?
This is an urgent requirement. If anybody could suggest something, it will be greatly appreciated!
thanx
|
|
|
|
|
Dear friends,
This problem is related to CRichEditCtrl. Actually i want to display my custom font in this control. My font requires right alignment. So i programatically changed the alignment to right as follows:
PARAFORMAT pf;
pf.cbSize = sizeof(PARAFORMAT);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_RIGHT;
SetParaFormat(pf);
As such everything works fine for me. But my font is displayed correctly if characters are fitted only in a single line of rich Edit Control. In case when my text needs to fit in multiple lines, i am having trouble. As such text is displayed correctly. But "next" line comes on top of existing line and previous line is moved to bottom. How can i change this default behaviour of rich edit control.
Actually my font is arabic font which needs to get typed from right to left (i.e "reverse" of default behaviour). But i am unable to "reverse" the order in which RichEdit inserts characters in new line.
|
|
|
|
|
Is there a way to generate a tone using MCI by using time an amplitude of sinusoidal wave form as its input?
|
|
|
|
|
I have a public __gc class named Zones. At program startup I want the program to read a data file, and dynamically invoke instances of Zones depending on how many are listed in the .dat file.
--Example of .dat file
[Zone1]
name=test1
loc=coords1
[Zone2]
name=test2
loc=coords2
[zone3]
name=test3
loc=coords3
I would like to create a filestream and streamreader, create an instance of the class Zones, input the first 4 lines of data (first and 4th are non-necessary), and then peek at the next line. If the peek != NULL, then loop back up to create a 2nd instance, etc etc etc until it gets to the end of the file which would be a blank line. Then I can perform calculations and find out which is the closest to me (according to my location coords from another class (public __gc class MyLoc)) and info like that.
James Meade
Tank
vENS vUSN
VAQ-140 Patriots
|
|
|
|
|
Hello all,
I'm having a bizarre problem.
I created a setup for my program, using Installshield Express 5.
The program installs with no problems, and the required shortcuts are created.
Then, I make a QuickPatch for it, and install it. The QuickPatch replaces a single file - and works with no error - but it ruins the shortcuts!
More specifically, after I run it, the shortcuts point to "nothing" (an empty field), and fail to run (Windows displays an "Invalid parameter" error message box.
Any ideas??
Thanks in advance!
|
|
|
|
|
Hi,All
I am in this stiuation. I have a header file(foo.h) that is in a different directory. For instance, my project is under c:\test\, and foo.h is under c:\confuse\foo.h. I am trying to include foo.h into my project. And the way i do is as following:
#include "..\confuse\foo.h". The error message is
fatal error C1083: Cannot open include file: '..\confuse\foo.h': No such file or directory.
Could somebody tell me what can i do?
Thanks in advance.
|
|
|
|
|
try / instead of \
otherwise...make sure your files are in those actual directories and everything should work
If not i'm as confused as you are
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Take the Visual Studio path setting by
Tools menu > Option > Directory tab >
Then add the directory to the Include path list. Here in ur case "c:\confuse".
Then just use
#include "foo.h"
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Tools > Options > Directory is a user setting. Only use this for system includes such as the Platform SDK. These settings are not carried along with the project, so anyone else working with the project will have to configure their IDE appropriately.
For projects, you should go to Project > Settings > C/C++ tab > Preprocessor category and add the directory to the Additional Directories setting. You'll need to do this for all configurations.
The Additional Directories setting is a comma-separated list of directories. You should specify the directory relative to the location of the project's .dsp file.
A layout I often use is
proj
+-inc
+-src
+-lib
+-bin
+-obj In this case, I put common include files in inc, my project files live in the root proj directory, so the Additional Directories field simply has inc in it.
|
|
|
|
|
Thanks, guys.
Mike, i am following your suggestion. Preprocesor category you metioned is C/C++ tab > Preprocessor definition? In the Preprocessor definition box, i have "WIN32,_DEBUG,_WINDOWS,_AFXDLL,_MBCS", how can i specify the directory relative to the location of the project's .dsp file?
Thank you very much.
|
|
|
|
|
You're looking at the wrong control.
The top control in the box is the Category drop-down, which currently reads General. You need to change that to Preprocessor.
You should then see a layout something like:
Category: [Preprocessor ][v] [Reset]
Preprocessor definitions:
[_DEBUG,WIN32,_CONSOLE,_MBCS ]
Undefined symbols: [ ] Undefine all symbols
[ ]
Additional include directories:
[ <edit this field> ] [ ] Ignore standard include paths
Project Options:
[ ] [ ] You should add the directory in the Additional include directories field - in your case, probably ..\confuse .
|
|
|
|
|