|
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
|
|
|
|
|
|
|
i need to do some operation before my view get focus...how to do taht..OnActivateView
is not work for me..please help me.
|
|
|
|
|
|
hello everyone,
good afternoon to all, i am creating OCX files so i want to use variant parameter.please tell me how it should declared and where should be declared. i declared like this:
in ACR120RWctl.h
CString strVerifyKeyA;
CString VerifyKeyA(int SectorNo, VARIANT strVerifyKeyA="ss");
is it right way to declaration or not.
in ACR120RWctl.cpp i am using these functions.
if i am setting the field and scode as follows then it is giving error.
strVerifyKeyA.vt=VT_ERROR;
strVerifyKeyA.scode=DISP_E_PARAMNOTFONUD;
it is giving error.and if i want to assign sring value to that variable then also it is giving error.
please help me.i am in tension.
HELP ME.
THANKU IN ADVANCED,
savitri
modified on Thursday, March 13, 2008 5:21 AM
|
|
|
|
|
savitri wrote: CString VerifyKeyA(int SectorNo, VARIANT strVerifyKeyA);
Syntax is OK for this prototype of function.
This prototype means:
Function VerifyKeyA takes two parameters:
the first one is of type int named SectorNo ,
the second one is of type VARIANT .
But according to the name strBerifyKeyA , it is treated as a string.
This function returns an object of type CString , which is of course, a string.
But honestly, a verification procedure should return seccess / failure, which would be type BOOL or bool ;
Or some kind of return value (Status WORD) to represent the verification result.
Maxwell Chen
|
|
|
|
|
thanku i am also retuning string value only.so i take it as string.but how shall i assign the value to this variable. if i will assign CString verifykeyA(int sectorno,VARIANT strVerifyKeyA="");then it is giving error. please help me..
thanku,
savitri
|
|
|
|
|
Before you feed that VARIANT type variable as the argument to the function, you need to configure that VARIANT variable.
And while review your modified post, I guess that you are using the prototype in function implementation as an expression?!
What you have to do is ...
CString s;
VARIANT v;
BSTR bstr = s.AllocSysString();
v.vt = VT_BSTR;
v.bstrVal = bstr;
VerifyKeyA(SecNo, v);
::SysFreeString(bstr);
Maxwell Chen
|
|
|
|
|
hi..
i write like this in .h or header file
CString strVerifyKeyA;
VARIANT strVerifyKeyAwith;
BSTR bstr1=strVerifyKeyA.AllocSysString();
strVerifyKeyAwith.vt=VT_BSTR;
strVerifyKeyAwith.bstrVal=bstr1;
CString strVerifyKeyB;
VARIANT strVerifyKeyBwith;
BSTR bstr2=strVerifyKeyB.AllocSysString();
strVerifyKeyBwith.vt=VT_BSTR;
strVerifyKeyBwith.bstrVal=bstr2;
CString strPort;
VARIANT strPort1;
BSTR port=strPort.AllocSysString();
strPort1.vt=VT_BSTR;
strPort1.bstrVal=port;
CString VerifyKeyA(int SectorNo, strVerifyKeyAwith);
CString VerifyKeyB( int SectorNo, strVerifyKeyBwith);
int InitReader(strPort1="");
long DisconnectReader(int ReaderHandle);
in .cpp file i added the code of initreader(strPort1="USB1")
{
}
but i am getting error like this as follows:
error C2327: 'CACR120RWCtrl::strVerifyKeyA' : member from enclosing class is not a type name, static, or enumerator
error C2065: 'strVerifyKeyA' : undeclared identifier
C2228: left of '.AllocSysString' must have class/struct/union type
error C2258: illegal pure syntax, must be '= 0'
error C2252: 'bstr1' : pure specifier can only be specified for functions
error C2143: syntax error : missing ';' before '.'
C2501: 'strVerifyKeyAwith' : missing storage-class or type specifiers
error C2059: syntax error : '.'
error C2238: unexpected token(s) preceding ';'
studio\myprojects\acr120rw\acr120rwctl.h error C2143: syntax error : missing ';' before '.'
c:\program files\microsoft visual studio\myprojects\acr120rw\acr120rwctl.h(21) : error C2501: 'strVerifyKeyAwith' : missing storage-class or type specifiers
please help me.
thanku.
savitri:
|
|
|
|
|
hi max,
i am used how u told me.but when i called that function in another function then it is showing that VerifyKeyA(3); does not take 1 parameter.if i am giving like this :VerifyKeyA(3,"");then it is giving error like this:cannot convert parameter 2 from 'char [1]' to 'struct tagVARIANT'.Please Help me. i am in confusion.or else tell me some reference book that i will read from those books. please do it. REPLY ME.
THANKU,
savitri
|
|
|
|