|
Oeps, forgot to escape something
value1 <empty> <epmty>
value1 <a value> <a value>
value2 <a value> <a value>
value3 <empty> <empty>
value3 <a value> <a value>
Wim
|
|
|
|
|
My guess is that the list control has one of the sort styles set, but your code expects the list not to be sorting for you.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Good Guess!
Thanks a lot.
Wim
|
|
|
|
|
Hi
what's the best method to add bytes to the *middle* of a binary file?
do i have to read in the data that would otherwise be overwritten, to the end of the file, append the file and then write the data record to a later offset?
Or is there a built in function.....
Cheers
Wills
|
|
|
|
|
Hello? Does anybody know the answer to my question?
Wills
|
|
|
|
|
Sorry, as far as I'm aware, you're going to have to do it the hard way. Read the data in, and dump it all back out with the extra bit in the middle.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
hey peepz, i'm just starting with the doc / view architecture here, seems like a real mess to me. But anyways thats not the point, my question is dumb 'n simple: how do i enable a button i put on the toolbar? they seem to be disabled by default... i cant find any enable/disable code for the other buttons anywhere in the code, yes i know i'm a control freak, can someone also try to explain why there isn't any code for the New document button and menu 'n stuff? i'm really confused...
Thanx
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|
|
to control buttons and menu items, you have to use the UpdateUI stuff. go to calss wizard and find the button/menu item you want on the left side and create an UPDATE_UI handler from the right side. (make sense? )
then in the handler, do something like this:
pCmdUI->Enable(m_bEnabled);
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
If you just draw the toolbar button and the ID of the button isn't assigned a message handler then it also will be disabled. Use ClassWizard and add a new function for the toolbar ID in CMainFrame, CView, or CDocument derived class.
|
|
|
|
|
I make static link library and use it but the problem is that if for example I have CHTMLHelp class in my lib and use it in other project (its includes are in global include file), putting a point after variable of its type not opens its members and functions. But if I add that class header once , compile the roject and remove the header, all functions and methods become visible ! How can I do that all methods of the static link library would be visible at once without such tricks.
|
|
|
|
|
I need to create a MDI Application where there is toolbox's that when are active don't cause the main application window or document window to become unactive. The toolbox's should preferably be modeless dialog boxes. Sort of like Adobe Photoshop.
|
|
|
|
|
Hi,
I want to implement a list control that allows dragging of an item from it and dropping it onto some other window (which may belong to a different app). The text of the item being dragged should get copied into the dropped window if allows drag-drop. Can someone provide some hints in doing this?
Thanks in advance
|
|
|
|
|
|
Hi all,
I want to write API program by VC++,
I create cpp file and i wrote my source code, then i create rc file and i add some icon and ...
Now, i want to create a project that i can add my cpp and rc files to prject.
How can i do this ?
I choosed MakeFile in File->New, and i added my files to project, but when i compile, compiler indicate to me Linker problem in Setting menu !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I think you should post more details on your errors ....
|
|
|
|
|
You should choose a Win32 Application and then tell the wizard you want an empty one - or the simple from which you can remove all the files they supply. Then, add your files to it and recompile.
Hope that helps,
> Andrew.
|
|
|
|
|
Hi Andrew,
Now i got this error:
fatal error C1010: unexpected end of file while looking for precompiled header directive
How can i solve it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
This question is answered in Michael Dunn's Visual C++ Forum FAQ, you can find the answer by clicking here.
> Andrew.
|
|
|
|
|
Hi Mr.Andrew,
Thanks alooooooot for your help ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
i am making a program where i need to constantly check for a change in the state of a socket, and i was wondering if there is any way to draw a dialog box so it allow me to use the OnIdle() function of the main class of my program, or if there is a similar function that is available through the CDialog class. i've tried drawing a modeless dialog, but it won't appear but for a fraction of a second. any help would be greatly appreciated.
-Aaron
|
|
|
|
|
I'm not sure if this is what you mean but if you try creating a second thread and attach a modal dialog box you should be able to create a loop that won't interupt your main application.
|
|
|
|
|
Another option is to handle the WM_KICKIDLE private MFC message, which is defined in afxpriv.h
Your handler for this message would be the equivalent of OnIdle in your main class.
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Hi All!
I'm writing some control in C++/MFC. It is basically ready, and now I'm working on speed it up/optimization. I found that BitBlt operation consumes significant amount of time:
/* sorry I'm writing from my home computer with no C++ installed and no sources, so there may be error in function names/parameters - not relevant to problem.
*/
CToolBtnList::OnPaint()
{ dc = CPaintDC(this); // or something like this...
CRect rect;
GetClientRect(&rect);
CDC memDC;
memDC.CreateCompatibleDC(NULL);
// this one is needed because I want first create
// image on it piece by piece and then copy it to
// PaintDC
CBitmap bitmap, *poldbitmap;
bitmap.CreateCompatibleBitmap(&memDC, etc...);
poldbitmap = memDC.SelectObject(&bitmap);
....
DrawBackground(&memDC);
....
// here I'm calling another my function:
DrawButtonsArea(&memDC);
...
...
/* place 1*/
dc.BitBlt(....., &memDC, ...., SRCCOPY); // one-to-one copy
memDC.SelectObject(poldbitmap);
memDC.DeleteDC();
bitmap.DeleteObject();
}
CToolBtnList::DrawButtonsArea(CDC* pDC)
{ /* and here I'm doing another copy: this is essential,
because I need to have possibility to cut what I've drawn by specific area without affecting other areas
*/
// repeat all the same:
CRect rect;
GetClientRect(&rect);
CDC memDC;
memDC.CreateCompatibleDC(NULL);
// this one is needed because I want first create
// image on it piece by piece and then copy it to
// PaintDC
CBitmap bitmap, *poldbitmap;
bitmap.CreateCompatibleBitmap(&memDC, etc...);
poldbitmap = memDC.SelectObject(&bitmap);
/* place 2*/
memDc.BitBlt(....., pdc, ....,SRCCOPY); // one-to-one copy
....
....
/* place 3*/
pdc.BitBlt(..., &memDC, ..., SRCCOPY); // this is cutted copy - not one-to-one
}
I'm calling Invalidate() each time when mouse moves to specific location (another "button" inside of control).
On silly test to call Invalidate() each 100ms (which is quite reasonable in my case) I found that my thread consumes 30% of processor time (which is unreasonable).
If I'll take out that 3 places (so I'm doing all other work, just don't do that copying), it goes down to 0% or 1% - even with all (~20) animated GIFs fooling around in worker thread.
Next tests showed that BitBlt operation _to_ PaintDC eats about 6% of processor time, and BitBlt operation _from_ PaintDC to memoryDC eats 15%-20% of processor time (which I can't understand: this is the same function with almost exactly same amout of data).
In archives here I found ::CopyImage function and will try it Monday at work, but I still doubt it can improve performance.
I understand that DIB processing will be faster, but I need DC functions to draw (line, ellipse, etc), so it will not work. How else can I speed this section up?
I'll try eliminate first copy to memDC (in OnPaint function), but I'm afraid it will be flickering.
Any other suggestions? How can I _directly_ copy data from one bitmap to another in memory without going to DC, and do it most efficient way without using DIBs? (something like memcpy ).
Any help will be appreciated.
Oh, by the way, I've tried GetBitmapBits and SetBitmapBits, and also I've tried bitmap<->DIB conversion (GetDIBits and SetDIBitsToDevice) - absolutely same speed
SY-
Kosta.
Kosta - wolf alone.
|
|
|
|
|
I am creating a CTreeCtrl derived class, that will act similiar to the left side of Windows Explorer. I need to do some initialization (like display the drives) as soon as possible, which is right after the window is shows. What message, or function do I need to catch/override in order to do this.
Thanks, John
|
|
|
|
|
OnInitialUpdate
Bret Faller
Odyssey Computing, Inc.
|
|
|
|