|
assuming you have a member control m_ListCtrl1 then just do
m_ListCtrl1.SetCurSel( x );
where x is the number of the element in the list you want to select
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
It says SetCurSel is not a member of CListCtrl....
|
|
|
|
|
listCtrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
Don't forget to set LVIS_SHOWSELALWAYS style.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanks. I used the first line, but did not set the style. It worked though. I put the control in from the toolbox, not programmatically. I am thinking of using something like:
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
// Allow the header controls item to be movable by the user.
pmyListCtrl->SetExtendedStyle
(pmyListCtrl->GetExtendedStyle()|LVS_EX_HEADERDRAGDROP|LVIS_SHOWSELALWAYS)
Is this what I need to do? I wont know because it works already without the style being set.....
BTW, this selecting does not trigger the OnItemChanged function that I thought it might. IS that correct behavior?
Thanks,
ns
|
|
|
|
|
Easier way to modify the style: pmyListCtrl->ModifyStyleEx( 0, LVS_EX_SHOWSELALWAYS );
Yes, it is correct behaviour for the OnItemChanged to not trigger when changed programmatically.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Appreciate your response> Thanks for showing me how to set the style.
ns
|
|
|
|
|
Hi all,
I have some problems by changing the name of a DLL...
To do that : I go to => Projects | Settings | Link (Tab), and for the Category = General, I change the name of the DLL below the "Output file name:" title. But when I recompile, I find a warning which say:
"SeldesCfgProg.exp : warning LNK4070: /OUT:StdCardCom.dll directive in .EXP differs from output filename "../My DLL/SeldesCfgProg.dll"; ignoring directive"
The name before was "StdCardCom.dll" and now I will "SeldesCfgProg.dll"
With the old name, I don't have any warning...
If somebody has an idea, I would be very grateful to him.
Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
Maybe do a Clean and Rebuild. Make sure you change the name in the .def file if you use one.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
Make sure you change the first line in the .DEF file from
LIBRARY "OldName"
to
LIBRARY "NewName"
Best regards,
Alexandru Savescu
|
|
|
|
|
A big Thanks for your assistance... really
Hello World!!!
from Raphaël
|
|
|
|
|
Hello,
I've created an iexplorer 'plugin' that works fine, exept that when I open a new instance of the browser, it crashes in MSHTML.DLL (addr 636ac73f). This is not a function called by me.
How can I have more info why this happens ? Is it possible to debug MSHTML.DLL ?
Thanx.
|
|
|
|
|
You should be able to give the browser's executable in the Visual Studio project settings ("Executable for debug session" in the debug tab). Then when you hit run, it'll open explorer. Then get the plugin to start (if it doesn't automatically), and you should be able to debug it as you would any other app
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
That's what i'm doing but it does'nt help. All i get is an access violation and the call stack shows MSHTML!636ac73f called by MSHTML!636ac784 called by MSHTML!63661c70. And nothing else, so I cannot determine which function is called !
Is there another solution ?
|
|
|
|
|
Ahh, so is the access violation happening somewhere outside of your code.
I think you can download the symbols for windows2k from the microsoft site somewhere. Installing those might be able to tell you what is actually happening when the crash happens.
I assume if you put breakpoints in to your code that it crashes before reaching them?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
You can download symbols from microsoft.com/ddk[^]
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi guys,
I need some help in creating concurrent threads. I am running a TCP Server which accepts the clients, I am calling AfxBeginThread passing the newsocket id to that. I want to run a seperate concurrent thread for each client which is connecting to my server for some file transfer. Can anybody suggest some solution. Any links or references will help me. Thanks.
satya
|
|
|
|
|
|
Why do I get a Debug assertion, when I have some watches concerning my CArray? Isn't that kind useless, when i can kill my program when debugging and adding a wrong "watch-line"?
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
CArray is crap. Don't use it.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hi All !
One problem pursues me for a few years already:
all my Win32 apps, written in VC++ (5.0-6.0),
crash on the second run under debugger.
Toolbar code in comctl32.dll causes access violation.
In more details:
1)The crap arises only when the app
is run 2 times successively from the VC++ IDE.
When running my app standalone, all's ok.
2)The program crashes when a mouse is moved
over the toolbar. WM_MOUSEMOVE is finally
dispatched to DefWindowProc() in comctl32.dll,
and there fails.
The mouse coordinates seem to be correct.
3)If toolbar is hidden, it's allright.
4)This bug seems to be not accidental
concatenation of circumstances:
this happened on different Windows versions,
under both VC5 and VC6, after many reinstallations
of the VC++ and OS etc,
and, finally, with all my Win32 GUI apps -
independently of tyhe architecture of the app,
and of the way I use tollbars
(containing ReBar, different styles, etc.)
5) The bug arises and disappears from time to time,
during the course of program development.
It seems that it depends somehow
on the size of the .exe or something like that.
Anyone ever faced this problem ?
Any help or hint would be appreciated !
Thanks in advance !
|
|
|
|
|
I am facing the following peculiar problem:
1. Create a dialog based applications.
2. Show a modeless dialog box on click on a button
3. Show an AfxMessageBox on click of another button on base dialog.
4. Close the modeless dialog box.
5. Now you can click on any button on the base dialog to create a second afxmessagebox,while the first one is still displayed!!!!
How can you prevent this?
|
|
|
|
|
You can keep all the modeless dialogs in a CWnd* p[max_no_modlesses] and:
void CDlg::OnButtonAfxMessageBox()
{
for (int i=0; i<no_modelesses; i++)
p[i]->EnableWindow(FALSE);
AfxMessageBox("AAAAAAAAA");
for (i=0; i<no_modelesses; i++)
p[i]->EnableWindow(TRUE);
} I assume you don't want to manipulate any modeless while AfxMessageBox is "running".
rechi
|
|
|
|
|
How can I create a MSI file for my VC .NET project ? I created a very simple COM, and want to distribute to clients. What the MSI needed is just put my DLL in a place, and install VC7 related stuff to run my DLL together with registration it correctly.
Can I still use the Free Windows Installation tool exists in VS6's platform SDK ?
I don't want to buy InstallShield as it's quite expensive. More expensive than VS.NET.
|
|
|
|
|
|
Oh...thanks, it's creating another project, not a seperate tool.
|
|
|
|