|
see this, ::GetActiveWindow()->GetWindowText(strCap); //ERROR
It looks like calling a member function using a class instance, possibly CWnd * (from GetActiveWindow), and :: makes the Global scope rather CWnd.
Rajesh R Subramanian wrote: Only if he is using MFC
I implicitly telling him to move to MFC.
|
|
|
|
|
Rajkumar R wrote: I implicitly telling him to move to MFC.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajkumar R wrote: I implicitly telling him to move to MFC.
Why this bad suggestion?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
to use CWnd::GetActiveWindow()
|
|
|
|
|
yeap am using MFC, thank you all Friends...
CWnd::GetActiveWindow()->GetWindowText(strCap); did the job
|
|
|
|
|
Probably he is (there's namespace scope specification).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
namespace scope can be used in non-MFC C++.
|
|
|
|
|
It is redundant: if you don't need it, don't use it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
int CMyNonMFCFrameWorkNameSpace::GetWindowText(HWND hWnd,
LPTSTR lpString,
int nMaxCount
)
{
CMyNonMFCFrameWorkLog log("GetWindowText");
return ::GetWindowText(hWnd, lpString, nMaxCount);
}
There are useful example with other API's, though the above is not a so useful example, it is possible to have such situation that is not redundant. otherwise namespace concept is not needed. I can give example exactly that match OPs statement without MFC classes and other namespace.
|
|
|
|
|
Rajkumar R wrote: the above is not a so useful example
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Plz, Help!
I need to set colored text in win32 window - in code.
but it must be no only one color - it must be 3 colors to
specified texts - one text blue, one text - red one - text green
and all texts must be at ones in one window.
plz, help!
|
|
|
|
|
You should check TextOut function[^]
And also read about objects like Pens and Fonts.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
SetTextColor.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
For each text you can use of SetTextColor.
|
|
|
|
|
dear all
this is image processing issue in c++, i don'w know how to pad bits in last row of image? anyone know this point, please help me, thanks
gentleguy
|
|
|
|
|
1. allocate a buffer of the right size
2. copy the pixel rows into the new buffer, skipping [padding] bits between rows
|
|
|
|
|
thanks friend, i have done already what you said, but some of images were distorted, i blurred image using Gaussian function.
the code is as follows:
for (int i=0;i<height;i++)>
{
for (int j=0;j<width;j++)>
{
int iIndex=i+j*width;
if (j==0)
{
ucGauImgVArray[iIndex]=ucGauHImg[i+j*iWidth1]*mask[1]+ucGauHImg[i+(j+1)*Width]*mask[2];
}
else if (j==(Height-1))
{
ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width]*mask[1];
}
else
{
ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width1]*mask[1]+ucGauHImg[i+(j+1)*Width1]*mask[2];
}
}
}
//Declare a memory for vertical convolution
allocimage(&m_vicGauVImg,Width,Height,8);
unsigned char *ucGauVImg=m_vicGauVImg.ibuff;
int Widthbyte=m_vicGauVImg.buffwidth;
for (int y3=0;y3<height;y3++)>
{
for (int x3=0;x3<width;x3++)>
{
int iIndex=x3+y3*iWidth1;
ucGauVImg[x3]=ucGauImgVArray[iIndex];
}
ucGauVImg+=iWidthbyte;
}
i am very sorry, why i couldn't put width,height behind the i,j.very sad..
gentleguy
|
|
|
|
|
i have two tabs in my application. first tab contains onw view.second tab contain splitter window. in that i have two views. when user switches from one tab to other tab i need to some operaiton. how to do this ..please suggest...thanx in advance.
|
|
|
|
|
handle the Notifications TCN_SELCHANGING, TCN_SELCHANGE
|
|
|
|
|
I have the code which need to link the dll to run , but I do not want to it link the dll to run, so
how can I insert the dll into the exe, so that when I double click the exe it can run without explictly linking the dll
|
|
|
|
|
Link to your library statically.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Its not that easy see this [^]
|
|
|
|
|
Not that I said it should be easy though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
wendyyue wrote: ...without explictly linking the dll
Which implies that you want to implicitly link to the DLL.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i have one application in vs7.1 to port this application into vs8.0
|
|
|
|