|
HI all,
how we can communicate with usb device from the mfc?
means if the usb device is installed then how to communicate with
it? does CreateFile will be benefiticial?
if anyone know's some link please forward to me
Thanks and regards
Harshal
|
|
|
|
|
There's nothing special to it. You can use normal file handling routines. Just like how you write a file to your hard disk.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hello Friends,
I have created Combo box in my item.I have question that.. when i will open the Combo box then it will show me last selected item in blue cursor ( ie. it will show mw which string i selected last time).
PLZ help me...I am new in this filed so i dont know what Function or method have to used.
shah_satish2002@yahoo.com
|
|
|
|
|
Are you talking about one instance of the exe or you want the application to remember which item was choosen the last time when app was run ?
redindian
|
|
|
|
|
Thanks dear for your responde..
In my application i created one combo box.I am retraving data from ini file.In my .ini file one section is Default..value of default is equal to string which i selected last time.i want in my application to remember which item was selected the last time when app was run ?( ie it will show in blue cursor ( highlight)).
I hope u got my question.
Waiting for reply.
Satish
Shah satish
|
|
|
|
|
Do not follow Monty's advise he is confused .
Well you are already half way thro to reach what you want .
You said you write the last selected string in a section called Default in an .ini file . So why not you just read the same Default entry when app starts and compare it with combobox items and then you SetSel(item no) . I feel you mean setting focus by "blue color"
redindian
|
|
|
|
|
Ya..u mean...I will compare with if condition n then use selcur method. ( i want to focus or highligh last item..For example when we select any application then it will show us in blue or any color.. that what i want.. ie just only indicate me this section i selected last time.. )
Setcursel is appropriate method or not??
|
|
|
|
|
Hi
Read the Default section of .ini file and get the string in CString or LPCTSTR = lpszStr;
Now implement the following in your OnInitDialog()
int lastselection = m_combo.FindString(0,lpszStr);
m_combo.SetCurSel(lastselection);
redindian
|
|
|
|
|
Hi
1) Read your ini file and load the default string in CString str or LPCTSTR str;
2) implement the following in your OnInitDialog
int lastselection = m_combo.FindString(0,lpszStr);
m_combo.SetCurSel(lastselection);
redindian
|
|
|
|
|
|
dharani wrote: Do not follow Monty's advise he is confused .
hahaha now i understand him ..... he want the last item to be selected again .. damn
Gas prices suggest that they have taken out lead from gas and replaced it with gold
|
|
|
|
|
Well you will have to Owner draw the combobox yourself, lots of articles on owner draw on CP use search.
Then it comes to be that the soothing light at the end of your tunnel
Is just a freight train coming your way
|
|
|
|
|
After you have added all the items to the combobox, call SelectString() with the one you want selected.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to resize a BMP image and save it.
How can i do it ?
|
|
|
|
|
Well take a look at CImage[^] class it does everything you need
Excuse is a word that human beings came up with to hide from the potential of failure and in doing have robbed themselves of the grace of success.
Code-frog in lounge
|
|
|
|
|
|
Dear All,
How can i edit WM_CLOSE and WM_DESTORY Message Event handler in my dialog based application ?
Kindly Help me
Thanks
|
|
|
|
|
hi friend,
pls let me know your actual requirement.
|
|
|
|
|
Which IDE you are using?
In caseof VS2005, you need to dilog class from class view right click on its properties, and then add/edit required message/overidables.
|
|
|
|
|
Hello
GO to class wizard ->Object IDs as your dialog class ->"Add Function" for WM_CLOSE /WM_DESTROY And edit the code in ~dlg.cpp
redindian
|
|
|
|
|
In the properties window you can declare their on your program Is it your purpose?
|
|
|
|
|
I would like to know how to detect the socket was blocked?
Also how to detect the network is disabled?
Please help!
|
|
|
|
|
Connect... and see if it returns with an error or if the connect attempt times out.
|
|
|
|
|
hey guys,
I was wondering what the most efficient way of finding the number of occurences in a list is.
Say I have a list....
struct data{
int number;
int occurences;
};
data list[7];
list[0].number = 5;
list[1].number = 6;
list[2].number = 6;
list[3].number = 8;
list[4].number = 9;
list[5].number = 9;
list[6].number = 9;
how would i sort in such a way that I eliminate the numbers that occur more than once like this,
list[0].number = 5;
list[1].number = 6;
list[2].number = 8;
list[3].number = 9;
and saves the number of occurence for each number
list[0].occurences = 1;
list[1].occurences = 2;
list[2].occurences = 1;
list[3].occurences = 3;
I thought of every possible way,
I can do it for numbers that appear twice but three times, i duno how to deal with it.....
Someone please help me out
|
|
|
|
|
Why did you use the name 'list' for a variable which is an array ?
Could you post your current algorithm to correct it ?
|
|
|
|