|
I want to show [+] even the item hasn't child,
and then,when I expanded the item,if it hasn't child,the [+] hided,what should I do?
code sample will be more helpful,thank you.
|
|
|
|
|
Set the TVITEM::cChildren member to I_CHILDRENCALLBACK. This makes the control send a TVN_GETDISPINFO message to determine when to show the + button. See the docs on TVITEM for more details.
--Mike--
http://home.inreach.com/mdunn/
Trillian: What are you supposed to do with a manically depressed robot?
Marvin: You think you've got problems. What are you supposed to do if you are a manically depressed robot?
|
|
|
|
|
When you add the item you set cChildren to 1, then you have to handle TVN_ITEMEXPANDING notification and populate the item with child items. If you add no items, then you set cChildren to 0.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hi:
Can I send an e-mail using OnFileMail() function that MFC provide, but customize the content of mail, that is, use own text as mail content rather than use CDocument content as mail attachment?
|
|
|
|
|
See PJ Naughter's excellent CMapi class: http://www.codeproject.com/internet/cmapi.asp
It's very easy to use, and provides a good reference to using simple MAPI should you want to write your own code.
Or if you'd rather, just copy the code from MFC's OnFileSendMail() and replace the bit that serializes the current document with something to generate your own attachment. (this code is not as nice though)
|
|
|
|
|
Hi, I have a dialog, and have some edit controls in it, can I make them support drag and drop, and how to?
|
|
|
|
|
Check out my article on drag and drop. That covers making the dialog a drop target. I think there's also an article here (or maybe CodeGuru) with a CEdit-derived class that supports drag & drop.
--Mike--
http://home.inreach.com/mdunn/
Trillian: What are you supposed to do with a manically depressed robot?
Marvin: You think you've got problems. What are you supposed to do if you are a manically depressed robot?
|
|
|
|
|
I'm looking to obtain a session handle from within IE. I'm attempting to write an extension dll. In the dll I'm using a wininet lib call that requires an HINTERNET as an argument (InternetSetOption). I've noticed that a call to InternetOpen will return an HINTERNET, however I believe this is used only when external to IE.
Any clues ?
Many Thanks
Peter Hayward
Ngarkat Technologies
Dulwich, South Australia,
Australia
61 8 8364 7060
phayward@bigfoot.com
|
|
|
|
|
i have lpBitmap = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pVideoFrame, nFrame);
How can i save AVI frame as BMP file?
|
|
|
|
|
Hey all!
I compiled an ATL ActiveX Control DLL using Visual C++ 7 - and noticed that the DLL depends on MSVCRT70.DLL...
I have several questions:
1. Can I somehow remove this dependency?
2. What's in that DLL anyway?
3. Suppose I will compile the code with Visual C++ 6 - it will depend on MSVCRT.DLL, right?
4. Is it possible to remove THAT dependency?
5. Is there any software that comes with MSVCRT.DLL EXCEPT for Visual C++? (Internet Explorer, or Office, or something common like that?)
6. Suppose I want to distribute that file along with my ActiveX Control (for download on a web page) - will it work from the control DLL's directory? Need I put it in the user's Windows\System directory? Need I do anything else? Is it legal to distribute this DLL just like that?
Thanks a lot!
|
|
|
|
|
In VS.NET (VC 7), right click on your project in the Solution Explorer and choose properties. The General tab has an option fo "Minimize CRT Use in ATL", switch this to Yes and you should statically link to the CRT's.
If you build it with V6, if you use the min_dep project configuration you will statically link to the CRT's and no longer require that DLL.
You can distribute that DLL with your ActiveX Control and put it in the same directory as your control and that should work.
Later,
Walter Sullivan
Lead Program Manager, MFC/ATL
|
|
|
|
|
Thank you very much
|
|
|
|
|
Hi,
I want to send some special keys using keybd_event. I tried many ways, but I could not achieved.
Please help. How can I send special keys (such as German Language specific characters)?
Kind regards
Mustafa Demirhan
|
|
|
|
|
Hi,
I think you can't send characters, only virtual keys.
You may do the conversion with VkKeyScan.
Don't ask me details, 'cause I never tried
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hello,
How can I wake a computer from standby within my Visual C++ program (that is working on that computer)? I tried to send keystokes, but as expected, it did not work...
Thanks for any helps
Kind regards
Mustafa Demirhan
|
|
|
|
|
Hi,
In one of my programs, I am trying to shutdown windows. The following code works well under W2k but it does not work under WinME/9x. It starts the shutdown process, it closes all windows and then hides the taskbar but then it stops.
Please help. Is there any problems with the code?
PS. The reboot operation works well.
<br />
int CTaskStep::ExecuteShutDown ( CTaskObject *pTask , bool bReboot)<br />
{<br />
HANDLE hProcess = GetCurrentProcess();
HANDLE hToken = NULL;<br />
OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES,&hToken);<br />
if ( hToken ) <br />
{<br />
TOKEN_PRIVILEGES priv_struct;<br />
LUID_AND_ATTRIBUTES priv;<br />
LUID priv_luid;<br />
BOOL bRet;<br />
bRet = LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &priv_luid);<br />
priv.Attributes = SE_PRIVILEGE_ENABLED;<br />
priv.Luid = priv_luid;<br />
priv_struct.PrivilegeCount = 1;<br />
priv_struct.Privileges->Attributes = SE_PRIVILEGE_ENABLED;<br />
priv_struct.Privileges->Luid = priv_luid;<br />
bRet = AdjustTokenPrivileges(hToken, FALSE, &priv_struct,NULL,NULL, NULL);<br />
CloseHandle( hToken );<br />
}<br />
if ( bReboot )<br />
{<br />
if(!ExitWindowsEx (EWX_REBOOT | EWX_FORCE,0) )<br />
return MSG_FAILED;<br />
}<br />
else<br />
{<br />
if(!ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF | EWX_FORCE, 0))<br />
return MSG_FAILED;<br />
}<br />
return EX_CONTINUE;<br />
}<br />
Kind regards
Mustafa Demirhan
|
|
|
|
|
Hi all,
I'm using 2 webbrowser controls (CWebBrowser2) in my application visual C++. I open my pages from web server apache.
I have html forms that have buttons. This buttons have a java script function associated and call a dynamic script that put some datas in a database.
Problem:
With windows 98 and IE 5.5 some of this scripts are execute two times.
In other versions of IE this don't happened!!
Does Anyone know why this happen?
Thanks in advance!
Leila
|
|
|
|
|
Hello, the codegurus around the world.;)
IE consists of iexplorer.exe and the other core dlls like Wininet.dll.
Each IE seems to be the different versin of dlls files.
So, if IE5.5 has this kind of bug, this bug must be come from the bug of some dll.
If you read the bug list of IE5.5, you may find this bug in that bug list?
Or, if Javascript checks the version number of these dlls,
you may write the code to prevent this bug after you add the new code?
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hi,
How can I in the OnInitialUpdate function of my CView derived class get a pointer to the CMDIChildWnd that contains the view?
Thanks!
Erik
|
|
|
|
|
GetParentFrame() will do the trick.
--Mike--
http://home.inreach.com/mdunn/
Trillian: What are you supposed to do with a manically depressed robot?
Marvin: You think you've got problems. What are you supposed to do if you are a manically depressed robot?
|
|
|
|
|
|
Hi
I'm new to ATL. Now I wrote a DLL and compiled it in release mode.
I other DLLs I saw the macro ATLTRACE(_T("Some trace message"));
What does this macro do and how can I find out whether this macro has been "triggered"
regards
|
|
|
|
|
ATLTRACE is just like the MFC TRACE macros, they only print to the output window in debug. In release mode they do nothing.
|
|
|
|
|
Suppose there is an existing function (not written by me) with the following signature:
void OldFun(...);
I want to write a new function as follows:
void NewFun(...)
{
// do something
// then call the existing function with the given arguments
OldFun(...)
// do something else
}
The question is, how do I pass the parameters? Passing ... doesn't work.
Please help !!!
Thanks.
|
|
|
|
|
void NewFun(int param1, int param2, ...)
{
va_list argptr;
va_start(argptr, param2);
OldFun(argptr);
va_end(argptr);
}
you need at least one fixed parameter
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|