|
I think you should test NMLISTVIEW::uChanged and call SetCheck only if item's check state didn't change.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
I found the structure NM_LISTVIEW defined in commctrl.h, but it doesnt tell me what uchanged tests for? I n your post you said test for properties changed with uchange> But how does it tell me which properties changed?
Appreciate your help,
ns
|
|
|
|
|
Check the NMLISTVIEW docs in MSDN. The flag you'll probably need is LVIF_STATE. Note that both selection and check state are stored as different bits in item state.
I don't have the VC at hand right now; can't post the code. Just insert TRACEs liberally and you should see what's going on.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
I have a directory named, "S Y S T E M T O O L S". (Actually, there are two spaces between "system" and "tools".)
From the command prompt window (in Win2K), when I try to change directory to point to that name, I get a message that the system could not find the path specified.
Take my word for it, I've tried all sort of permutations including enclosing the name in double quotes, inserting backslash, drive letters, etc., and nothing works.
Win2K doesn't have a problem accepting the directory name as shown above, and I have many folders included in that directory that I'm always using. No problem!!
The problem is with command prompt whenever I try to run an application from a subdirectory listed in that directory.
Does anybody have an idea how I may get command prompt to cooperate?
Thanks!!
William
|
|
|
|
|
It works for me when I'm using double quotes... but I'm running XP Pro.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Just tested on my 2K box. Went fine for me. cd "S Y S T E M T O O L S"
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Here's what I'm talking about. This was copied straight from the command prompt window. (Remember, there are two spaces between "system" and "tools".)
==========================================
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\>d:
D:\>cd "codeproject samples\s y s t e m t o o l s"
The system cannot find the path specified.
D:\>cd codeproject samples
D:\CodeProject Samples>
==============================================
How can I get the directory to point to "S Y S T E M T O O L S"?
Thanks!
William
|
|
|
|
|
How can I convert a string (CString) to a Float / Int ???
--
Nice greets, Daniel.
|
|
|
|
|
try atof or atol or atoi .
However, better implemetation come from strtol and strtod
Best regards,
Alexandru Savescu
|
|
|
|
|
Hi all,
I have developed a simple database application which accesses data stored in an Access database using CRecordset. The problem is that I cannot directly see the changes that I make to the database. For example, if I insert a new record, close the recordset, open the recordset and read all records, I cannot immediately see the newly added record. In all cases, if I wait for 2-3 seconds and then read the database, I can see the newly added record. I guess that for some reason my data are not immediately stored in the database. What can I do? I have also tried with transactions (commit) but the problem remains.
I thank you in advance,
Christos P.
|
|
|
|
|
I vaguely remember seeing a KB article on MSDN about this - it has to do with how Jet (which is the database engine, Access is MS's front end to the Jet database engine) caches its disk access. I suggest you look in MSDN.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Why don't you use CDaoRecordset? Using CRecordset/ODBC with Access is like, well, sucking the cake through straw
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
If you're going away from ODBC you should - at least in my mind - go to OLEDB (or ADO if you're a pussy). DAO is legacy (but so is MFC, or at least that's what everybody asks every time there's a new VC version).
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote:
If you're going away from ODBC you should - at least in my mind - go to OLEDB
It depends on the size/complexity of the application (and prospects of moving from Jet to MSSQL, for example). I've got the impression that OP's app is quite simple and he's just entering the area. In this case, going OLEDB way with ATL templates would be an overkill IMHO.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Of course, you're right, OLEDB/ATL is not easy and may be overkill. And my comment about ADO was just kidding - I think ADO is good for simple DB apps with low requirements to performance and amount of data. I just don't think that DAO is easier than ADO (it's even the same three letters, just shuffled around ), and I don't think ODBC is easier than any of them.
But if the app has any seriousness in it it should use OLEDB/ATL (or a native interface)
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote:
I just don't think that DAO is easier than ADO
I disagree - it's waay easier to use CDaoXXX classes which are integral part of MFC than to #import ADO stuff. For simple app accessing .mdb files it's more than enough.
Steen Krogsgaard wrote:
should use OLEDB/ATL (or a native interface)
You mean Jet native interface? This would kill any chances of easy migration to real SQL database. Long time ago when I was actually working with OLEDB we had a quite compilcated program which could easily run on Jet or MSSQL without recompiling.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Tomasz Sowinski wrote:
You mean Jet native interface?
No, I actually ment native interfaces to databases that are more enterprise-minded (like SQL Server, DB2, Oracle, MySQL etc). I'm not even sure there is a native Jet interface? I guess DAO is the closest you get to a native Jet interface. And native interfaces should only be used if performance is more important than portability. That's what I like about OLEDB - you get a reasonable performance and a high degree of protability.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
This may depend on the version of the OS and/or the version of the ODBC driver... but check to see if you can set the buffer size. I think I ran into something like when moving one of my application to ME and I may have been moving to a newer ODBC driver at the same time (sorry I don't have details on version number just now). Anyway I think there was something that set the buffer to 1024 and I changed it to 256 (or something like that).
|
|
|
|
|
I have a custom control derived from CListBox and instead of using DrawItem I am using OnPaint() instead because the gui is to complex for OwnerDraw (Or so i've determined while attempting to do so).
Anyways the question I have is this:
I have created the listbox with the extended BIT checked and have had problems while painting the control for multiple selection (Although this would be really nice feature).
Using GetSel() and GetCaretIndex()
Doesn't seem to work and causes problems when drawing multiple selections (like drawing items which aren't really selected).
I'm thinking of using the CListBox::GetSelItems() instead, but would prefer to use the above for simplicity. Has anyone ever tried this before and had better luck with using the multiple selection functions...?
Thanks!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I've always used DrawItem() for custom painting of list boxes....Which has always worked well for me....I know that typically DrawItem code can look complex ( and it can be if you are doing way over the top custom painting ) but it works well nonetheless.
There are dozens of samples on this site of how to use that approach. If you can't get your approach working, maybe you should consider the DrawItem approach.....
Just trying to keep the forces of entropy at bay
|
|
|
|
|
AFAIK DrawItem() won't work so i'm left with no choice but to draw with OnPaint() instead.
Everything works fine, but the hilighting of multiple selections.
Ah well it's not really required it would just be nice...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi All,
I need to access some properties of the computer using the ADSI interface.The interface I'm using is the IADsDomain interface.To use this interface I need to get the object of the active directory which I'm doing by the ADsGetObject method.The first parameter to be passed to this methos is the binding string to the particular object.
Since I want to connect to the local computer I'm using the string::
"WinNT://computername,computer"
But the method is not getting executed properly and I'm not able to get the handle of the object.
Can anybody help me out regarding this.
Thanks,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
How can I define the transparent color of the bitmaps I added to a tree control?
I have a tree control with a image list. So, some bitmaps should have a transparent background, when I added in the tree control. How can I define, that a special color (like red, ...) are the background color, and doesn't draw in the tree control?
--
Nice greets, Daniel.
|
|
|
|
|
Use the ILC_MASK in addition to ILC_COLORxxx flag when creating the CImageList, and use the right Create method btw to pass the key color :
BOOL Create(
UINT nBitmapID,
int cx,
int nGrow,
COLORREF crMask
);
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
I created my COM dll using MFC. Now i want to fire events from it. Can anyone tell me how. (i don't want to use ATL)
|
|
|
|