|
How do you programmatically select an item in a CListCtrl. It seems that there is no SetCurSel like function to achieve this.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
try:
m_myListCtrl.SetItemState(iIndex, LVIS_SELECTED, LVIS_SELECTED);
|
|
|
|
|
Check SetItemState and LVIS_SELECTED .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
it does not work, although it returns TRUE indicating success. The item is NOT selected in the list.
BOOL bSucceeded = m_MessagesList.SetItemState(iIndex, LVIS_SELECTED, LVIS_SELECTED);
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Ummm... It should work... Try calling m_MessagesList.SetFocus() first.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That was the problem. Tx!
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
If I create a windows application in Visual C++ using visual studio.net, will it run on windows nt???
Thanks in advance,
Paddy.
|
|
|
|
|
Why shouldn't it?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks for the help, I wasn't sure if it would work coz when I tried it with a C# program it complained of missing DLL's.
|
|
|
|
|
Yes, C# programs require the lastest DLLs for the .NET framework to work. But this also applies to Windows 95, 98 and other OS apart from NT.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Cheers, Thanks for the help.
Paddy.
|
|
|
|
|
As long as you don't use any managed C++ code, a VC7 program will run on all versions of Windows.
Michael
"I've died for a living in the movies and tv.
But the hardest thing I'll ever do is watch my leading ladies,
Kiss some other guy while I'm bandaging my knee."
-- The Unknown Stuntman
|
|
|
|
|
It should, but keep this in mind:
1. Don't use any managed extensions - these require the .NET runtime. This can be installed on NT, though, but it's too new to be there by default.
2. Statically link to the MFC and Visual libraries. Otherwise, you may find the required DLL's do not exist on an NT system, and would have to be installed.
Even a broken clock is right twice a day.
|
|
|
|
|
I am loading information from a inf file and modifying the window based on this. I have got most of it working except a few problems. The first being I load a 'title' into a CString and try to set the cs.lpszName equal to it, but it shows up with each character being a Ý. I'm thinking that a CString might be the wrong data type but I don't get any errors saying so.
Thanks for any info,
Steve
|
|
|
|
|
Perhaps you're doing
strcpy (cs.lpszName, myString);
Try:
cs.lpszName = myString.GetBuffer(0);
...;
myString.ReleaseBuffer();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I guess you're using a CString defined locally within your overriden PreCreateWindow , right? If so, try using a CString defined instead as a member of your class.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That did it, thanks. How about this, my project is based on the CHtmlView. Do you know how to get rid of the vertical scroll bar? At first I thought it would be in the PreCreateWindow there, but I could not find any parameters to adjust that.
Thanks again for your help,
Steve
|
|
|
|
|
How do i get the path to my Win32 program? I've tried looking at the lpCmdLine argument in the WinMain function but there's nothing in it.
Thanks
|
|
|
|
|
Look at GetModuleFileName. It will give you the full path with the filename and extension.
|
|
|
|
|
How do I draw a rubberband that looks similar to the one of a CSplitterWnd ? thanks for help!
|
|
|
|
|
I am writing a desktop-based toolbar app ( similar in design to the IE Channel Bar ) written from a App-Wizard Generated C++/MFC Dialog Project that is designed to fade down to 25% opacity when it's not being used. It's intended to do this after processing the WM_KILLFOCUS message via the OnKillFocus() Dialog Member. Additionally, it should fade it's opacity back up to 100% when it recieves the WM_SETFOCUS message via the OnSetFocus() Dialog Member. My problem is that I'm unable to get any sort of transparency to work in this situation, including the articles I've seen here at CP or the MSDN . I've thought about using AnimateWindow() but to my knowledge that only fades the window out completely or in completely, and on top of that I don't know how to implement it. If some one could provide me with a code sample that demonstrates how I could apply transparancy in this situation I would be greatly appreciative. Thanks in advance.
It's good to see kids turning their minds to wholesum activities such as programming, instead of wasting their lives in the hedonistic disciplines of Sex, Drugs, & Rock & Roll... or Sex with Drugs, or Sex with Rocks while Rolling in Drugs, or whatever new-fangled perversions you little monsters have thought up now...
[Shog9 on Kid Programmers]
|
|
|
|
|
If you haven't already seen it, this[^] article may help.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Who knows clearly about Text To Speech SDK 5.0 ? Help me ! I heard that SDK 5.0 can deal with international pronunciation. Really (I have just began to use it today)?
Email me: dlhson2001@yahoo.com
|
|
|
|
|
know that I need to use WNetAddConnection2 to map a network resource but when I use WNetCancelConnection, and then try to map again I get an error 1312. I noticed that I can use WNetUseConnection to make my mapping but how do I disconnect a mapped resource on my pc? Thanks
Tom Wright
Programmer
tawright915@yahoo.com
|
|
|
|
|
How do I determine whether to use regular sockets or overlapped sockets? If I only have three or more connections connecting to my server (which I'm writing)at a time.
If I make this a multi threaded application then would I need to have events telling me that a client wants to connect?
How do I set the socket handle globally in MFC, without sticking it in my header file? So that I can pass it from one function to another...example
Handle is created in my OnOk function, how do I pass it to my OnCancel function to close the handle?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|