billroper: (Default)
[personal profile] billroper
So this old piece of code I'm maintaining calls OleSetClipboard and hangs. There's what I needed to make my day complete.

Date: 2005-05-19 09:07 am (UTC)
From: [identity profile] smallship1.livejournal.com
"OleSetClipboard, that OleSetClipboard,
It should do somethin', but won't do nothin',
It just keeps hangin', it keeps on hangin'
Around..."

At which point my techieness fails me. Anyone?

Date: 2005-05-19 12:15 pm (UTC)
From: [identity profile] johnridley.livejournal.com
All I can suggest is to zero all the structures you're passing in, and double-check the argument docs. Watch out for Microsoft's fav trick of setting the first element to the structure size (their weak-ass version of structure versioning) - sometimes there are structs inside the structs that only get referenced if other values happen to be thus and such - zero everything first.

Date: 2005-05-19 01:42 pm (UTC)
From: [identity profile] smallship1.livejournal.com
Okay, well that's the middle eight...

"Zero structures as you pass,
Double-check argument docs en masse,
Watch for structs inside each struct
Or your code will hang and you'll be here all weekend..."

Should I shut up now?

Date: 2005-05-19 01:46 pm (UTC)
From: [identity profile] smallship1.livejournal.com
Oops, here it comes...

"The walls are sweatin', my eyes are strainin',
I'm sick and tired of code maintainin',
And OleSetClipboard, he just keeps hangin'
Around!"

Definitely shutting up now.

Olé!

Date: 2005-05-19 04:07 pm (UTC)
From: [identity profile] filker0.livejournal.com
It's been a while since I was programming Windows to any extent, so I can't really advise on your problem, however I recall trouble with Ole and the clipboard back in the bad old days of Windows NT 4.0. IIRC, you'd end up in a resource deadlock if you didn't clear out the clipboard before attempting to put something in it. The DDE <--> OLE stuff is now so muddled in my mind, and I don't recall whether there was some threading issue wrapped up with it as well.

I doubt that the above recollection is helpful, but I figure I'll give you something to investigate.

Re: Olé!

Date: 2005-05-19 04:13 pm (UTC)
From: [identity profile] filker0.livejournal.com
As I sit and think about it, my recollection is that there's some connection with a callback method (IUnknown::AddRef, I think) that was the culprit... It's been too long, and my Win32+MFC quickref is very much out of date.

Profile

billroper: (Default)
billroper

February 2026

S M T W T F S
1 2 34567
891011121314
15161718192021
22232425262728

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 4th, 2026 09:35 am
Powered by Dreamwidth Studios