|
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<-=
|
|
|
|
|
HI.ALL
I M GETTING THIS PROBLEM......
c:\program files\microsoft visual studio\myprojects\dialog1\dialog1dlg.cpp(4) : fatal error C1083: Cannot open precompiled header file: 'Debug/dialog1.pch': No such file or directory
Clicking on error.it points to
#include "stdafx.h"
and my code is this.....
void CDialog1Dlg::OnAdd()
{
// TODO: Add your control notification handler code here
CString strTitle ;
int nIndex;
UpdateData(); // Transfer data from controls to variables
//get currently selected text
nIndex = GetDlgItemText(IDC_TITLE, strTitle); //assigning selected
m_strFullName = strTitle + " " + m_strFirstName + " " + m_strLastName;
m_NameList.AddString(m_strFullName); //Add string to list
UpdateData(FALSE); // Transfer data from variables to controls
}
SKDOBHAL
|
|
|
|
|
#include "stdafx.h" must be the first include statement before the others
|
|
|
|
|
|
Does this error happen even with a Rebuild All?
"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
|
|
|
|
|
using VC++, how to cut a rectangle segment picture from an bmp format image?
and the cutting rectangle can has diffrent angle. my mean is that the cutted image is certainly rectangle, and the cutting segment is also rectangle, but the tow rectangles are not parallel, there is a rotated angle between them.
thanks
|
|
|
|
|
See this code
CDC m_dc,m_dc2;
m_dc.CreateCompatibleDC(GetDC());
m_dc2.CreateCompatibleDC(GetDC());
HBITMAP hbit=CreateCompatibleBitmap(GetDC()->m_hDC,800,600);
HBITMAP hbit2=CreateCompatibleBitmap(GetDC()->m_hDC,800,600);
hbit=(HBITMAP)m_dc.SelectObject(hbit);
hbit2=(HBITMAP)m_dc2.SelectObject(hbit2);
hbit=(HBITMAP)LoadImage(NULL, _T("c:\\1234.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
hbit=(HBITMAP)m_dc.SelectObject(hbit);
m_dc.TextOut(0,0,_T("And is this your answer"),23);
m_dc2.BitBlt(300,300,200,200,&m_dc,0,0,SRCCOPY);
hbit2=(HBITMAP)m_dc2.SelectObject(hbit);
CImage m_Image;
m_Image.Attach(hbit2);
m_Image.Save(_T("e:\\test.bmp"));
m_Image.Destroy();
m_dc.DeleteDC();
m_dc2.DeleteDC();
DeleteObject(hbit);
DeleteObject(hbit2);
|
|
|
|
|
That leaky piece of code helps the OP how?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|