|
Prabha Govind Perumal wrote:
but to make this happen we need some functions of TAPI...coud any one help me out with some sample codes or reference....
The Platform SDK has plenty of TAPI samples.
You can also try
http://www.julmar.com/samples.htm[^]
or search this forum for TAPI as there have been many similar questions answered.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I'm creating own file browser based on CListCtrl - report mode.
I need to display the same folder's icon as windows explorer do.
I'm using SHGetFileInfo() to get the image.
My problem is that (in Windows XP - not tested in older systems)
the image is displayed with ugly solid black shadow around icon, (my list control has white background)
where system displays nice gradual shadow of the icon.
But when I set this icon into icon static control, it is displayed correctly.
Code I use to create image list :
m_listImg.Create(16,16,ILC_COLOR32|ILC_MASK,0,10);
CBitmap bmpTmp;
bmpTmp.Attach(::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_FILELIST),
IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION|LR_LOADTRANSPARENT));
m_listImg.Add(&bmpTmp, RGB(255,0,255));
SHFILEINFO fi;
SHGetFileInfo("C:\\",0,&fi,sizeof(fi),SHGFI_ICON|SHGFI_SMALLICON);
m_listImg.Replace(9,fi.hIcon);
Any ideas ?
Thank you !
rrrado
|
|
|
|
|
I generally just use the shell's image list, rather than copying the images into my own. First, set the list control to use shared image lists (so you don't delete the shell's list!) by setting the LVS_SHAREIMAGELISTS style. Then:
UINT uFlags = SHGFI_USEFILEATTRIBUTES|SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_SMALLICON;
SHFILEINFO sfi;
HIMAGELIST hIL = (HIMAGELIST)::SHGetFileInfo(_T("BogusFilename.dat"),
FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), uFlags);
if ( NULL != hIL )
m_ListCtrl.SetImageList(CImageList::FromHandle(hIL), LVSIL_SMALL);
if ( NULL != sfi.hIcon )
::DestroyIcon(sfi.hIcon);
Then, just use the SHGFI_SYSICONINDEX flag in your call to SHGetFileInfo() to find the index into the shell's list of the icon you want.
Oh yeah, one more thing - make sure your program includes a manifest so that the new WinXP controls are used. Otherwise, they won't know how to handle alpha channels...
How do you move in a world of fog, That's always changing things?
Makes me wish that i could be a dog, When i see the price that you pay.
|
|
|
|
|
This is working, thank you !
But the problem is that i need to display not only system icons, but also couple of my icons, co I can't directly use system image list
rrrado
|
|
|
|
|
I'll try to duplicate and then rebuild system's image list
Seems that CImageList::Create() will always create image list with 1-bit mask, which is not enough for alpha channel
rrrado
|
|
|
|
|
Hi,
I just upgraded a portion of my code from int to __int64, everything looked fine but the only problem is that it looks like this data type could not be serialized.....
Anyone know a 64bit data type in MFC that can be serialized ?
Shay\
error C2593: 'operator <<' is ambiguous
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type '__int64' (or there is no acceptable conversion)
|
|
|
|
|
It is not one of the supported data types that the CArchive class has provided overloaded operators for. So, you will need to use CArchive Write and Read methods, passing the address of the __int64 var.
onwards and upwards...
|
|
|
|
|
Thanks, but one more thing
When I use ar.Write or ar.Read, it looks for a pointer to a buffer.
It looks like when I read, it read more that needed, even though I specified 64 in the second paramter.
So....
If I need to serialize a 64 bit number using write, should it be:
ar.Write (&number,64)?
and read back:
ar.Read (&number,64);
|
|
|
|
|
first off, your __int64 variable is NOT 64 bytes long. It is 64 BITS long, which, when divided by 8 bits per byte, is 8 bytes. So, you should pass 8 for the second param ( or sizeof(__int64) ).
ar.Write(&number,8);
-- or --
ar.Write(&number,sizeof(__int64));
onwards and upwards...
|
|
|
|
|
dooooooooooouuuuuuuuuuughhhhhhhhhhh !!!!!!!!!
Thanks for pointing my stupidity, that's an excellent proof for why you should not skip lunch.
Shay
|
|
|
|
|
Try using the LARGE_INTEGER data type. Text between asterisks is text quoted directly from the MSDN documentation on the data type
***********************
LARGE_INTEGER
The LARGE_INTEGER structure is used to represent a 64-bit signed integer value.
Note Your C compiler may support 64-bit integers natively. For example, Microsoft® Visual C++® supports the __int64 sized integer type. For more information, see the documentation included with your C compiler.
typedef union union
{ struct
{ DWORD LowPart;
LONG HighPart;
}; LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;
*************************************
hope this helped!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Darn. Beat me to it. I was going to suggest doing something similar and then using the standard CArchive operators on the smaller bits.
Steve S
|
|
|
|
|
well I'm glad to see I beat somebody to something for once
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Write your own operator<< and operator>> functions.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I once wrote an extension to the CArchive class that handled serialization of the __int64 type. I can send it to you if you'd like.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
First of all, you can send it, it never hurts to share someone elses wisdom.
Second, I already utilized the Write/Read functions of the archive.
Thanks!
|
|
|
|
|
I prefer to write a global operator>> and operator<< for datatypes like this, so that I can still use the syntax of a stream operator with the archive.
<br />
CArchive& operator<<( CArchive& archive, __int64 value )<br />
{<br />
archive.Write( &value, sizeof(__int64) );<br />
return archive;<br />
}<br />
<br />
CArchive& operator>>( CArchive& archive, __int64 value )<br />
{<br />
archive.Read( &value, sizeof(__int64) );<br />
return archive;<br />
}<br />
This works for simple data types. I use this for bool as VC6.0 doesn't implement serialization for bool, but this should also work fine for __int64.
Best regards,
John
|
|
|
|
|
Thanks for the tip! But don't forget to pass in the second parameter of operator>> by reference (__int64& value). Then it works perfectly!
Regards
Marcus
|
|
|
|
|
I finally beat you to an answer.... you're slacking off!!;P
onwards and upwards...
|
|
|
|
|
My apologies. I was working on an article that had me sidetracked.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have an empty Visual C++ 6.0 project that I use to build a bunch of projects (by setting them as dependant projects). But before I start building I want to update the build numbers in the resource files of these projects.
I created a little app. for this, but I can't seem to find a way to kick it off, because my empty project does not have a custum build step.
Anyone got a clue on how to do this?
|
|
|
|
|
Did you look at this [^] article here at CP?
onwards and upwards...
|
|
|
|
|
I just saw it and that is not exactly what I need: I want to increment the file and product version numbers and also have to do some version control stuff before I do this.
I just need to know how I can a Custom Build option/tab to an empty project.
Anyone got a clue on how to do this ?
|
|
|
|
|
I NEED A POINTER TO ANOTHER DIALOG, WOULD SOMEONE PLEASE DETAIL HOW I CAN DO THIS. PLEASE
Kind Regards
Kevin
|
|
|
|
|
CDialog* pDlg = &AnotherDialog;
please say more, and we'll be glad to help you more ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|