|
fjlv2005 wrote:
void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why???????????????
{
m_statusdone.SetWindowText(mymsg);
UpdateData(TRUE);
}
Why are you calling UpdateData(TRUE) at that point? Was it just for testing purposes?
Make sure your static control uses an identifier different than IDC_STATIC (i.e, -1)
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Good day,
Yes Im sure im using ID which is not IDC_STATIC. UpdateData is just for testing...
Why does it doesnt update the display for my modesless dialog??
|
|
|
|
|
How in CEdit to install the cursor in anchor point?
C++ MFC
SetSel installs the cursor in an active end and scrolls the text, I should place(install) the cursor in anchor point, for auto replacement.
|
|
|
|
|
Could you go a little bit more ... in detail ?
SkyWalker
|
|
|
|
|
SetSel(...);
Just make the starting position and ending position the same (anchor point).
The carat (anchor) position is the starting position.
Note: You can reverse the positions passed to SetSel(...) by reversing the starting and ending points..
Under Windows the cursor position is the mouse arrow position and not the position of the text cursor (that's called a caret).
INTP
Every thing is relative...
|
|
|
|
|
Hello,
I have a CButton created dynamically with bitmap:
CButton
m_mybutton.Create(NULL,WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,CRect(1,87,110,107),this, ID_BTNHEADBOOKMARK);
m_mybutton.LoadBitmaps(IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK);
The image have some area with Color RGB(255,0,255).
I wanted those area with that color above to be transparent.
How can I do it?
Hope i could get a response ASAP (if possible )
Also im using EVC, you can try it Visual Studio and if works, i'll try it to EVC3.0.
Thanks you very much.
|
|
|
|
|
My suggestion:
Derive a subclass from CButton, modify its style as owner-draw.
Overwrite the DrawItem() and use TransparentBlt() to paint the bitmap by yourself.
Lane
|
|
|
|
|
Lane,
I understand how to override DrawItem by creating a class derived from CButton, however there no TransparentBlt API in EVC3.0. Anyway to do TransparentBlt?
Thanks Lane
|
|
|
|
|
NewVCbie wrote:
Anyway to do TransparentBlt?
You can use the "True Mask" method. It is the method used by windows to draw icons. It involves creating a black and white mask bitmap that uses white as the transparent part and black as the opaque part. You can have a look at my article at http://www.codeproject.com/bitmap/pjaimage.asp[^] where I use the method to draw transparent bitmaps. Look at the CPJAImage::DrawTransparent() method.
Google[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi!
I am working on MFC SDI application.
can anybody tell me any good example of using extern keyword. can extern be used for passing value of any string variable from one class to another. If it can be used, then how?
thanx
|
|
|
|
|
swaapu says:can extern be used for passing value of any string variable from one class to another?
No it is not possiable using extern.
extern is for different purpose.
if you want to declare later and but if you want to use before itself then use key word extern.
Nice talking to you.
|
|
|
|
|
Hello,
The extern keyword is used to say to the compiler that you are using a variable declared in another translation unit. See the following for example:
You have one translation unit where you define your variable
int g_nSomeInt = 0;
And another one where you want to use the variable
extern int g_nSomeInt;
void DoFoo()
{
g_nSomeInt++;
}
This is how extern can be used. It is adviced though too use accessor functions instead of the extern keyword.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
The extern keyword simply states that the variable or function is declared in a seperate translational unit. That is it is declared and defined in a seperate file from the one that depends on it.
Declaring a function prototype as external, only serves to inform the coder that it is declared and defined in another file.
Defining a variable as external, informs the complire that it is declared and defined golobaly in another file. The difference between a function protype and a global variable, is that a global variable must be declared external and a prototype is external by default.
I've workd with C code that required alot on global variables (dealing with hardware specific addresses). In that case a file was set off to the side to define all the hardware specific data (global variables), which needed to be declared as extern.
INTP
Every thing is relative...
|
|
|
|
|
Hi
Urgent plz. Help me in how to use ADO to store and retrieve image data from Oracle using VC++.
Thanks in Advance
|
|
|
|
|
|
Hi
How to use CByteArray to store images into PostgreSQL database from VC++.
Help me.
Thanks
|
|
|
|
|
Hello,
does anybody here know a good C++/C Implementation of the GNFS(General Number Field Sieve) or the SNFS (Special Number Field Sieve) Algorithm ?
With best regards,
Benedikt
|
|
|
|
|
Hi!!
I am working on an SDI MFC application. I have two dialog boxes. I want to pass some File name from one dialog box to another on clicking OK command button. The file name has to be displayed on the text box of second dialog, when the second dialog appears on the screen .
Can any body tell me , how to declare variables and wat functions to use. I am new to MFC.
Thanx
|
|
|
|
|
there are two methods
(1)use CWnd::SendMessage( UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0
);
(2)you can add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second
Dialog access it.
libo
|
|
|
|
|
Hi!
Thanx for giving responses to my problem.
You had told me:
"add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second
Dialog access it."
But, please tell me , that ,"how to pass the file name of the first dialog to the variable..."
Can u tell me some code as I am new to mfc programming
Thanx a lot for ur valuable time
|
|
|
|
|
You have probably two classes derived from CDialog for your dialogs. Let them be (it's just an example) CYourDlg1 and CYourDlg2.
I guess you are using them like that (supossing they are modal):
CYourDlg1 dlg1;
.
.
dlg1.DoModal()
and
CYourDlg2 dlg2;
.
.
dlg2.DoModal()
respectively.
Now, let's say you want to pass some CString data (containing a fully qualified name of some file), which you get from dlg1, to dlg2.
You must add some data member to each of those two classes: CString m_strFile .
In the OnOK() function of CYourDlg1 you add the line:
m_strFile = ... with the dots replaced by something you are using there ( ).
Before calling dlg2.DoModal() , you initialize the data of dlg2 with data from dlg1:
dlg2.m_strFile = dlg1.m_strFile
SkyWalker
-- modified at 3:13 Sunday 9th October, 2005
|
|
|
|
|
Hi All
I am writing one simple application atht will read unicode data from one file. For this i change project setting to _UNICODE. but it gives me error.
So tried solution given in MSDN : THe lines are as given below
Note The Unicode versions of the MFC libraries are not copied to your hard disk unless you select them during a Custom installation. They are not copied during other types of installation. If you attempt to build or run an MFC Unicode application without the MFC Unicode files, you may get errors.
To copy the files to your hard disk, rerun Setup and click Add/Remove Features. Click Language Tools, click Visual C++, and click Visual C++ Class & Template Libraries, and select both ATL MFC Shared Libraries Unicode and ATL MFC Static Libraries Unicode.
but when i run setup(or rerun setup) i doesnot get Add/Remove Features
option anywhere during installation.
CAn ny body help me what to do.
I am installing Micrisoft Visual C++ 6.0
Thanks in advance
Regards
Amit
|
|
|
|
|
which OS version U have???
Bye the way tell what exact error it gives..
bye
Supriya Tonape
-- modified at 4:37 Saturday 8th October, 2005
|
|
|
|
|
i have windowsXP. when try to bulid it gives error MFC42UD.Lib not found.& when i set its path , it gives eroor mfc42UD.dll not found.
thanks for responce
Waiting
Regards
Amit Patil
|
|
|
|