|
Did you recompile the IDL?
This should generate the functions for you
codito ergo sum
|
|
|
|
|
Hello,
I Rebuild the application after adding the property. This build would compile the idl for me is it?
Regards,
LG
lgatcodeproject
|
|
|
|
|
Normally it should,
nevertheless could you try to compile the .IDL yourself?
codito ergo sum
|
|
|
|
|
Hi,
I compiled the .IDL but it did't happen so I added the function declaration on the .h file and the definitions in the .cpp file. And proceeded further, and I got the desired output.
Thanks for the link.
Regards,
LG.
lgatcodeproject
|
|
|
|
|
|
Hi!
Thanks for the link. It was quite informative.
Regards,
LG
lgatcodeproject
|
|
|
|
|
I glad it was helpful for you.
|
|
|
|
|
Hi,
I am using the API CStatic::SetIcon to associate the icon with the static control. I have placed this control on CDialog , (Dialog background is gradient painted). I want this CStatic control to be transparent (so that the background of CStatic would be gradient, which is of Dialogs background color). However, icon image is transparent. How could I do this ?
Any help would be highly appreciated.
Thanks,
Paresh.
|
|
|
|
|
|
Hi Hamid,
I have seen this article and this does not serve my purpose.
Regards,
Paresh.
|
|
|
|
|
I think you need to paint alpha blended explicitly, AlphaBlend[^] and make sure you handled OnEraseBkgnd so that Static control doesnot painted its own background
have a look at Using the AlphaBlend function[^]
|
|
|
|
|
Thanks Rajkumar,
AlphaBlend works for bitmaps.
I have to use icons.
Regards
Paresh
|
|
|
|
|
before that, I would like to know what is the result when you tried with your code.
|
|
|
|
|
class CMyDialog : public CDialog<br />
{<br />
........<br />
CStatic m_StaticIcon;<br />
........<br />
}<br />
<br />
HBRUSH CMyDialog:OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog:OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
switch(nCtlColor)<br />
{<br />
case CTLCOLOR_STATIC:<br />
if (pWnd->m_hWnd == m_StaticIcon.m_hWnd)<br />
{<br />
pDC->SetBkMode(TRANSPARENT);<br />
return (HBRUSH)(GetStockObject(NULL_BRUSH));<br />
}<br />
break;<br />
}<br />
return hbr;<br />
}<br />
<br />
<br />
BOOL CMyDialog:OnInitDialog() <br />
{<br />
.........<br />
m_StaticIcon.Create(_T(""), WS_CHILD | WS_VISIBLE | SS_ICON, <br />
CRect(0, 0, 0, 0), this);<br />
<br />
HICON hIcon = ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(ICON_ID));<br />
m_StaticIcon.SetIcon(hIcon);<br />
.........<br />
}
In CMyDialog:OnPaint(), I have painted a region of CDialog with GradientFill(...), and on this area I want a static icon, which needs to be transparent. So that I can see the background of CStatic icon as gradient. But this icon has been painted with background of rest of dialog and not the region, which I have painted with GradientFill.
I hope I have mentioned the problem correctly.
Regards,
Paresh.
|
|
|
|
|
I would suggest very simple approach as you want to display only the icon, use DrawIcon, inplace of doing a lot of stuff over CStatic.
1) add the icon as member variable.
class CMyDialog : public CDialog
{
........
HICON m_hStaticIcon;
........
}
2) load the icon
BOOL CMyDialog:OnInitDialog()
{
.........
m_hStaticIcon = ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(ICON_ID));
.........
}
Paresh Chitte wrote: In CMyDialog:OnPaint(), I have painted a region of CDialog with GradientFill(...), and on this area I want a static icon,
3) Now you draw the icon over the painted region.
void CMyDialog::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this);
.....
.....
}
else
{
CDialog::OnPaint();
CClientDC dc(this);
dc.DrawIcon(100, 100, m_hStaticIcon);
}
}
|
|
|
|
|
Hi Rajkumar,
The solution you have provided is perfectly working for me.
Thank you very much for your kind help.
Regards,
Paresh.
|
|
|
|
|
Hi,
The below code is not working:
ExitWindowsEx(EWX_REBOOT|EWX_FORCE,0);
In which condition it may fail?
|
|
|
|
|
|
Return value is 0. And I have checked this.
|
|
|
|
|
|
Using getLastError, I got the error 1314 (The required previlige is not held by the client). What it means?
|
|
|
|
|
pther wrote: What it means?
see my previous reply
|
|
|
|
|
|
Hello Friends,
Can anyone say how to find the number of ports and the name of ports such as COM1, COM2 etc in our PC using a VC++ program. I searched it everywhere, but i couldnt find a proper source code.
Can u please help in this..
usharani
|
|
|
|
|