The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
was thinking about this after switching off last night,
one possibility is usually when you pass struct/string/buffer parameters to interop you need to allocate and copy the source data into unmanaged memory. (I'm guessing at least one string/pathname in this case)
i.e. use Marshal.AllocHGlobal. otherwise the other processes (explorer) cant see the data (or only see corrupted remnants if they partially see into common space.)
In cases where they are returning a string yes I do. Here the marshalling is correct. I've got a talent for it, probably because I come from a C++ background.
This api call doesn't return a string, but another one i call returns one, and it's a path, so to be safe I preallocate 521 chars which is MAX_PATH*2 +1 for the null sentinel just to be absolutely sure.
So yeah. I've got the marshalling squared away. this is just a dark corner of the shell api that isn't very well documented - its' relatively recent. Since win7 i think when the shell underwent a bunch of internal changes.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
I remember someone at MS at one point had put together some small C# library that wrapped a bunch of new shell functions that were introduced, I think, with Windows 7, and jumplist support (which I believe is what you're after) was part of that. If SHAddToRecentDocs doesn't work, maybe you'll have better luck with this--maybe there's some sort of initialization you have to do that this library takes care of under the covers. Unfortunately MS never really supported it, and went so far as to remove from its own site and has pretty much been in denial about whether it ever existed or not.
[After some digging]
Found it in my own archive. They called it the Windows API Code Pack, and the last version was 1.1. There's a discussion here on SO about it. Seems like it's now on GitHub--unsupported, but available. I can't vouch for that version however.
The Microsoft function does not work as advertised. Who coulda known?
When has it ever been different? Microsoft has never released anything that actually worked. Their business model has always been:
1. Make something that almost works and sell it,
2. Correct some defects and charge for the fix by giving it a new release number.
3. Render it unsupported, and charge a huge fee for the new version, which really isn't much better than the old one.
Once upon a time, Microsoft actually shipped products with a manual and links to sources who like to work on the damned things. No more, sad to say...
so couple of years ago bought a HP multifunction printer,
really only use it once a month or less
worked fine, replaced the 3 color cartridges once
then the black ran out. OK, new black (free extra when bought),
printer went about auto-aligning, and error message
switch off, wait, switch on, aligning, error message.
switch off, re-seat cartridges, switch on, same
it's dead. and yes, it's out of warranty.
OK, time to look for another printer. price range: cheap - mid $
inkjet: cheap but these days all crap build quality, expensive ink (that dries if little used)
inktank: expensive (ffs, it's the same thing with a bit of tubing), cheap ink, ink won't dry up but the heads will
laser: used to be reasonable but catching the same diseases as above-mentioned.
the manufacturers suck:
HP wants you on ink subscription (even worse numbers than ms office one-time vs o365)
brother: if just one tank empty the printer stops (yup no b&w if say only the pink is out.)
cannon: "cheap toner", but users report maybe 50 pages if lucky before they run out again
lesser brands: all have one or more of the above too
- not one [I'll be frank here] honest supplier anymore.
here's a treat: those new ink tank printers - the ink really is cheap, claimed as cheapest price per page, until...
they all have a "waste cartridge" as well, it's not cheap, and even more NOT user replaceable. ... must be sent to the service dept for replacement (and by then your model out of date it'll cost more then the printer did, more than a brand new printer.)
Summary of findings:
1. Cheap to mid price printers: all (yes really! every single one of them, even the eco/tank models) have some form or other built-in / by design obsolescence anything from a year to 3 (depending on warranty - not joking, it's planned).
2. NONE of the review sites, toms, techradar, pcmag..., not one even hints at that, still handing those pieces of junk 4.5 - 5 out of 5 stars and quoting price per page, lifetime tco and other stats based / extrapolated on very small very limited [manufacturer's] tests.
Fake news has nothing on the amount of bullshit [paid] review sites pump out.
oh, and if you're interested I've settled on the cheapest model **rox multi function laser. it's B&W only, that's fine - from almost a whole day of research it's the most reasonable (and surprisingly cheap) printer with a semi-reasonable lifespan and decent [real] lifetime tco.
(For color / quality / quantity I'll [continue to] "borrow" printer use at clients.)
Recognizable, as I don't print very often the inkjet cartridges always dried out. I finally got so fed up that I bought a Sam**** color laserprinter that now works for years without any printing problems.
And every time I want to use it, I turn it on, it prints, I turn it off.
Only problem was making a cover to prevent the cat shredding the rollers, shedding into it, and dropping grit / water / dandruff into it.
Wish I'd done it years ago - would have probably saved money, and definitely saved a lot of hassle.
I think you suggested the Samsung?
Sent from my Amstrad PC 1640 Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!