|
I seem to be losing my 'stdin' when I redirect my stdout/stderr (using freopen). Better put, the stdin seems to become flaky...
Does this make sense to anyone?
Is there a better way to get keystrokes from a (DOS/console/Win2k) app than using getch()? w/o using an event loop?
Thanks in advance....!
|
|
|
|
|
has anyone here ever sucessfully implemented smooth drag-n-drop for a listctrl in 'icon' view ?
i've searched the web for days for a way to do it (yes, i've seen codeguru) , but everything i've found and everything i've tried results in horrible flicker.
fyi, the flicker is casued because, in MouseMove, UpdateWindow on the listctrl to redraw what the drag image has uncovered, then i redraw the drag image in the new spot. so, each move, i have to redraw the list, the redraw the drag image.
i've tried all kinds of variations on LockWindowUpdate, DragShowNolock, UpdateWindow, etc... nothing seems to get rid of the flicker.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
there are some articels called flicker free MFC or what. you double buffer your listview and it doesn flicker no more...
btw. anyone knows how to do drag and drop WITHOUT MFC (pure WinAPI)?
|
|
|
|
|
its a bitch apparently
try looking thru the mfc source for the drag and drop they implemented ... it might be a good starting point
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
What all are you doing in your drag? Just moving a drag image over the list, or are you drawing insertion marks, etc.? I've never had serious problems with the first, but *always* get something wrong with the second.
Shog9
--
Maybe Java is kind of like God, it "works in mysterious ways". It seems like your apps are running slowly, because in the backgroud Java is solving world hunger, or finding the cure to cancer.
- Ryan Johnston, Don't die java!
|
|
|
|
|
The same thing I want to do.I have two list views .Left list contains directories,subdirectories and files. I should be able to select some part of the list and should be able to drag and drop into the right pane(or list view) and copy these dirctoris and files into a particular location.How can implement this?Any existing code is there so that I can resuse it in my application?
please help me.I am running out of deadlines.
Thanks in advance.
Pathi
Pathi
|
|
|
|
|
Check out this article, and also the Shell Programming sections.
Shog9
--
Maybe Java is kind of like God, it "works in mysterious ways". It seems like your apps are running slowly, because in the backgroud Java is solving world hunger, or finding the cure to cancer.
- Ryan Johnston, Don't die java!
|
|
|
|
|
it's an icon view, so i don't have an insertion mark.
what i do in OnMouseMove (currently, and it works no worse or better than anything else i've tried):
1. HitTest to see which item the drag is over
2. if it's an item (and not the item we were over the last time), set the new item highlight state and clear the old item's highlight state
3. regardless of hittest:
DragShowNolock(false)
UpdateWindow
DragShowNolock(true)
DragMove
4. then handle the out-of-rect stuff to do an autoscroll effect (this isn't the cause of the flicker, as it only kicks in when you've left the client rect)
i can move the DragShowNolock(false) anywhere before 3, with no effect
i can put the DragMove anywhere with only slight effect. sometimes, i can make it so the drag image is under the list items.
i get a really nice smooth draw if i get rid of both DragShowNolock calls, but then the listview items don't repaint themselves correctly.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
A possibility for you might be to use the technique Windows Explorer appears to use on Win2k and up. Handle the d&d process as you are now, but instead of using the ImageList d&d support functions, create a small window to display the drag image and position it under the cursor. When the mouse moves, do the highlight and reposition the drag window. If running on Win2k and up, you can use the WS_LAYERED style to prevent excessive redraw as portions of the list are uncovered - and as a side bonus do that cool faded-edges effect like Explorer
I might try a test implementation later, will let you know if it works well.
Shog9
--
Maybe Java is kind of like God, it "works in mysterious ways". It seems like your apps are running slowly, because in the backgroud Java is solving world hunger, or finding the cure to cancer.
- Ryan Johnston, Don't die java!
|
|
|
|
|
Talk about your dead thread replies! But i had no need to do drag'n'drop from early 2001 until now, and didn't have the motivation to try anything new. So this monday i finally tried doing a floating pop-up window to show drag images and thus am able to report that it works quite well. While no doubt you long ago either solved your problem or lost all interest, this was the thread that got me thinking about easier/better implementations, so i felt i owed it something.
a more complete writup...
You're one microscopic cog
in his catastrophic plan...
|
|
|
|
|
Hello there.
I have an MFC application running on Windows2K that opens a CDatabase object like so:
CDatabase cDB;
DWORD dwOptions = CDatabase::useCursorLib | CDatabase::noOdbcDialog;
cDB.OpenEx ("DSN";"****";"****", dwOptions);
For some reason though, if I alter the configuration for DSN (using the ODBC admin tool in Control Panel) such that it points to a different server, the application still tries to connect to the first server.
This is odd as, when examining the DSN directly (using the admin tool) it points to the new server alright - it's only when my application uses the above function call that the DSN seems to point to the original server. (And I am restarting the application)
Has anyone ever come across anything like this before??
Hmmmmmm....
Len.
|
|
|
|
|
hi all ... sorry if this is a dumb one yet again but i have been bumbling around for a while going ever so slightly dilly so i figured its time to ask the wise ones
a user clicks an item in a listview control and the item (or whole line) goes dark blue (selected) ... i dont want it to so i tried playing around with the state mask thingy but it doesnt seem to work ... anybody got any clues?
thanks
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
lauren wrote:
anybody got any clues?
:: Jeremy pulls off his black top hat, tips it, and winks. ...a twitch and snap of the fingers... Poof! goes the smoke aloft from the hat. He pulls out a piece of paper, unfolds it, and says... ::
Behold Lauren, the answer:
Subclass the list box's window procedure. Intercept WM_SETFOCUS and return FALSE for it.
Care for some code?
Jeremy Falcon
Imputek
<nobr>"..." - Paul Watson 07-17
|
|
|
|
|
rock and...
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
'twas a bit tricky to find the first time i needed to, but it's suprisingly easy. Handle the LVN_ITEMCHANGING notification, and examine the uChanged member of the NM_LISTVIEW structure referenced. If the change being made is to the LVIS_SELECTED bit, then set the return value to true , otherwise false (true prevents the change from occuring). Example (this prevents selection and drophighlighting)(MFC):
void CMyDialog::OnItemchangingInMyList(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = FALSE;
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if ( pNMListView->uChanged & LVIS_SELECTED || pNMListView->uChanged & LVIS_DROPHILITED )
*pResult = TRUE;
}
Shog9
--
Maybe Java is kind of like God, it "works in mysterious ways". It seems like your apps are running slowly, because in the backgroud Java is solving world hunger, or finding the cure to cancer.
- Ryan Johnston, Don't die java!
|
|
|
|
|
...roll guys!
thnx
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
Hi, I need to exchange numeric and string data between several application types (Visual Basic, VBScript in web pages...) and a Visual C++ COM object; a lot of information should be transfered in any call and simple parameter exchange looks not too smart. What should I do? XML or something else?
Thanks.
"nobody knows it, but you´ve got a secret smile, and you use it only for me"
|
|
|
|
|
dde still works for some apps
xml is a smart extensible way to go tho
depends on the frequency of the data exchanges ... if they are real time it might not be good ... then u would have to go named pipes or something
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
You could put them into a SAFEARRAY and pass it as one argument in a VARIANT.
|
|
|
|
|
Hi,
Is it possible to insert an own icon inside an afxMessageBox, like MB_ICONINFORMATION, etc.
|
|
|
|
|
Check Robert Pittenger's article Add a Help Button to a MessageBox, which replaces AfxMessageBox with a home made version using ::MessageBoxIndirect . Altough not directly supported, the source code in the article shows where you should insert the information necessary to change the predefined icon.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can anyone tell me why the following code causes compile errors?
try
{
int foo = 1+1;
} catch(...)
{
int bar = 11;
}
error C2059: syntax error : 'catch'
error C2143: syntax error : missing ';' before '{'
I have exception handling turned on (command line option /GX) in the project settings.
Any ideas?
TIA,
Pete
|
|
|
|
|
Is your source file named with a .cpp extension?
If it is .c, I think VC++ will assume it is to be
compiled as plain c code.
|
|
|
|
|
Nope, it's got a .cpp extension.
What's confusing me is that it seems to have no problem with the try block, although that may be due to the way the compiler is parsing the file.
|
|
|
|
|
It shouldn't be causing any error. Can you provide more info about where this piece of code is inserted?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|