|
Hi,
I am using ClistCtrl in my project, I use a large icon (100 x 100) pixel,
I want to draw a text on the icon.
Can any one give me a manner to do this.
Thanks in advance.
|
|
|
|
|
Hello friends,
Whenever we Click an Image present in the ListControl, the image will be shown as selected by selecting the whole image and displaying in some color. But I want to display on Border to be displayed whenever I click the image. Somewhat like the ThumbNail View in the Windows Explorer. there if we selected any directory then only the directory will be focused by displaying the border in blue color.
Thank you,
Bye
|
|
|
|
|
I want to create MDI app which is going to start with dialog, not with child frame on start up. If I use the Wizard to create the MDI app, and start the application, I get the child window opened on start up and I don't know how to remove it.
I want to go to the File menu, chose New option and start the dialog, not the child window.
Help me please!!!!!!!!!!!!!!!!!!!1
Thanks in advance!!!!!!!!!!!!
|
|
|
|
|
Try
cmdInfo.m_nShellCommand = CommandLineInfo::FileNothing;
after
ParseCommandLine(cmdInfo);
within the InitInstance()
MfG
Gérard
|
|
|
|
|
Thanks for answer.
I'll try it, and I'll see if it works.
Thanks again!!!!
|
|
|
|
|
Hi Guys,
i've derived a class from CRecordset like so
=========================
class myrec : public CRecordset{
myrec():CRecordset(&MyDatabase){/*do stuff etc*/}
============================
lets say I have a member function called AddCustomer(); //yes i know
the function needs to call CRecordset::AddNew() or CRecordset::Edit() (inherited from CRecordset) like this:
===========================================
BOOL myrec::AddCustomer(Customer & xr_Cust){
//for clarity
if(CanAppend()&&IsOpen()){
TRY{
AddNew(); //on some systems folowed by Requery()
this->Number = xr_Cust.Number();
this->Name = xr_Cust.Name();
etc etc
=========================================
BOOL myrec::EditCustomer(Customer & xr_Cust){
if(CanUpdate()&&IsOpen()){
TRY{
//put curser at right record, then:
Edit();
this->Number = xr_Cust.Number();
this->Name = xr_Cust.Name();
etc etc
==========================================
in all the examples i've seen are like this:
CRecordset x(CDatabase * bla_bla);
x.AddNew(); //or .Edit()
x.field_in_database = "hello";
i'm not sure how it does this since x does not have a member field_in_database, the database does!
so how are we accessing it using the dot operator? (no it's not overridden, i think);
and even if it did work in their examples it certainly does not in my derived class when i try this:
==============================================
this->Number = xr_Cust.Number();
==============================================
it simply tells me that "Number" is not a member of CRecordset or my derived class (and quite rightly so!)
so if anyone can tell me how to use Edit || AddNew in functions of a derived class please post or e-mail me at:
psycode@webmail.co.za;
please please please!!!!
Consistency is the last refuge of the unimaginative.
Oscar Wilde
|
|
|
|
|
Hello 0100110110,
when you derive a class from CRecordset (or CDaoRecordset) using the Class Wizard it automatically implements the so called DFX mechanism for the exchange of field data between the database table and your recordset class. For each field of the record on the data source the DFX mechanism creates a member variable in the recordset class. I think thats what you are searching for.
Hope this helps
MS
|
|
|
|
|
Hi,
In my application, I've got a multiline edit control, and I would like to be able to dynamically remove/add the horizontal scrollbar. I tried by simply changing the style:
SetWindowLong(hLog, GWL_STYLE, GetWindowLong(hLog, GWL_STYLE) & ~WS_HSCROLL);
Unfortunately, the scrollbar disappears but the space it was using is still there (looks like a disabled area). I've tried to call RedrawWindow() but that doesn't work.
I would just like the edit control to looks like it was created without the horizontal scrollbar.
Any idea?
|
|
|
|
|
I just discover the ShowScrollBar(), it does just what I want
|
|
|
|
|
Hi Everyone !
Do anyone know how i can convert a CString to a TCHAR[1024] ??
Please help !!!
MFG
RedDragon2kx
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
CString ?
so you are using mfc?
i am, and use CString::GetBuffer(), followed by CString::ReleaseBuffer();
obviously you have to do something useful with the array (like doing a strcpy() ) as direct changes to it will modify the CString;
also when you call ReleaseBuffer() it realloc's the internal buffer of the CString ie: your array, unless copied, points to undefined memory!
i'm sure there's an easier way, but if you need to get the proj up and running NOW, there it is.
Consistency is the last refuge of the unimaginative.
Oscar Wilde
|
|
|
|
|
It is unnecessary to use GetBuffer() and ReleaseBuffer() when a read-only copy of the buffer is all that's required. For example:
CString str;
TCHAR tch[1024];
strcpy(tch, str);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi,
Can any one explain me how I can...
1)copy a bitmap(CBitmap object) into the clipboard in MFC?
And
2)load a .bmp file into a CBitmap Object?
Please help.
|
|
|
|
|
Can use the following code 4 loading a bitmap
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP);
CDC *pDC = GetDC();
pDC->DrawState(CPoint(70,70),CSize(216,232),bm,NULL);
pDC->ReleaseAttribDC();
|
|
|
|
|
Hello All,
I am trying to make a game for assignment and need to communicate between 2 processes.
I am creating memory map and sharing memory between 2 processes....
After I copy the memory on memory map from the main process, I need to inform the child process to start reading the memory..how can i do this?
is SendMessage a proper way to do it? if yes how do i do this, I just need to find a way to send message from the main process and receive messege in the child process....
any help will be greatly appreciated
Thank you
|
|
|
|
|
Are you talking 2 different applications or 2 different threads?
For applications you need to implement some form of interprocess communication (ipc) in which there are various tried and tested methods, each with their pros and cons. I suggest you read up on these before deciding on an appropriate one.
For threads, your child thread will need to process messages. Then you should use PostThreadMessage()
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
Thanks for your reply, I am talking about 2 different applications...
for IPC i have already created memory map and i can read data from both application....but the problem is how do i inform processes when they can read data...
|
|
|
|
|
You may want to look at the WM_COPYDATA message. This would be sufficient for notification purposes.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thank you,
I will look into it
I appreciate your help
|
|
|
|
|
hello all,
what is lvalue error?. is there Rvalue error too?. if yes plz give me some explanation about these 2 error types.
Thanking u all.
ComputerNewton
|
|
|
|
|
I can only assume you mean when the compiler is expecting an l-value on the left-hand side of an assignment:
i=10; is fine so long as i was not defined as a constant.
More obviously:
10=3; will give you an l-value error because 10 is not an l-value and therefore cannot be assigned to anything else.
10 is 10, and cannot be anything else!
I hope this helps,
Zoltan
|
|
|
|
|
Can I group function (method) within Struct in ANSI C?
I constantly listen people talking about it. Many have
stated that it can be done.
If it can be done, is it recommended to do so?
Thanks
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|
|
|
Thanks for your reply.
I did mean function pointers within Stuct. I mean function within
Struct. Some people are stating that Object-oriented can be done
in ANSI C. I just don't think so. But I'm not really sure.
Can it be done?
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|