|
If you have the handle of the item you want to expand you can call CTreeCtrl::Expand. Something like this:
pTreeCtrl->Expand(hItem, TVE_EXPAND);
P.S. When I first read your post I thought you were just looking for a way to expand a node programmatically, but I've just realised there is more to it and the above reply is probably not much use - because TVE_EXPAND generates a TVN_ITEMEXPANDING message.
What problem is the TVN_ITEMEXPANDING message causing you?
Best Regards
Cliff
modified on Sunday, August 17, 2008 7:36 AM
|
|
|
|
|
Hi,guys,I did a test on a macro function code, and compiled it in VC6.0,
but the compiler reported an error:
"D:\vc project\testmacro.c(7) : error C2105: '--' needs l-value"
Would someone explain why line 7 reports an error ,but line 6 doesnt't?
3x!
Source code is as follows:
#include "stdio.h"
#define ABSOLUTE(a) (((a) > 0) ? (a) : (-a)) /* Get absolute value */
void main()
{
int a = -1;
int c = ABSOLUTE(1);
int b = ABSOLUTE(-1);
}
|
|
|
|
|
Make it
#define ABSOLUTE(a) (a > 0 ? a : -1*a)
by the way there is already a macro defined as "ABSOLUTE"
in wingdi.h
Md. Humayuon Kabir Hemoo
|
|
|
|
|
quite.
never forget to use parenthesis everywhere within the macro definition...
|
|
|
|
|
Try using this
<code>#define ABSOLUTE(a) (((a) > 0) ?(a) : -(a))</code>
Do more work
Make more mistakes
Learn more things
|
|
|
|
|
What you have to understand about macro is that they are simply a 'text replacement': the precompiler will replace occurances of ABSOLUTE in your code by the macro definition, before the compilation. So, it means that ABSOLUTE(-1) will be replaced by:
(((-1) < 0) ? (-1) : (--1))
As you can see, the --1 is not valid. This doesn't happen for line 6 because it will be replaced by:
(((1) < 0) ? (1) : (-1))
which is valid.
|
|
|
|
|
Cool, that's absolutely right!
Thank you for your explanations, and other guys also.
|
|
|
|
|
I have been reading all day long on how to open external programs, i've been told several times to do this
#include ^stdlib.h^ or #include ^windows.h^
system("...");
when I try to do the #include, it fails on build, if I try the system only, it fails on build.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {system("C:\\Program Files\\America's Army\\System\\Armyops.exe");}
That is what i am trying to do.
I've tried searching on here but I can't come up with the right word sets to to actually find it.
Note: ^ is the great then and less then signs that don't show up in text.
|
|
|
|
|
Try here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Didn't help much, went all 14 pages, couldn't find nothing useful
|
|
|
|
|
David was saying that you have to post in that forum, not in the C++ forum (it seems you are doing managed C++).
|
|
|
|
|
C# Beginner Nick wrote: ...went all 14 pages...
And posted what?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Besides posting on the wrong board as mentioned...
You're using managed code so why not use the .NET framework
instead of old CRT functions?
Maybe something like Process::Start()[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have a Module that mainly runs in the Background (i.e. Minimized). It's main function is to monitor the contents of a file somewhere on the network, and display some data relating to it. While the Module runs minimised, I have No Need to read the Data, because they cannot be displayed in the first place. When the module is restored, I need it to 'Waken Up', and kick the monitoring process into motion. How do I detect the Window State/StateChange from within my app. BTW My App is Dialog Based.
Regards
Bram van Kampen
|
|
|
|
|
Does the WM_SIZE notification give you the info you need?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Bram van Kampen wrote: How do I detect the Window State...
Does IsIconic() or IsZoomed() help?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Just the Ticket,
thanks David,
Bram van Kampen
|
|
|
|
|
Hello,
I have tried to download the source code for the above mentioned with problems. The code in the article is quite hard to understand.
I have no idea how to implement it.
Does anybody have any source code knocking about?
Thanks V much
Simon
|
|
|
|
|
I didn't find the article, but if you need to play sound using the winmm.lib library, the function you need is:
sndPlaySound(filename, SND_MEMORY|SND_ASYNC|SND_NODEFAULT);
rotter
|
|
|
|
|
Do you want to play audio files?
|
|
|
|
|
Hi,
Anyone any Idea how to Read and Set the system time on another computer on a private Network.
Regards,
Bram van Kampen
|
|
|
|
|
Hi all,
I am trying to write a simple program which would be able to give me a list of running processes.
I am using OpenProcess(PROCESS_ALL_ACCESS, false, pid); But I always get Access is denied - because it is a service.
Can you give me a hint how can I get service name when I know its PID? Is it possible?
Thanks.
|
|
|
|
|
daavena wrote: But I always get Access is denied - because it is a service.
More likely because the account the service is running under.
What account does your service run in?
Do you really need PROCESS_ALL_ACCESS rights?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
"What account does your service run in?"
under System or Network service
"Do you really need PROCESS_ALL_ACCESS rights?"
I tried PROCESS_QUERY_INFORMATION but it didn't work so I tried PROCESS_ALL_ACCESS.
Thanks.
|
|
|
|
|