|
It's a long time I was last on codeproject.com, therefore i'm not up-to-date
I'd like to know whether someone already programmed
menus that look like the one's in Office XP. I didn't find any resources on this side.
Thanks in advance
|
|
|
|
|
Its not free, but the BCGControlBar library does a good job of them.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Its not free
It depends on the type of project you'll be working on. If it will be freeware then the license is free, otherwise it will cost you.
|
|
|
|
|
Hi, I am trying the following code to enumerate child windows of Start Menu. However, it doesn't seem to work. Could you take a look and tell me what I did wrong or is there another way to do it. Thank you very much.
RECT rcMenu;
BOOL CaptureMenuToClipboard(BOOL fIncMouseCursor, BOOL fIncMenuBar)
{
/*BOOL bSuccess = FALSE;
POINT ptStartMenu;
ptStartMenu.x = 1;
ptStartMenu.y = 1;
HWND hStartMenu;
HWND hShellTrayWindow = FindWindow("Shell_TrayWnd", NULL);
hStartMenu = ChildWindowFromPoint(hShellTrayWindow, ptStartMenu);
if (EnumChildWindows(hStartMenu, (WNDENUMPROC)EnumChildProc, NULL))
bSuccess = TRUE;
if (bSuccess)
{
if (!CopyScreenToClipboard(NULL, &rcMenu, fIncMouseCursor))
bSuccess = FALSE;
}
return bSuccess;*/
}
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
BOOL bFlag = FALSE;
if (GetWindowRect(hwnd, &rcMenu))
bFlag = TRUE;
return bFlag;
}
|
|
|
|
|
What do you mean by "enumerate child windows of Start Menu"? the start menu button does not have any child windows, unless you mean the menu, but it will not exist until you depress the start menu button(though its probably cached somewhere).
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hi, I am trying the following code to enumerate child windows of Start Menu. However, it doesn't seem to work. Could you take a look and tell me what I did wrong or is there another way to do it. Thank you very much.
RECT rcMenu;
BOOL CaptureMenuToClipboard(BOOL fIncMouseCursor, BOOL fIncMenuBar)
{
/*BOOL bSuccess = FALSE;
POINT ptStartMenu;
ptStartMenu.x = 1;
ptStartMenu.y = 1;
HWND hStartMenu;
HWND hShellTrayWindow = FindWindow("Shell_TrayWnd", NULL);
hStartMenu = ChildWindowFromPoint(hShellTrayWindow, ptStartMenu);
if (EnumChildWindows(hStartMenu, (WNDENUMPROC)EnumChildProc, NULL))
bSuccess = TRUE;
if (bSuccess)
{
if (!CopyScreenToClipboard(NULL, &rcMenu, fIncMouseCursor))
bSuccess = FALSE;
}
return bSuccess;*/
}
BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM lParam)
{
BOOL bFlag = FALSE;
if (GetWindowRect(hwnd, &rcMenu))
bFlag = TRUE;
return bFlag;
}
|
|
|
|
|
Does anyone have any suggestion, tips, or code snippets on how to do a AutoScroll(automatically scrolling the scroll bar to capture entire client area content) Screen Capture on Client Area Window? Thank you very much.
|
|
|
|
|
Hi there,
I am able to capture pop-up menu using this code.
HWND hPopupMenu = FindWindow("#32768",NULL);
if (hPopupMenu && IsWindowVisible(hPopupMenu))
GetWindowRect(hPopupMenu, &rcMenu);
This doesn't work for Microsoft Office Products and Windows Explore 'cause their menus are not standard menu. For instance, Microsoft Word. I am trying this. I used Spy++ to find out the class name and window caption for the menu bar. I tried FindWindow("MsoCommandBar", "Menu Bar") on Microsoft Word. It doesn't work at all. Could someone give me some pointers how to capture pop-up windows from Microsoft Office Products and Windows Explorer. Thank you very much. Will EnumChildWindows or EnumThreadWindows API functions help for this case? If so, could you gimme some tips. Thank you again.
|
|
|
|
|
whose class name should be "MsoCommandBarPopup"
|
|
|
|
|
Can anyone tell me why the MIDL compiler expands boolean and wchar_t
types to char and short in type libraries instead of unsigned char and
unsigned short as they are declared?
|
|
|
|
|
In an application I'm working on I just got a messagebox with the following:
<br />
The exception Breakpoint<br />
A breakpoint has been reached<br />
(0x80000003) occured in the application at location...<br />
"The exception Breakpoint"???
I have never seen that one before, anyone knows what that is?
Behind that messagebox, another one pops up saying:
Debug Assertion Failed in dbgheap.c
Expression: -pFirstBlock == pOldBlock
Well, the last one I can understand, but again, anyone out there that knows woth the first one meens?
The funny thing is that when it's running under the debugger it never happens, but when I run the debug version, this happens.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
The code asserted; that exception was caused by an int 3 . That also explains why it only happens in the debug build.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
It also happens in the release version.
But why don't it happend under the debugger. I have also tried with Purify NT, and it finds nothing...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
hmm, well there's still an int 3 in there somewhere that's getting hit. VC must be handling the exception itself - watch the Debug window and see if it shows any first-chance exceptions.
You can make VC break when it gets that exception. Start the app under the debugger, click Debug->Exceptions. Add a new handler - Number=800000003, Name=Breakpoint, Action=Stop Always
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
Thanks Mike, I'll try that.
This one have really bugged me for a couple of days now
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I just found the bug. It was a really stupid one
I'm using several threads, but was linking to the singlethreaded lib's...
Anyway, thanks for your help
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders
Are linking the debug build with any release libraries? Possibly a third party lib for which you only have the release version?
|
|
|
|
|
nope, right now the app. only uses windows.h, winsock2.h and tchar.h
It's still in the very erly start of my project, it's only 1.800 lines code right now...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello, the codeguru around the world.
I don't think that the debugger is the powerful tool to check the error
of the heap memory allocation in VC++.
You had better check the code if you use the heap allocation function
like alloc by the right library or on the version of Windows OS.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
That's why I also tried running it under Purify NT, but it finds nothing...
- Anders
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello !
I have a problem with compiling my ADO connection as release
build
I will get this message as follows (in release build):
error LNK2001: unresolved external symbol "public: void __thiscall CDbAdoDoc::GenerateError(long,unsigned short *)" (?GenerateError@CDbAdoDoc@@QAEXJPAG@Z)
DbAdoView.obj : error LNK2001: unresolved external symbol "public: class CCustomRs * __thiscall CDbAdoDoc::GetRecSet(void)" (?GetRecSet@CDbAdoDoc@@QAEPAVCCustomRs@@XZ)
Release/DbAdo.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
DbAdo.exe - 3 error(s), 6 warning(s).
It seems that its only possible to compile with the debug library.
There is no problem running the program in debug-build.
The header-file only is used in the post class.
I have tryed various settings with the compiler switches
without any positive result.
I created this project in Visual Studio C++ 6.0 enterprise.
The database is access.
The same result with MYSQL and ORACLE.
Is there anybody with an solution
Thankyou in advance
Thomas
|
|
|
|
|
How can I add a new table to an existing Daodatabase?
Thanks.
Richard
|
|
|
|
|
Try to use "createNewTableDef"
function:
BOOL createNewTableDef(CDaoDatabase * pDatabase, CDaoTableDef **ppTableDef,CString strTableName)
{
if (pDatabase == NULL)
return FALSE;
// construct tabledef
*ppTableDef = new CDaoTableDef(pDatabase);
// failed to allocate so exit
if ((*ppTableDef) == NULL)
return FALSE;
// no duplication, so create the tabledef if possible
TRY
{
(*ppTableDef)->Create(strTableName);
}
CATCH (CDaoException, e)
{
// construct a meaningful message
CString strMessage = _T("Couldn't create tabledef--Exception: ");
strMessage += e->m_pErrorInfo->m_strDescription;
AfxMessageBox(strMessage);
// indicate failure
bCreateFailed = TRUE;
// delete the tabledef on failure
if (*ppTableDef != NULL)
{
delete *ppTableDef;
*ppTableDef = NULL;
}
}
AND_CATCH (CMemoryException, e)
{
// output status
AfxMessageBox(_T("Failed to create tabledef--Memory exception thrown."));
// indicate failure
bCreateFailed = TRUE;
// delete the tabledef on failure
if (*ppTableDef != NULL)
{
delete *ppTableDef;
*ppTableDef = NULL;
}
}
END_CATCH
// return TRUE if creation succeeds
return (!bCreateFailed);
}
|
|
|
|
|
What's the difference between Interface and dispInterface?
|
|
|
|
|
A dispatch interface is used mainly so late binding languages can discover and use your objects methods.
|
|
|
|