|
well, if you are meaning something like this :
CMyDialog *dlg;
dlg=new CMyDialog;
dlg->Create(IDD_MAINDIALOG,NULL);
then
dlg->AnimateWindow() is not a member. Its a member of CWnd.
On the other hand, I had a look at Shog9 's code at http://www.codeproject.com/miscctrl/balloonhelp.asp[^] and did the following:
made the following addition in my .h file :
private:<br />
typedef BOOL (WINAPI* FN_ANIMATE_WINDOW)(HWND,DWORD,DWORD);<br />
FN_ANIMATE_WINDOW m_fnAnimateWindow;
made the edition in the default constructor as :
CMyDialog::CMyDialog(CWnd* pParent )<br />
: CDialog(CMyDialog::IDD, pParent),m_fnAnimateWindow(NULL)
and changed the WM_SHOW like this :
void CMyDialog::OnShowWindow(BOOL bShow, UINT nStatus) <br />
{<br />
if ( NULL != m_fnAnimateWindow )<br />
{<br />
<br />
m_fnAnimateWindow( m_hWnd, 200, AW_BLEND);<br />
<br />
}<br />
}
now I get no compiler errors, the window shows, but no animation
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
OK i have figured it out, the problem was AW_BLEND. it don't work with child windows. I used AW_CENTER and it worked fine, but now the 2nd hurdle.
I have used bitmapped background and controls and they appear messed up.
any ideas what to do?
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Make sure you set the bitmap background in the message handler for
WM_ERASEBKGND.
And if you are doing your own background painting return a NON-ZERO value.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
_kane_ wrote: thanks for the replies in advance
Ok.. My Pleasure .. kiddin.. Use AnimateWindow in OnInitDialog Function like this :-
BOOL CAnimateWndDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::AnimateWindow(this->GetSafeHwnd(),5000,AW_BLEND);
return FALSE;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
_kane_ wrote: thanks for the replies in advance
Thanks ... Kiddin. Use AnimateWindow Api in the OnInitDialog Function of Dialog like this, its working fine for me :-
BOOL CAnimateWndDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::AnimateWindow(this->GetSafeHwnd(),5000,AW_BLEND);
return FALSE;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I use the following code in a function that allows the animations to be random. I call it in OnInitDialog() (and I think I also used it when closing the dialog).
void [ClassName]::AnimateDialog(HWND hWnd)
{
DWORD dwTemp2,dwTemp,dwAnimate = AW_ACTIVATE;
int nFirst,nSecond;
srand( (unsigned)time( NULL ) );
nFirst = rand() % 3 + 1;
switch(nFirst)
{
case 1:
dwTemp = AW_SLIDE;
break;
case 2:
case 3:
dwTemp = AW_CENTER;
break;
}
dwAnimate |= dwTemp;
if(nFirst == 1)
{
srand( (unsigned)time( NULL ) );
nSecond = rand() % 4 + 1;
switch(nSecond)
{
case 1:
dwTemp2 = AW_HOR_POSITIVE ;
break;
case 2:
dwTemp2 = AW_HOR_NEGATIVE;
break;
case 3:
dwTemp2 = AW_VER_POSITIVE;
break;
default:
dwTemp2 = AW_VER_NEGATIVE;
}
dwAnimate |= dwTemp2;
srand( (unsigned)time( NULL ) );
nSecond = rand() % 2;
if(dwTemp2 == AW_VER_POSITIVE || dwTemp2 == AW_VER_NEGATIVE)
{
dwTemp2 = 0;
switch(nSecond)
{
case 1: dwTemp2 = AW_HOR_POSITIVE; break;
case 2: dwTemp2 = AW_HOR_NEGATIVE; break;
}
dwAnimate |= dwTemp2;
}
else
{
dwTemp2 = 0;
switch(nSecond)
{
case 1: dwTemp2 = AW_VER_POSITIVE; break;
case 2: dwTemp2 = AW_VER_NEGATIVE; break;
}
dwAnimate |= dwTemp2;
}
}
::AnimateWindow(hWnd,200,dwAnimate);
}
But as you can see, I had problems with the fade myself. However what I did for a dialog that I wanted to fade was call SetLayeredWindowAttributes() in a timer event that made the small dialog fade in and out like an Outlook mail notification.
My articles
BlackDice
|
|
|
|
|
Hi all:
I started a VC/SmartDevice project under VC 7.0, But the CFile class seems don't works, I wonder is it because of the specific project I choose?
The innocent statement like:
CFile file;
if ( ! file.Open( _T("C:\\Test.txt", CFile::modeRead ) )
{
return;
}
is always invalid, the if statement always evaluate to TRUE
|
|
|
|
|
firstly it is
if ( ! file.Open( _T("C:\\Test.txt"), CFile::modeRead )
The file C:\Test.txt should exist.
I belive it is also throwing a CFileException exception I am not sure about the device version, but if it throwing, then you should catch the exception and examine on what the api is complaining about.
-prakash.
-Prakash
|
|
|
|
|
Mr.Prakash wrote: The file C:\Test.txt should exist.
The file do exists!
The catch the exception, and it's complains about "...not a valid path"
|
|
|
|
|
LiYS wrote: VC/SmartDevice pr
I think it could be because of this.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
if ( ! file.Open( _T("C:\\Test.txt"), CFile::modeRead )
may be the closing bracket around the absolute file path is not placed correctly
never say die
-- modified at 5:09 Wednesday 28th December, 2005
|
|
|
|
|
We had discussed this before few days
So ur using the VC7 /SmartDevice
probably it is due to the project u have choosen
or there is some other method .
Try to put the file in the parent folder
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi,
I am developing a shell namespace extension which will be loaded by explorer.exe. Since I have implemented file uploading in a seperate queue, I couldn't unable the dll even if the reference count becomes zero. For that I am always returning S_FALSE from DllCanUnloadNow method.
The problem is, If someone wants to install a new version, since the dll is in memory and couldn't be unloaded I am not able to overwrite the new version. Is there any mechanism by which I can forcefully unload a dll ?
I recollect reading an article which suggests returning S_OK from DllCanUnloadNow depending on the application which is trying to unload the dll. But I couldn't find the link even after gooogling for hours.
Any help on this would be greatly appreciated!!!
Merry X'mas and Happy New Year.
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
|
I need to trap IO calls (file open/close) at kernel level and take some action. can anyone help me with some direction/sample code etc.
|
|
|
|
|
Previously I was using the vc++6.0.
There If I need to add one lib file to my project I do like:
1. go to project settings
2. Link tab
3. Object/Library modules
4. add lib name.
Here, But in Dot Net environment how do I do?
How to include my lib file in the vc++.net 7.0 environment?
Please tell me any one.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Write this inside the StdAfx.h file
#pragma comment(lib, "yourlib.lib")
Or
Through the solution explorer
Simply click on the project click on Add->Add existing Item..
Select the lib file.
or
Goto Project properties
Click on Linker
Click on Input
Additional Dependencies -> Enter your lib name here
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
-- modified at 1:18 Wednesday 28th December, 2005
|
|
|
|
|
Thanks
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Projects-> [ProjectName] Properties -> Configuration Properties->Linker->
Additional dependencies
Regards
Abhi Lahare
|
|
|
|
|
I am wrtting a text input dialog using CRichEditCtrl, the following code are used to change font
void CDialogText::ChangeFont()
{
CHARFORMAT cf;
m_reText.GetSelectionCharFormat(cf); //m_reText is the CRichEdit Control
cf.dwMask = CFM_FACE;
CString strFaceName;
UINT nIndex = m_cbFamily.GetCurSel();
m_cbFamily.GetLBText(nIndex, strFaceName); //m_cbFamily is a ComboBox, list all installed fonts
lstrcpy(cf.szFaceName,(LPCTSTR)strFaceName);
m_reText.SetSelectionCharFormat(cf);
m_reText.SetFocus();
}
My problem is , when I selected some text in RichEdit , the function works ok.
But if I didn't selected any text, then select a new font. The new font can't affect the following text I input. Anyone could tell me how to solve the problem? Thank you!
|
|
|
|
|
Try a select all and then set the font.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Call
m_reText.Invalidate();
which will update the window.
You can also do it this way...
<code> CFont pNewFont;
LOGFONT lf2;
memset(&lf2, 0, sizeof(LOGFONT));
strcpy(lf2.lfFaceName, "Times New Roman");
lf2.lfHeight = 120;
lf2.lfWeight = FW_NORMAL;
pNewFont.CreatePointFontIndirect(&lf2);
m_cRichEdit.SetFont(&pNewFont);
pNewFont.Detach();
m_cRichEdit.Invalidate();
</code>
Hope this helps.
Mark
-- modified at 9:39 Wednesday 28th December, 2005
|
|
|
|
|
|
Hi,
Is there any advantage in using ++i than i++ in simple loops?
For example:
for( int i = 0; i < 10; i++) { }
for( int i = 0; i < 10; ++i) { }
Which is better?
Thank you.
- NS -
|
|
|
|
|
Defenetly there is difference.
++i is faster than i++.
check with the gettickcount function by calling before this code and after the code.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|