|
Need to explain the d-heap insertion's complexity in term of big-oh, any idea? I know it is
O(d log^d N), but how it is derived?
Thanks.
|
|
|
|
|
Hi all,
I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code.
Thanks,
Mike
|
|
|
|
|
Add this line to your OnCreateClient method in your CChildFrame class"
MDIMaximize();
|
|
|
|
|
I may have something messed up elsewhere, because that is what I was doing to maximize it before. I tried it in several locations in the OnCreateClient (I already was using this method to set up a splitter window) and I still don't get the buttons or the contol menu in the frame's menu bar. Any other ideas?
Thanks,
Mike
|
|
|
|
|
Try this:
void CChildFrame::ActivateFrame(int nCmdShow)
{
nCmdShow = SW_SHOWMAXIMIZED;
CMDIChildWnd::ActivateFrame(nCmdShow);
}
ActivateFrame is a virtual function, you can use ClassWizard to quickly add declaration and default implementation.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sirs,
do you eventually know why the computer must be restarted 3 times when installing Windows?
Thanks
Bunburry
Education is an admirable thing but it is well to remember from time to time that nothing that is worth knowing can be taught (O.Wilde)
|
|
|
|
|
What Windows?
2K: I remember twice, and NT the Same. But if you are Installing some drivers, is common that you reboot the PC several times.
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Sometimes you run into problems with layered drivers (not the right tech term).
Take for example the PCI Bridge driver. The computer installs the OS, reboots. Detects the PCI Bridge and installs the driver, reboots. This time, it detects the devices that required the PCI bridge, reboot.
That is just an example, probably not 100% true.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Hi,
do you eventually know why the computer must be restarted 3 times when installing Windows?
Bunburry
Education is an admirable thing but it is well to remember from time to time that nothing that is worth knowing can be taught (O.Wilde)
|
|
|
|
|
I've developped a snap-in without using the ATL/COM app wizard. I started my project on a simple DLL and I based myself on the samples on MSDN. And now, I need to add some dialog boxes to my snap-in and I dont know how to include MFC without bugging everything else.
Scoob
|
|
|
|
|
This is probably spelled out someplace obvious, but I sure cannot find it so forgive me if this is too trivial.
I have my own file searching tool that looks at the contents of various Office documents. My tool currently uses some simple Perl script and OLE to dump the files in text format and then processes those text files into an index for later use in an MFC program. And, having expended the effort to do that, I find that "Fast Find" does pretty much the same thing, except that it handles more types of files than my program and it creates the indices about 4 times faster!
So, what I would like to do is be able to get at the text stored in those index files. These are the ones called ffastun0.ffx, ffastun.ffo, ffastun.ffl, and ffastun.ffa.
Somebody must have a C++ class to do this. Or failing that, some example code that can access these files.
I looked at the IFilter stuff referenced in the VC++ help, but it is pretty worthless. At least to me. It seemed to be for creating the index, not using the one already made by FindFast.
Pointers much appreciated.
BTW, I am a COM newbie, so any explanations should use small words.
Thanks!
|
|
|
|
|
I'm writing a DLL that captures live video from a digital video camera. I have a buffer that contains the "image", and I need to copy this image to the clipboard as a DIB.
If I call "SetClipboardData(CF_BITMAP, hBmp)", I get the black rectangle. If I call "SetClipboardData(CF_DIB, hBmp)", I get an error that says the (bitmap?) handle is invalid.
Here's my code so far. When I paste the image into another app, all I get is a completely black rectangle. Can anyone help? Notice, there's no MFC here, and that's the way I'd like to keep it.
if (::OpenClipboard(NULL))
{
::EmptyClipboard();
RECT rc;
HBITMAP hBmp;
HDC hDC;
HDC cDC;
HWND hWnd = myParmsPtr->liveHwnd;
::GetWindowRect(hWnd, &rc);
long lStillWidth = rc.right - rc.left;
long lStillHeight = rc.bottom - rc.top;
hDC = ::GetDC(hWnd);
cDC = ::CreateCompatibleDC(hDC);
hBmp = ::CreateCompatibleBitmap(cDC,lStillWidth,lStillHeight);
HGDIOBJ oldBmp;
oldBmp = ::SelectObject(cDC, &hBmp);
PAINTSTRUCT ps;
::BeginPaint(hWnd, &ps);
int prevMode = ::SetStretchBltMode(cDC, COLORONCOLOR);
::StretchDIBits(cDC,
0, 0, lStillWidth, lStillHeight,
0, 0, lStillWidth, lStillHeight,
cb.pBuffer, (BITMAPINFO*)(&cb.bih),
DIB_RGB_COLORS, SRCCOPY);
::SetStretchBltMode(cDC, prevMode);
::EndPaint(hWnd, &ps);
if (!::SetClipboardData(CF_DIB, hBmp))
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, NULL);
MessageBox(NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION);
LocalFree(lpMsgBuf);
MessageBeep(0);
}
::CloseClipboard();
::SelectObject(hDC, oldBmp);
::DeleteObject(hBmp);
::DeleteDC(cDC);
::DeleteDC(hDC);
}
|
|
|
|
|
You shouldn't delete hBmp. From SetClipboardData docs:
After SetClipboardData is called, the system owns the object identified by the hMem parameter
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I think I have larger problems than that. Removing the line that deletes the hBmp doesn't hve any affect on the previously stated results.
|
|
|
|
|
Do you know for sure the bitmap itself is good before it hits the clipboard ? In situations like this, I grab a screen DC and throw the image to the screen just to make sure that the problem is ( in this case ) the transfer to clipboard and not the HBITMAP itself.
I also know that I've done screen capture programs that capture a frame at a time from the window DC and build AVI's which have failed to capture video from Media Player, if that is any indication. It's almost like it's draw direct to the screen, but not to the screen DC
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Just beginning with MFC,I am trying to implement a toolbar that will appear next to a child window in MDI application. Should I be using CToolbar and where do I put the code to create the toolbar. Any help will be appreciated.
thanks
|
|
|
|
|
Put the code inside CChildFrame::OnCreateClient:
VERIFY(m_toolbar.CreateEx(
this,
TBSTYLE_FLAT,
WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC));
VERIFY(m_toolbar.LoadToolBar(IDR_YOUR_TOOLBAR));
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The code worked but instead of having a toolbar on the top of the child window, I would like a toolbar that appears in the main window whenever a child window is open. So, in the main window, you'll have two windows: the child document and a toolbar. Thanks for the help!
|
|
|
|
|
I have a question.
I've incorporated a couple examples that I've found from CodeProject, compiled, and it seems to be working as expected EXCEPT FOR:
I want to edit cells and it appears the list control is not configured to do so. How do I set the properties for the list control so that I can edit cells?
I created the list control (CListCtrl) using the dialog wizard and have the following properties set:
Styles: View=Report, Sort=None, Edit labes (checked), No Sort Header
More Styles: Border (checked)
Extended Styles: <nothing set="">
Thanks for the help - thanks CodeProject (members) for the examples too.
Johnny
|
|
|
|
|
Look up LVN_BEGINLABELEDIT. You must handle this notification, as the default list control window proc does nothing (so no editing happens).
--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?
|
|
|
|
|
Thanks for the advice and direction.
The examples from CodeProject I used are a combination of the Text Callback example and the List Editor ("Some Text", hex value, <3rd column>).
I fixed my code to replicate the above and the only CListCtrl label edit message it traps is the LVN_ENDLABELEDIT -- a LV_DISPINFO is sent somewhere in the code.
Thanks again. I may post my "finished project" to the group as it help someone else like me.
Johnny
|
|
|
|
|
Can anyone tell me how to REMOVE the buttons from a tabctrl ? Is this even possible ?? I've placed a WTL::CTabCtrl on my dialog with 3 pages inserted, I don't want the tab buttons at the top displayed, I will do the tab flipping in my code.
I looked into using the WTL::CPropertySheet but it won't work for my purposes ... although ... if I can't get ride of the tab buttons I may have to look at it again.
Thanks in advance for any help
Derrick Flannigan
Software Developer
|
|
|
|
|
Maybe I'm but without the tabs there's nothing left.
--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?
|
|
|
|
|
The 'tabs' are still there I just don't want the tab buttons that get displayed at the top of the control ... I know it seems odd I'm thinking it would be the easiest way to flip between 2-3 pages (or panes) of controls contained in a groupbox ....
D
|
|
|
|
|
It sounds like you're expecting the tab control to show/hide controls when you switch tabs, but that's not how it works. All the tab control gives you is the tabs, you still have to handle switching panes/pages/whatever you have in response to the user changing tabs. So even if there were a tabless tab control, it wouldn't save you any work.
--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?
|
|
|
|