|
Hi,
I was wondering how could I dynamically add an item to a menu (or how to add a menu dynamically).
I appreciate your help.
Thanks.
|
|
|
|
|
Hi,
I believe the MSDN library discs have a sample called DYNAMENU that shows how to dynamically add items to a menu.
Hope that helps,
Lan
|
|
|
|
|
Use CMenu::InsertMenu
Best regards,
Alexandru Savescu
|
|
|
|
|
Use InsertMenu()
BOOL InsertMenu(
HMENU hMenu, // handle to menu
UINT uPosition, // item that new item precedes
UINT uFlags, // options
UINT_PTR uIDNewItem, // identifier, menu, or submenu
LPCTSTR lpNewItem // menu item content
);
|
|
|
|
|
How can I send EMails from an MFC Project without MAPI functionality and without Doc/View Architecture???
Please send me some source Code!!!!!
|
|
|
|
|
Check this article:
CCmc v1.0 - A CMC Implementation
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Why, Mazy, you disobeyed the order to Send Source Code!!!! If he'd wanted a link, he would've asked you to Post Article Link!!!
|
|
|
|
|
Ed Gadziemski wrote:
Why, Mazy, you disobeyed the order to Send Source Code!!!! If he'd wanted a link, he would've asked you to Post Article Link!!!
Hey this is very common way in answering questions. Many times people don't ask foe link but after that when somebody give them some link they become glad for it.So why should I disobey.
|
|
|
|
|
That was a joke. You see, the person who wrote "Send Source Code!!!!" was making demands on CP members as if he were King or President. Similar to "You must do this. I command you." So, the joke was that you did not give him what he commanded. Sorry if I was not clear.
|
|
|
|
|
I create a ListBox in a Dialog dynamically!I want to capture
the message LBN_SELCHANGE of the control ListBox,I create it like this:
m_ListBox.Create (WS_CHILD|WS_VISIBLE,rc,this,IDC_LIST_BOX);//CListBox m_ListBox
And I use the following code to check if the dialog capture
the message:
LRESULT CMyDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message==LBN_SELCHANGE)
{
AfxMessageBox ("LBN_SELCHANGE");
}
return CDialog::WindowProc(message, wParam, lParam);
}
But to my surprise,I found that it can capture the mesage only once,it occured at the begin of the program.after that ,it can't be captured.
How can solve the problem!
Thank you!
Don't look at me in that way!
|
|
|
|
|
How can I write text and draw lines in a MS Word Application from an MFC Project without DOC/VIEW Architecture???
Please send me some source code!!!!
|
|
|
|
|
I THINK there is an article in CP about MS Word Application.Search this site.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Do you know how should i test if a directory exists in the file system, or a file?
Is that an article on CP regarding this subject?
rechi
|
|
|
|
|
#include <io.h>
if (_access(dir, 0)==0)
then it exists
-c
Cheap oil. It's worth it!
|
|
|
|
|
is this a better method that using CFindFile? does the _access function verify the user has access to the path as well, instead of just that it exists?
-dz
|
|
|
|
|
with mode 0, _access only checks for existence. other modes can test for read/write access.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Or: if( ::GetFileAttributes( pszFSpec ) == FILE_ATTRIBUTE_DIRECTORY ) ...
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
heres what i use..
BOOL CCommonFunctions::DirectoryExists(CString strPath)
{
CFileFind finder;
if (strPath.Right(1) != "\\")
strPath += _T("\\");
strPath += _T("*.");
BOOL bWorking = finder.FindFile(strPath);
if (!bWorking)
return FALSE;
finder.Close();
return TRUE;
} use it by saying:
if (!CCommonFunctions::DirectoryExists("C:\\Temp\\")
AfxMessageBox("ERROR!");
and for files..
BOOL CCommonFunctions::FileExists(CString strFilename)
{
CFileFind ff;
BOOL result = ff.FindFile(strFilename);
if (!result)
return false;
ff.Close();
return true;
} use it by saying:
if (!CComonFunctions::FileExists("C:\\test.txt")
AfxMessageBox("ERROR!"); that should help.. if someone has a better written function let me know..
-dz
|
|
|
|
|
I have a strange problem:
Because we need to run a process under another account (for COM+ rolebased security). To do so, we create a little startup application that displays a dialog where the user can enter its credentials. Then it uses the API call
CreateProcessWithLogonW to startup the real app. After this, our help does not work anymore. We use Windows 2000/XP with HTML help.
Does anyone have an idea?
Thanks,
Remon
|
|
|
|
|
An idea: Check the permissions on the HTML help directory and files.
|
|
|
|
|
Thanks for your reply.
It was much simpler. The default directory when running under another account was not the same (not the module directory). Therefore the helpfile could not be found.
|
|
|
|
|
Where to get HTTP proxy sources?
I mean REAL HTTP.
|
|
|
|
|
Go to sourceforge.net and search for "HTTP proxy". There are several projects under work that may suit your needs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I am trying to thorughly test out some image processing code I have developed using GDI+.
I am wanting to test it with bottom-up scanline images, btw. the stride member of the bitmapdata class indicates this.
My problem is where can I get a bottom-up scanline image from!
Cheers
Richard
|
|
|
|
|
all bitmap files are bottom-up scanline. so a LoadBitmap might be what you need.
|
|
|
|