From: dgk on
A question about this item:

http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=3574


I installed it, built the solution, and figured that I could just set
a reference to the DLL and use it in my code. Instead of getting one
DLL, each of the five projects in the solution creates an 88k
Microsoft.WindowsAPICodePack.dll. And when I set a reference to any of
them from my program, I can't use the various interfaces and such.

For instance, this code:

Imports Microsoft.WindowsAPICodePack.dll
....
For Each folder as IKnownFolder in KnownFolders.All

The complier doesn't know what IKnownFolder is, nor KnownFolders.All.
If I remove the reference and instead just include the Core and Shell
projects (from the CodePack source) in my solution, it works fine.

That works, I'm happy, but curious as to why I couldn't just reference
the DLL. Probably something pretty basic.
From: Armin Zingler on
Am 18.03.2010 20:32, schrieb dgk:
> A question about this item:
>
> http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=3574
>
>
> I installed it, built the solution, and figured that I could just set
> a reference to the DLL and use it in my code. Instead of getting one
> DLL, each of the five projects in the solution creates an 88k
> Microsoft.WindowsAPICodePack.dll.

Which solution? The one I used is named WindowsAPICodePack and contains
only 4 projects.

The dlls that I see here after building the solution are:

- Microsoft.WindowsAPICodePack.dll
- Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll
- Microsoft.WindowsAPICodePack.Sensors.dll
- Microsoft.WindowsAPICodePack.Shell.dll

> And when I set a reference to any of
> them from my program,

How can you set a reference to any of them if you have 5x the same dll?

> I can't use the various interfaces and such.
>
> For instance, this code:
>
> Imports Microsoft.WindowsAPICodePack.dll

Without .dll:

Imports Microsoft.WindowsAPICodePack

> ....
> For Each folder as IKnownFolder in KnownFolders.All
>
> The complier doesn't know what IKnownFolder is, nor KnownFolders.All.

You must import...:

Imports Microsoft.WindowsAPICodePack.Shell


> If I remove the reference

Which reference?

> and instead just include the Core and Shell
> projects (from the CodePack source) in my solution, it works fine.
>
> That works, I'm happy, but curious as to why I couldn't just reference
> the DLL. Probably something pretty basic.

Above you wrote that you did set a reference to the dll. What happens
if you try to set the reference to the dll?

Well, after setting the reference to Microsoft.WindowsAPICodePack.Shell.dll
and importing the namespace Microsoft.WindowsAPICodePack.Shell, your
For-Next loop compiles w/o a problem here.



--
Armin
From: dgk on
On Thu, 18 Mar 2010 21:04:09 +0100, Armin Zingler
<az.nospam(a)freenet.de> wrote:

>Am 18.03.2010 20:32, schrieb dgk:
>> A question about this item:
>>
>> http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=3574
>>
>>
>> I installed it, built the solution, and figured that I could just set
>> a reference to the DLL and use it in my code. Instead of getting one
>> DLL, each of the five projects in the solution creates an 88k
>> Microsoft.WindowsAPICodePack.dll.
>
>Which solution? The one I used is named WindowsAPICodePack and contains
>only 4 projects.
>
>The dlls that I see here after building the solution are:
>
>- Microsoft.WindowsAPICodePack.dll
>- Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll
>- Microsoft.WindowsAPICodePack.Sensors.dll
>- Microsoft.WindowsAPICodePack.Shell.dll
>...

Is there an emoticon that shows someone hitting themselves in the
head? @(* - nah, not too good.

Thanks, you are, of course, correct. I just missed the other DLLs. If
I set the right references then it all works.

Actually though not all the demo projects work. I'm looking at the
Windows7TrainingKit and I am very pleased that they actually included
VB examples. However with the first lab I tried, TaskBar Managed, the
C# solution compiles and works perfectly but the VB one wouldn't even
compile. It has something to do with the Registration Helper project
that's part of the solution. There are two copies of it and the one in
the solution is missing the assemblyinfo.vb file.

I fixed that but when running through the different functions on the
tabs, two of them fail in the VB version but work in the C# one. I've
tried it on two machines but haven't had a chance to see just what the
problem is.