Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Adding Files/Links To Projects

Reply
 
Old 09-05-2008   #11 (permalink)
Jeff Gaines


 
 

Re: Adding Files/Links To Projects

On 05/09/2008 in message <uwsnnkxDJHA.4760@xxxxxx> Pavel
Minaev wrote:
Quote:

>If you mean CharSet.Ansi vs CharSet.Unicode (or MarshalAs(UnmanagedType)),
>then it shouldn't, either. If you mean something else, then I'm curious
>what it is.
I have just picked one up. In my HDITEM structure I had pszText as a
string and it worked fine under x86 but failed under x64. I have added
[MarshalAs(UnmanagedType.LPWStr)] and it now works fine under both.
Another was using HDM_SETITEMA which works under x86 but not x64, changing
it to HDM_SETITEMW works under both. A lot of these definitions will have
been carried forward from VB6 days and I only change them if/when they fail.
Quote:
Quote:

>>I can't really analyse it in detail because if it fails I go right back to
>> basics and update the prototype completely. It's the greatest of pities that MSFT didn't include namespaces for all their dll's (or at least put prototypes in the help file)
>
>You should have a look at the P/Invoke Interop Assistant:
>http://www.codeplex.com/Release/Proj...eleaseId=14120
I do use that but as long as it's people like me putting the definitions
up there some will be wrong! We really could do with MSFT releasing
standard prototypes, I am sure I had a file of them once from MSFT, I'll
have to try and find it.
Quote:
Quote:

>>but then VS is not really s desktop development environment if you want to
>> do any serious work.
>
>This is a rather strange statement. Lots of desktop applications are
>developed using VS and C#; what, in your opinion, is mising to make it a
>"desktop development environment"?
Access to the dll's, Interfaces, structures etc. It's like VB6 leaving you
to prototype them yourself. At least a couple have crept in recently in
System.Runtime.InteropServices.ComTypes but where is IContextMenu (and 2 &
3) and the most common one for me IShellFolder? And, of course, #include :-)

--
Jeff Gaines Damerham Hampshire UK
"Why is it that when we talk to God we're said to be praying,
but when God talks to us we're schizophrenic?"

My System SpecsSystem Spec
Old 09-05-2008   #12 (permalink)
Pavel Minaev


 
 

Re: Adding Files/Links To Projects

"Jeff Gaines" <whitedragon@xxxxxx> wrote in message
news:xn0futevj1k9qmt002@xxxxxx
Quote:

> I have just picked one up. In my HDITEM structure I had pszText as a
> string and it worked fine under x86 but failed under x64. I have added
> [MarshalAs(UnmanagedType.LPWStr)] and it now works fine under both.
> Another was using HDM_SETITEMA which works under x86 but not x64, changing
> it to HDM_SETITEMW works under both. A lot of these definitions will have
> been carried forward from VB6 days and I only change them if/when they
> fail.
I wonder... could it be that x86 Win32 API DLLs only offer Unicode entry
points, and not ANSI ones? I can't really think of any reason why it might
work differently...
Quote:

> I do use that but as long as it's people like me putting the definitions
> up there some will be wrong! We really could do with MSFT releasing
> standard prototypes, I am sure I had a file of them once from MSFT, I'll
> have to try and find it.
Unfortunately there's no such thing... I've raised this issue with MSFT
before, and apparently they are not interested with providing "official"
P/Invoke definitions for Win32 API, with .NET or separately.
Quote:

> Access to the dll's, Interfaces, structures etc.
You mean unmanaged DLLs? A lot of desktop apps don't need that sort of thing
at all - ideally, when you write an app in C#, you just use the managed
assemblies, and don't have all that headache. Of course, we aren't quite
there yet, but even so, there aren't that many scenarios where P/Invoke or
COM interop is really needed in a .NET app today.

Keep in mind that as far as Microsoft is concerned, COM is a legacy binary
interface.


My System SpecsSystem Spec
Old 09-05-2008   #13 (permalink)
Jeff Gaines


 
 

Re: Adding Files/Links To Projects

On 05/09/2008 in message <eKiFRY1DJHA.4104@xxxxxx> Pavel
Minaev wrote:
Quote:

>You mean unmanaged DLLs? A lot of desktop apps don't need that sort of
>thing at all - ideally, when you write an app in C#, you just use the
>managed assemblies, and don't have all that headache. Of course, we aren't
>quite there yet, but even so, there aren't that many scenarios where
>P/Invoke or COM interop is really needed in a .NET app today.
I guess it depends what you write. Much of my stuff revolves around File
Management and I want masked system icons, the Explorer context menu etc.
Quote:

>
>Keep in mind that as far as Microsoft is concerned, COM is a legacy binary
>interface.
Indeed, but where's the replacement...

--
Jeff Gaines Damerham Hampshire UK
Indecision is the key to flexibility
My System SpecsSystem Spec
Old 09-06-2008   #14 (permalink)
Pavel Minaev


 
 

Re: Adding Files/Links To Projects

"Jeff Gaines" <whitedragon@xxxxxx> wrote in message
news:xn0futhn61nzli1003@xxxxxx
Quote:
Quote:

>>You mean unmanaged DLLs? A lot of desktop apps don't need that sort of
>>thing at all - ideally, when you write an app in C#, you just use the
>>managed assemblies, and don't have all that headache. Of course, we aren't
>>quite there yet, but even so, there aren't that many scenarios where
>>P/Invoke or COM interop is really needed in a .NET app today.
>
> I guess it depends what you write. Much of my stuff revolves around File
> Management and I want masked system icons, the Explorer context menu etc.
Ah yes, the Shell APIs - one of the COM strongholds in the Win32 land
Quote:
Quote:

>>Keep in mind that as far as Microsoft is concerned, COM is a legacy binary
>>interface.
>
> Indeed, but where's the replacement...
Well, .NET supposedly is, it's just that functionality from a lot of system
APIs isn't covered (yet?). Though remember the promises, a few years ago,
that Longhorn/Vista was going to be .NET-based throughout, with .NET APIs as
native ones, and all the unmanaged APIs as wrappers around the former. I
wonder if that sort of thing is still in plans for some future Windows
version...


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Adding links to the RIGHT side of the start menu... Vista General
Re: DLL.config files and MSI Deployment Projects .NET General
IE7 won't open links to wmv/mpg files Vista General
adding files to pre-existing CD with files on it Vista music pictures video
Adding Links to the Links field in IE7 Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46