|
this is a sample code that i have done
OnEditChange()
{
m_aa.AddString("xxx");//m_aa is the variable of my combobox of Type CComboBox
m_aa.AddString("YYY");
m_aa.RESETCONTENT();//will not allow me to edit the comboBox ,it will get reset
}
whati nedd is ,whenever i make a change in the combobox only xxx and yyy should be displayed in the combobox list.
what is happening now is whenever i make or edit the combobox the number of time the data displaying is doubled
|
|
|
|
|
here, you are adding the string and then resetting the content.
got it?
|
|
|
|
|
I'd hazard a guess and say that you that you might need to remove old items from the combobox before adding new ones?
"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 tried that also but its not getting it removed completely.
what i tried is: On the second time before adding new string ill get the count and within the loop i tried to delete the string.But every thing is not getting deleted
|
|
|
|
|
philiptabraham wrote: On the second time before adding new string ill get the count and within the loop i tried to delete the string.But every thing is not getting deleted
Probably because you are removing from the top-down rather than from the bottom-up. Why are you not removing them all at once rather than one at a time?
"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
|
|
|
|
|
have you used
combovariable.ResetContent();
before calling your query?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
what is happening is if i give restContent it will reset it after each character i enter in the combobox. For example if i type p the value is reseted where as i want to search a string for 'po'.
|
|
|
|
|
i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'.
if i give RESTCONTENT after writing p, it will get reseted. I wont be able to search for strings with 2 or 3 letters
|
|
|
|
|
now i got your concept.
you mean, you are dealing the on edit change event of the combo box it self.
if so, do one thing.
1.first, before calling the query, preserve the string available in the combobox, in a temporarystring, by using getdlgitemtext().
2.then reset your content.
3.then call your query and upload them into the combo using addstring.
4.then using setdlgitemtext set the temporary string to the dialog.
but here, iam not sure about the cursor position. you have to check it out.
lets see if any body suggests a better technique.
|
|
|
|
|
|
wait a minute!!!
now what happened to your cursor position?
and what about my suggestion?(see down) ;)
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
hi,
i'am trying to add an image as background of a form.
but i don't know , how to add?
if you know please tell me
thanks
panthal
|
|
|
|
|
|
panthal wrote: if you know please tell me
See here.
"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
|
|
|
|
|
If you want to show image on the forum you can use of WM_ERASEBKGN with CImage class like this
#include "AtlImage.h"
CImage m_Image;
m_Image.Load("c:\\123.jpg");
BOOL CdddDlg::OnEraseBkgnd(CDC* pDC)
{
ppp.BitBlt(pDC->m_hDC,0,0);
return TRUE;
}
This is a minumum code for show image on the forum.
But if you want to use of a control to show an image you can use of Static control you must insert Static control of Toolbar on the forum and use of this code
CImage m_Image;
m_Image.Load("c:\\1234.jpg");
m_Static.SetBitmap(m_Image.Detach());
|
|
|
|
|
hai friends,
here my problem is, when i click on the slider available in the scroll bar, iam unable to scroll the dialog.
but when i click on the two buttons i.e. top one and the bottom one on the scroll bar, it is working.
what i did is, in ONVScroll handler,
if nsbcode is 1 iam scrolling down
and if it is 0 up, using ScrollWindowEx function.
now, what all i want is, the dialog should also scroll if i drag the slider.
any help would be appreciable.
thank you.
|
|
|
|
|
Does any one know of a way to get a usb drive's physical serial number? (ie compact flash inserted into a usb reader). I've done a comprehensive google search for a whole day and found nothing. I'm not talking about the volume system id/sn that gets changed everytime you reformat a drive (the one you see using fsutil or vol command). I'm talking about the serial number embedded into a compact flash that is unique even if you format the flash.
I've also seen some examples from google that gets the serial number from a CF in a WindowsCE environment. I've also used a DOS application called diskid32.exe but it only seems to get the serial number from my internal hard drives and not the compact flash inserted into the usb reader (shows up as a "DeviceIOControl IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER error = The request is not supported for this device" error)
Is this even possible in LabView with Windows XP?
Any help is very much appreciated.
Thanks!
|
|
|
|
|
First insert a USB drive then goto
HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum\0
0 is the index of the USB, if there is only one USB then it will be 0.
Got this from here -> http://www.usb.org/phpbb/viewtopic.php?p=28167[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Hi,
I developed programs using C/C++ on command line. I know syntax of these languages. And also developed some projects with Java, C#.
Now I want to learn visual programming on C++ under Windows. Also I have little knowledge on cross platform graphical user interface libraries like GTK+ and Qt.
Where should i start? Which subject should i start first? (Should i start with MFC or Win32?) Could you suggest me a book or web site?
Thanks
|
|
|
|
|
My suggestion is of Win32 however you can use of MFC you can start with write a Dialog base application or SDI and then see messages for example see WM_CREATE when a window is created and then WM_SHOWWINDOW for hide or visible a window and WM_ACTIVE for active windows and WM_SIZE,... Codeproject has good articles and its a section for controls on the MFC.
|
|
|
|
|
xelontr wrote: Where should i start?
By reading a good book on the subject. Petzold's book is always a respectable choice.
"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
|
|
|
|
|
u better go for SAMS "Teach urself VC++ in 21 days" book by Davis chapman.Very good book for all beginners in vc++..
|
|
|
|
|
13 essential skills in vc++ by steven holzner is also good for hte beginners.
|
|
|
|
|
|
Everyone was a newbie once...
There are MANY (legions) of books available... I wouldn't promote piracy (no, not me!), but several are even available in various places on the net, if you know where to look...
Teach Yourself Visual C++ in 21 Days (ambitious title)
Visual C++ Unleashed
etc...
Both take you step by step through different projects and teach you WHAT you can do so you can learn HOW to do it...
If you are like me, you would want a real-print version of the book so you can thumb through it...
Good luck!
=->Mocs<-=
|
|
|
|