|
if when compiling ,there is a error
vivid
|
|
|
|
|
Hello,
Whether two functions should be overloaded or not should not be determined by the parameter list. Functions should only be overloaded if they do the same thing with different parameters!
The following example illustrates:
class DoOverload
{
public:
void AddOneInteger(int nValueToAdd);
void AddTowIntegers(int nVal1, int nVal2);
void AddInteger(int nVal1);
void AddInteger(int nVal1, int nVal2);
};
class DontOverload
{
public:
void DoFoo(int i);
void DoBar(int i);
};
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
if
void AddInteger(int nVal1); int AddInteger(int nVal1, int nVal2);
the two funciton belong overload?
vivid
|
|
|
|
|
Hello,
Yes, the term would be that AddInteger() is overloaded for one parameter and for two parameters.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
no,my meaning is void AddInteger(int a) and int AddInteger(int a,int b);
their return type is different,they belong to overload?
thanks
vivid
|
|
|
|
|
Hello,
Your return type can be different as long the function is overloaded by parameters.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Does anyone know how to get another "virtual folder" to My Compuer? What I mean is something like the Recycle Bin. - not visible to the user directly, but can be accessed via that icon in the Explorer.
Live long and in prosper
johny74656@gmail.com
|
|
|
|
|
|
I have the following Image Object loaded from BITMAP HANDLE
Image *image = Bitmap::FromHBITMAP(hBitmap,NULL);
I need to get the Image size in bytes, how can I do this?
|
|
|
|
|
since you have the hBitmap, i suggest you use:
CBitmap::GetBitmap(BITMAP)
the BITMAP structure contains the necessary information you desire...
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
the problem i do resize for image
image = ScaleByPercent(image,50);
so image will have a new size , then i saved the image object into IStream object as following :
<code>
CLSID encoderClsid;
GetEncoderClsid(L"image/jpeg", &encoderClsid);
image->Save(pStream,&encoderClsid,NULL);
</code>
any suggestion in getting the scaled image size in bytes.
<b>ScaleByPercent Function</b><code>
Image* ScaleByPercent(Image *imgPhoto, int Percent)
{
float nPercent = ((float)Percent/100);
int sourceWidth = imgPhoto->GetWidth();
int sourceHeight = imgPhoto->GetHeight();
int sourceX = 0;
int sourceY = 0;
int destX = 0;
int destY = 0;
int destWidth = (int)(sourceWidth * nPercent);
int destHeight = (int)(sourceHeight * nPercent);
Bitmap *bmPhoto = new Bitmap(destWidth, destHeight);
bmPhoto->SetResolution(imgPhoto->GetHorizontalResolution(),
imgPhoto->GetVerticalResolution());
Graphics *grPhoto = Graphics::FromImage(bmPhoto);
grPhoto->SetInterpolationMode(InterpolationModeHighQualityBicubic ) ;
RectF destRectA(destX, destY, destWidth, destHeight);
Unit srcunit = UnitPixel;
grPhoto->DrawImage(imgPhoto,destRectA,sourceX,sourceY,sourceWidth,sourceHeight,srcunit,NULL,NULL,NULL);
return bmPhoto;
}
</code>
|
|
|
|
|
|
Hi all,
I am real desperate here cause there aren't any good documentation regarding the matter...
i am interested to launch windows explorer via code or command line, to be opened in my desired folder, in a 'film strip' mode...
heard i can use IFolderView or other shell objects, but couldn't find any good sample of doing such...
can any1 please show me piece of code on how it can be done?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: in a 'film strip' mode...
What's this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
if you are using winXP,open My Documents-->My Pictures, choose in the 'View' Menu 'Film strip'
it shows the pictures in a special way, in the bottom, small thumbnails of the picture and in the middle, the selected picture in large...
i want to open such a window programatically (c++ or by command line)
really need help here
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
|
it comes with winXP sp2....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
All you have to do is send the SHELLDLL_DefView window a WM_COMMAND message with a command ID of 0x702f.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
any chance of piece of code?
thanks for all the help
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
|
thanks for the link,
the link refers to OpenFile dialog, and i want to launch 'explorer.exe' (using CreateProcess or ShellExecute or any other method) and then tell it to open in a 'Film strip'
help??
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Had it been anything other than explorer.exe, the answer would have only been five minutes away. However, explorer.exe is different in that it doesn't, by default, start a new application each time. It gets its own thread but within an already existing process. To work around this, a registry change was required. Create the following DWORD key:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"DesktopProcess"=dword:00000001
This code will now open Windows Explorer in 'filmstrip' view:
HWND _hWnd = NULL;
BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam )
{
DWORD dwProcessId;
GetWindowThreadProcessId(hWnd, &dwProcessId);
if ((DWORD) lParam == dwProcessId)
{
char szText[256];
if (::GetWindowText(hWnd, szText, sizeof(szText)) > 0)
{
char szClass[256];
GetClassName(hWnd, szClass, sizeof(szClass));
if (lstrcmp(szClass, "CabinetWClass") == 0)
{
_hWnd = hWnd;
return FALSE;
}
}
}
return TRUE;
}
...
DWORD dwError;
BOOL bResult;
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);
bResult = CreateProcess(NULL,
"c:\\windows\\explorer.exe \"C:\\Documents and Settings\\<user>\\My Documents\\My Pictures\\<folder>\"",
NULL,
NULL,
TRUE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi);
if (! bResult)
dwError = GetLastError();
WaitForInputIdle(pi.hProcess, 3000);
EnumWindows(EnumProc, pi.dwProcessId);
HWND hWnd = FindWindowEx(_hWnd, NULL, "SHELLDLL_DefView", "");
if (hWnd != NULL)
::SendMessage(hWnd, WM_COMMAND, 0x702f, 0); Obviously this solution has a few shortcomings but I think you get the general idea. I think that FindWindow() can also be used to find the "CabinetWClass" window.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I just posted an article about automating Internet Explorer and Explorer on Codeproject (http://www.codeproject.com/shell/AutomateShellWindow.asp).
To switch to 'Film Strip' mode, use IFolderView::SetCurrentViewMode with FVM_THUMBSTRIP. IFolderView can be QIed from the active shell view in explorer.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hi JIANG,
thanks for the reply...
i've looked eariler at your code posted here...tried to simulate it but didn't get much luck..
can you copy and paste bits of your code here to answer my quiz
all i need to do is open explorer in a certain directory and then switch it to film strip view
an easiest approach for me would be to write something like this:
using shellexecute , "explorer.exe /n,c:\.....\MyFolder"
and then set a registry key that customize this folder to 'filmstrip'
i've been shown by DavidCrow where the windows store this customization, all i have to look for now is how the system find the folder according to the number in the registy...
can u help there?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: and then set a registry key that customize this folder to 'filmstrip'
Look at the Vid and Mode values.
Details:
"Vid"="{137E7700-3573-11CF-AE69-08002B2E1262}"
"Mode"=dword:00000004
Icons:
"Vid"="{0057D0E0-3573-11CF-AE69-08002B2E1262}"
"Mode"=dword:00000001
List:
"Vid"="{0E1FA5E0-3573-11CF-AE69-08002B2E1262}"
"Mode"=dword:00000003
Thumbnails:
"Vid"="{8BEBB290-52D0-11D0-B7F4-00C04FD706EC}"
"Mode"=dword:00000005
Tiles:
"Vid"="{65F125E5-7BE1-4810-BA9D-D271C8432CE3}"
"Mode"=dword:00000006
Filmstrip:
"Vid"="{8EEFA624-D1E9-445B-94B7-74FBCE2EA11A}"
"Mode"=dword:00000007
YaronNir wrote: i've been shown by DavidCrow where the windows store this customization, all i have to look for now is how the system find the folder according to the number in the registy...
After looking at the HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU key and its subkeys, I can only guess it's some sort of hashing algorithm.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|