Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Thu, 29 May 2008 14:02:01 -0700,    group: microsoft.public.platformsdk.shell        back       


is this shell programming?   
Hi All,

Let me begin by saying that I am a C# developer and I need some help 
figuring out C++ code. I have no idea if the following code is shell 
programming code or native C++.

==================

Image* ThumbnailExtractor::GetThumbnailImage(String* fileName, int 
longestEdge, int colorDepth)
{
  // allocate some unmanaged memory for our strings and divide the file name
  // into a folder path and file name.
  IntPtr dirPtr = 
Marshal::StringToHGlobalUni(Path::GetDirectoryName(fileName));
  IntPtr filePtr = Marshal::StringToHGlobalUni(Path::GetFileName(fileName));
  WCHAR* wDirName = static_cast<WCHAR*>(dirPtr.ToPointer());
  WCHAR* wFileName = static_cast<WCHAR*>(filePtr.ToPointer());

  IShellFolder* pDesktop = NULL;
  IShellFolder* pSub = NULL;
  IExtractImage* pIExtract = NULL;
  LPITEMIDLIST pList = NULL;
  Bitmap* pImg = NULL;

*** rest of the code follows here ***

}

==========

So is this shell programming? I am trying to understand what Image*, 
String*, WCHAR*, IntPtr mean and which namespace or header file do I need to 
include to use them?

Again, please pardon my ignorance.
date: Thu, 29 May 2008 14:02:01 -0700   author:   Diffident

Re: is this shell programming?   
>Let me begin by saying that I am a C# developer and I need some help 
>figuring out C++ code. I have no idea if the following code is shell 
>programming code or native C++.

The language is C++/CLI.

As to whether you'd call it "shell" programming depends on what you
think that term may mean - what does the code do eventually?

>So is this shell programming? I am trying to understand what Image*, 
>String*, WCHAR*, IntPtr mean and which namespace or header file do I need to 
>include to use them?

If you look them up in MSDN, they're all documented - for instance,
the method you showed exists as Image::GetThumbnailImage in MSDN, but
you'd normally call it, whereas your code looks like an implementation
of it - possibly for your own graphic file format?.

Dave
date: Thu, 29 May 2008 22:34:26 +0100   author:   David Lowndes lid

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us