|
You could try calling SetLayeredWindowAttributes() for each child window, but I don't think it would work. I may be wrong though.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thank you, but unfortunately it doesn't work.
|
|
|
|
|
I didn't think it would. I think you're attempting something that Windows does not support. You might have to implement the transparency yourself if you really need this feature. It's not standard and may very well confuse some users.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
|
How does the program determine which items are selected? One solution is to determine the selected items in the on item change handler. Thus, item insertion will cause windows to send an item change message.
Kuphryn
|
|
|
|
|
I use
int index = GetNextItem(previous_index, LVNI_SELECTED);
to get the selected item.
With the OWNERDATA style, I don't have to insert items into the list view control using InsertItem. Rather, I just add items in the underlying container and call SetItemCount() on the control with the number of items.
Say, I was at index 0, and a new item was added at the top of the container. Now the selected index is still 0, but the item that is at that index is the new item. The same problem occurs when the container is sorted.
The only option I can think of now, is to get the object that is in the container at the index before changing it, and then find the index of same object in the modified container, and selecting that item from the code, and then make sure that the item is visible.
I was looking for an easier solution to this
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
One solution is to update the index database that holds the selected items. Here is one example.
Selected indices:
2
3
5
8
10
13
15
- insert new item at index 0
Now using STL, one solution is to determine where the item was inserted and update the index database.
Updated selected indices:
3
4
6
9
11
12
16
Kuphryn
|
|
|
|
|
I am trying to get RTF text into an MS Word document, using automation. I have a method which works fine, whereby I write the rtf to the file, then call the Range object's InsertFile() method. However, this is a little slow, to say the least.
Any ideas on how I could transfer my text quicker?
Thanks in advance!
|
|
|
|
|
Word's automation is extremely slow for anything You can get a bit of a speedup by preventing the changes to be shown by setting Application.ScreenUpdating to false while you insert the file, but this only really works when you're performing more than one operation. Other than this, there's not much you can do.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi All
i have a CListView project, i would like to capture whats in my list
view and output if for printing, i know i need some kind of pointer to
my list view but im a bit stuck, on what to put in my OnDraw(CDC* pDC)
function to capture whats there
please help
thakns in advance
si
void CCallParentsView::OnDraw(CDC* pDC)
{
}
|
|
|
|
|
Your OnDraw(0 procedure is part of the window which contains the control, so yuo shoul dbe able to do either of the following:
CListCtrl *pCOntrol = static_cast < CListCtrl* > (GetDlgItem(ID_OF_CONTROL));
or just use the control that was mapped with DDX_Control() call.
You can then loop round using the item count etc. Take a look at some of my printing articles for some tips on printing.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
hello bies
I heard lot more about static functions that it access only static variable
it count the number of objects created... and so on
But still i a am unable to known in which condn it shpild be used can any one give me details with small code would apprecitaed
|
|
|
|
|
They are used whenever you have multiple instances of an object, but only want one instance of a particular function. Callback functions are another example.
|
|
|
|
|
Well,
Dear DavidCrow
u say Callback is the example of Static function
callback fuctions r genrally used for repeated works in which we stored the address of the origin and get back after doing some manupulation..
How u relate all these to static functions.
pls explain...
|
|
|
|
|
class A
{
static int compare( const void *arg1, const void *arg2 );
void SortEm( void );
};
void A::SortEm( void )
{
qsort(..., compare);
}
|
|
|
|
|
I have a Windows Service created with ATL ComAppWizard.It supports multi-threaded paartments(Run() function of the service has called CoInitializeEx(NULL
|
|
|
|
|
Hope someone can help. I am trying to keep the check mark on my menu item updated. The menu item opens a modeless dialogue depending on the status of the member variable i.e.
m_nCommsToggleState = m_nCommsToggleState == 0 ? 1 : 0;
toggles this variable in the handler for the COMMAND_UI.(The handler then creates or destroys the modeless dialogue) message, and then the UPDATE_COMMAND_UI, calls the SetCheck member function turning on or off the check mark.
The problem is that this works fine when I am turning the dialogue on and off with just the menu, but when I use say the close cross on the dialogue the check mark remains. How do I get the WM_CLOSE handler to call the Update function and clear the check mark?
I am handling the UPDATE_COMMAND_UI message in my view class and the modeless dialogue has it's own class.
I think I should be able to use the same message handler for updating the menu item wether the dialogue is closed using the cancel/cross button or the menu but i can't work out how from the docs. Sorry if this is a dumb question I'm quite a newbie!
Thanks
A
|
|
|
|
|
All you need to do is update the value of m_nCommsToggleState. The UPDATE_COMMAND_UI handler should do the rest. If you try to remove the check mark without changing m_nCommsToggleState, the handler will put the check mark back again.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I'm a beginner in C++ and Visual C++ development. I'm trying to create a dialog window based on tab control. To do that I found a class (on this site) named CXTabCtrl.
Now I would like to get back my parameters defined in each window to the main window: it means
+ I have a tab control dialog.
+ inside this dialog, I defined two dialog boxes.
+ in each dialog boxes, I defined several parameters like the name of the file to deal with...
When I launch the tab control window, I would like to have all the paremeters available.
Could you tell me how I can define the variable in the simple dialog box to be available in the main dialog box (Tab Control box)?
|
|
|
|
|
you should use the CPropertySheet (easier to maintain), and then it's easy to get access to the children dialogs (CPropertyPage's).
Hope this helps.
|
|
|
|
|
Hi,
I am searching for a good tutorial on "How to use odbc with text file".Any example with source code will be quite helpful.
Regards.
Gajendra Sharma
|
|
|
|
|
What you need to do is to properly configure the DSN. This includes selecting the directory and defining the layout of each file that you will want to query. Be aware that the standard MS ODBC Text File driver operates in a read-only manner and does not use any form of indexing (Table Scan every time!).
|
|
|
|
|
Having brought a dynamically linked mfc app to a site which does
not have any of the mfc libraries, I wonder if anyone knows
of a site that you can download the mfc libraries from.
I am looking specifically for mfc7oud.dll but it strikes me that
this would be a useful service anyway and that if there are
no licencing problems that maybe even the codeproject could
offer a selection of these libraries for download?
|
|
|
|
|
That's the debug version of the mfc7ou.dll library. If you're distributing your app, you need to build the release version. I don't think you can legally distribute the debug version of the libraries, and you wouldn't want to anyway. You are allowed to distribute the release version that you got with Visual C++.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks for the reply, the app is in testing at the moment hence the debug version.
Dont suppose you could email me mfc7oud.dll to ssmith2@fsmail.net, it would be very useful.
many thanks
|
|
|
|