|
Is pAlternateOwner valid?
|
|
|
|
|
Can be NULL or not, but Mike Dunn corrected me. GetSafeHwnd returns NULL if "this" is NULL. A little bit strange to me to have
CWnd *pAlternateOwner = NULL;
HWND hwndAlternate = pAlternateOwner->GetSafeHwnd(); // NULL because pAlternateOwner is NULL
|
|
|
|
|
Cristian Amarie wrote: HWND hWndCenter = pAlternateOwner->GetSafeHwnd();
GetSafeHwnd() is an inline function, so there's nothing to dereference.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello.
In my application I have added a combo box on the toolbar by calling Create()
method.
My requirement is to keep this combo box disabled initially. And after some specific action I want this combo box to be enabled. I can disable it while creating it by passing WS_DISABLE, but the question is how can I enable it after words?
Please reply.
-- modified at 1:46 Monday 7th August, 2006
Rakesh
|
|
|
|
|
m_ComboBox.EnableWindow(0);
|
|
|
|
|
Thanks dude...It worked.
Thanks again.
Rakesh
|
|
|
|
|
Rakesh_Thakur wrote: disable it while creating it by passing WS_DISABLE,
The EnableWindow function enables or disables mouse and keyboard input to the specified window or control.
Are you creating the combo box and have the handle to that window
EnableWindow(hwndCombo,true); will enable the combo box
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi
I should implement functionalities of MS paint ,like I need to identify the regions in a bitmap and then fill the regions with a specified color.
Could any one please provide me with relavant information or links?
The happiest of people don't necessarily have the best of everything; they just make the most of everything that comes along their way.
|
|
|
|
|
Is your purpose?
<br />
include AtlImage.h<br />
HDC hdc=CreateCompatibleDC(GetDC()->m_hDC);<br />
HBITMAP hbit=CreateCompatibleBitmap(GetDC()->m_hDC,100,100); <br />
SelectObject(hdc,hbit);<br />
FillRect(hdc,CRect(0,0,100,100), (HBRUSH)GetStockObject(WHITE_BRUSH) ); <br />
TextOut(hdc,0,0,"test",4); <br />
CImage m_Image; <br />
m_Image.Attach(hbit); <br />
m_Image.Save("D:\\test.bmp"); <br />
DeleteObject(hbit); <br />
DeleteDC(hdc);<br />
|
|
|
|
|
I should implement Hit Testing in a Region.
|
|
|
|
|
So see,a image in 800x600 and a square on thr image
<br />
CImage m_Image;<br />
m_Image.Load("d:\\0.bmp");<br />
m_Image.BitBlt(GetDC()->m_hDC,0,0,800,600,0,0);<br />
<br />
FillRect(GetDC()->m_hDC,CRect(0,0,100,100), (HBRUSH)GetStockObject(BLACK_BRUSH) );
|
|
|
|
|
I am using CxImageLib. I have included all the include file in the directiory tab and copied all the dlls and lib file of that project in to my project. But when i copile and build my project in shows an error...
fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory
where the #include <stdbool.h> statement is in some library header file.
How to solve this.Please help.
KIRAN PINJARLA
|
|
|
|
|
|
Hi all,
I have drawn a Circle by using cdc::Ellipse(...) in a Dialog. I have a Button Control in the Dialog, when i click the button how can i erase the ellise which i have drawn with the Mouse.
I don't want to use Invaldate(..), InvalidateRect(...) for this method.
Is it possible with dc.SetRop2(...) method. if possible please provide a solution for it.
uday.
|
|
|
|
|
if you dont want to use Invalidate did you see CDC::RestoreDC and CDC::SaveDC
|
|
|
|
|
Hi whitsky,
Please give a snippet of code so that i can understand how to erase the Ellipse when i click the Button in a CDialog.
Please help me out.
Uday kiran
|
|
|
|
|
|
Drawing with an XOR operation is the usual way of restoring the original bitmap - just do the same XOR draw again. Otherwise, the original draw overwrites the bits where the ellipse goes, and you have to redraw the window to remove the ellipse.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi
I m using RFX_Text function to retrieve the resultset from the query sp_who (back end is SQL Server 2000). But 3 columns of sp_who returns me nchar data due to which I m getting "Unicode conversion failed" error.
Please suggest me a way to deal with unicode characters.
The member variables m_strLoginame, m_strHostname and m_strDbname are declared as CString.
My sample code snippet:
void CTestdgSet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CTestdgSet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[spid]"), m_nSpid);
RFX_Text(pFX, _T("[status]"), m_strStatus);
RFX_Text(pFX, _T("[loginame]"), m_strLoginame,500); // nchar
RFX_Text(pFX, _T("[hostname]"), m_strHostname,500); //nchar
RFX_Long(pFX, _T("[blk]"), m_nBlk);
RFX_Text(pFX, _T("[dbname]"), m_strDbname,500); //nchar
RFX_Text(pFX, _T("[cmd]"), m_strCmd);
//}}AFX_FIELD_MAP
}
|
|
|
|
|
N.T.Srikanth wrote: RFX_Text(pFX, _T("[loginame]"), m_strLoginame,500); // nchar
Have you stepped into the RFX_Text() method to see why it is failing?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if i am working with dialog based applicatuion and want to call function like these how to use these means which class should should b include and how??
CMain* m_Main=(CMain*)GetParent();
m_Main-> function/data
|
|
|
|
|
priyanka s wrote: CMain* m_Main=(CMain*)GetParent();
m_Main-> function/data
GetParent() allows you to retrieve a handle to the specified window's parent or owner.So with this pointer that you create ,you will be able to access the data(of the public section)and the member functions of the class that are in the public section of the owner.
Suppose class A is your class from where you are calling another dialog.Then the header file for your called class should be included in A.h(Believing that this is the default header file for class A that you create.)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
let me give u brif explanation:
wartzDlg.cpp is my main from where i am calling function whcih are dige and declare in arielapi.cpp and arielapi.h
These are my function call:
<void CWartzDlg::Onconnect()
{
// TODO: Add your command handler code here
sessionid = m_arielapi.Login("username","password","userid");
}>
Now i want when i click these function button other window or .txt will open
and from there i will call other finction to display data .
But as i am new to vc++ I dont know hopw to achive these.
These is second function
<void CWartzDlg::OnPrice()
{
// TODO: Add your command handler code here
requestid == m_arielapi.RequestPrices(sessionid,pageno);
}
>
can u help me pls
|
|
|
|
|
your problem is open a dialog or send a data?
|
|
|
|
|
my prob is opening a new window and display data coming from server.
|
|
|
|