Damn that's right ! I was wondering where it was... Just in the Styles property sheet of my control :). However I wonder how I can simply change the color to blue as if the list control still had the focus. Actually it greys the background. Earth > Europe > France > Lyon
Jean Marc Molina
Posts
-
CListCtrl set multiselection -
CListCtrl - Selection ProblemHello, Thanks for the info but can't we achieve this using a OnItemchangingMyList function ? :
void CSQLiteAddressBookDlg::OnItemchangingListContacts(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; // return FALSE (or 0) to allow change, TRUE to prevent // http://www.celticwolf.com/FAQs/CListCtrl_FAQ.html *pResult = 0; }
As specified in the Celtic Wolf FAQ, I should affect FALSE or 0 to pResult in order to cancel the selection change. But it doesn't work. I even tried to use OnNotify but can't find a way to make it work. It seems events LVN_ITEMCHANGED or LVN_ITEMCHANGING never occur.BOOL CSQLiteAddressBookDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { switch (wParam) { case IDC_LIST_CONTACTS: { LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam; switch (pnmv->lParam) { case LVN_ITEMCHANGED: { TRACE0 ("LVN_ITEMCHANGING\n"); break; } case LVN_ITEMCHANGING: { ... break; } } break; } } return CDialog::OnNotify(wParam, lParam, pResult); }
I checked codeproject tutorials and can't find anything about using OnNotify with List controls. Thanks, JM Earth > Europe > France > Lyon -
ListCtrl: maintain the slection after repopulating it...Do you think I can use that trick in order for my list control not to deselect all items one it loses the focus ? When I press a button it deselects all items from the list... I have to select them again... JM Earth > Europe > France > Lyon
-
A simple question about CListCtrl::InsertItemYes first you have to insert columns, then you can insert rows as items. Finally you can set each columns values for that new item : InsertColumn, InsertItem, SetItem for each column... Hope it helps, JM Earth > Europe > France > Lyon
-
Setting intermediate files path to a global folder using an environment variableHello, I would like to set the intermediate files path from the Project Settings > Settings For > Win32 Debug/Release > General tab to a global folder. It would allow me to build my projects in a temporary folder that I can delete and clean up any time without deleting nor affecting my working projects. Its default value is Debug or Release, depending of the configuration you select, Win32 Debug or Win32 Release (for a MFC application). I created an environment variable named "vcc_tmp". Using the command line I can change the current directory to that folder using "chdir %vcc_tmp%". Windows knows that it has to replace %vcc_tmp% by its value. So I tried it with VC++ but it doesn't replace the variable by its value, "%vcc_tmp%\MyApp\Debug" doesn't work. It creates a new folder named "%vcc_tmp%". The problem is that a lot of people are working on many projects. Lot of people, lot of projects. So I can't affort choosing "static" path for all these projects. Each developers would have to create an environment variable "vcc_tmp" and set it to its temp folder. I don't want to choose "c:\vcc_tmp" as some people can't use their c: drive to store temp files. Moreover using the OS drive as a tmp drive is not a good idea, defrag, scan... No no no :). So if you have any remarks and suggestions or solutions, don't hesitate to reply to that thread. All help is welcome. Kind regards, JM. Molina Earth > Europe > France > Lyon
-
DB engines for software local/file DB (no server running)Hi Andy, MS-Access does provide encryption. Choose "Tools->Security->Encrypt/Decrypt Database" from the main menu. I know at least one major bank that uses Access in this way. I know I can encrypt my DB. I also protect it with a password. I can't believe the passwords are not even encrypted if the DB is not encrypted too... If the DB is only encrypted, users can read it with MS Access and I don't want them to. If the DB is encrypted and password protected, they can't read it anymore... Unless they use one of the dozen of "password recovery tools" you can get everywhere on the web. Which means my DB is not protected at all. What really worries me, it's that they can retrieve my DB password. It's unreadable... first... my application connects to it using a password... But when the user uses a password recovery tool on it, they get the DB password AND users passwords. Passwords I would use for all my DBs, accounts... My solution would be to release a special DB, protected by a "dummy" password (only known by the application), with a special user account that has read and write access to the DB, tables... But It requires a lot of modifications and messes up my all release process. You should be able to find a copy of MSDE on the Microsoft Office-2000 installation CDs (its not installed by default). MSDE is basically a stripped-down version of SQL-Server. I have a copy installed on my kids' Windows 98 box. The main problem is that no administration program is provided (like SQL-Server's Enterprise Manager). However, there are freeware program available that replicate much of this functionality for you. Note that MSDE is implemented as a server process (just like SQL-Server) - so this may rule it out as an option for you. Alas! I can't use MSDE. Moreover I am sure there's somekind of perfect security system for MSSQL DB. If you are not storing much data then you might take a look at ADO presisted-recordsets. These are written to you PC's disk as an XML file. The main problem with this (and XML in general) is that the files are not encrypted. For more complicated XML, you would probably use Microsoft's MSXML component. There are hundreds of APIs and XML-DBMS and I don't really know which one to pick... The Apache one sounds like a good choice to me. About security, I am sure that some of the XML DBs have a security layer. Decrypt Database Did you ever tried to Decrypt a MS Access DB ? If I exclusively open an encrypted MS Access DB, when I select Encrypt/Decrypt, it does
-
DB engines for software local/file DB (no server running)Hello, I develop a desktop application with MS VC++ 6/MFC/ADO that uses a MS Access DB to store my application data (in a .mdb - local database - file). I would like to : - protect the DB integrity by encrypting it or at least hiding that it's a MS Access DB to the user (renaming the .mdb to .dat is not enough) - try different DB engine to handle the file, even if it's not a MS Access one anymore - handle the local DB with NO server running (can't do it with MySQL++ for example, see below) I'm not a DB expert so I don't know much about DB engines and Visual DB managers. What do you guys use as a DB engine ? Actually here's a list of the following DB engines or systems I want to try or already know : - MS Access : can't design my DB and handle it from my app, everything is "perfect" but I want to try new things... And I don't know how to encrypt its data or protect it from the users - Visual FoxPro : It's part of my MSDev 6 Pro package but never really gave it a try. It sounds like an other MS Access to me... What are the main differences ? Maybe I can easily protect my DB integrity with it... Does anyone know or use Visual FoxPro ? - CodeBase : DB engine that supports tons of IDEs and languages ! If you know it or use it, what do you think of CodeBase ? - MSDE : someone adviced me to use MSDE but It's part of MS SQL Server 2000, It seems that I can't download it from the MSDN website, it's not MSDev 6 compliant (only supported by .NET). Note that I can't affort MS SQL Server 2000, far far too expensive and I don't need such a DBMS for my the softwares I develop - MySQL : I really like MySQL because I also develop web based applications, however I have to connect to a "host" in order to access the DB, I can't connect to a file with ADO or MySQL++ (MySQL C/C++ API)... - XML Database : for small DB I thought It could be nice to use a DB engine that uses XML files (manage a configuration file, address book...), what do you think ? Do you know of any good API ? Kind regards, JM. Molina Europe > France > Lyon
-
Using mySQLHi, Thanks for the tip ! So MSDE is a database engine that you can use in your desktop application ? Is it VC++ 6 compliant ? Where can I download it ? I can't find it on MSDN (http://www.microsoft.com/sql/techinfo/development/2000/MSDE2000.asp). Regards, JM. Molina Web: http://goa.ifrance.com
-
Using mySQLHi Matt, I totally agree, MySQL is my fav DBMS and it only lacks Triggers and Stored Procedures. It's easy install (download and launch installer, then it runs as a NT service) and powerful. However I wonder if you were able to handle a local database using MySQL++, local database : DB as a file (like MS Access .mdb files...). JM. Molina Web: http://goa.ifrance.com
-
Installing MySQL on WindowsHi, Simply download the Windows Binaries, install it and that's all. You don't need Cygwin unless you want to compile MySQL by yourself. JM. Molina Web: http://goa.ifrance.com
-
MS access relationships and ASPHi, > The Dept head at the second table is linked with the EmpId in the first table by means of the relationships.... From your table definitions, I think DeptId is a foreign key that links the Employee to a Department. > NOW, will it be possible for me to access the first table data, by querying the second table. It depends of what you want to do. What do you mean by "access the first table data" ? Do you want to know the employees for a specific departement ? Just a DB design tip : - don't use prefix on your field names : Employee.Id or Department.Id are ok, Employee.EmpId or Department.DeptId/DeptHead is a redondance JM. Molina Web: http://goa.ifrance.com
-
MessageBox variationHello, The solution is to first format your string, then display the message box. The best way is probably to use a varlist and to implement your own function. Here is my own:
int AfxMessageBoxFormat (LPCTSTR lpszFormat, ...) { // Build message from parameters CString s; va_list args; va_start (args, lpszFormat); s.FormatV (lpszFormat, args); va_end (args); // Message box return AfxMessageBox (s); }
Hope that helps, JM Web: http://goa.ifrance.com -
MFC Select multiple folders (not files) + Components LibrariesHello, I need a MFC component to select multiple folders using a CFileDialog-like dialog. I found tons of wrappers but none of them allow me to select multiple folders. I wonder if such a component exist or do I have to develop it by myself ? Maybe there's a good MFC components library out there that supports such a great feature. My ideal component is like the Kazaa one, you select folders from a Explorer tree view, each folder name is prefixed by a check box. This way you can select folders from all around your network disks and local hds. Thing you can't do with CFileDialog. However such a component sound very hard to develop as I can't figure out to use the default ShellBrowser component. I would only have to hook its treeview and set its checkbox attribute to true... So easy :) Last but not least, as I don't think such a "free" component exists (not found on codeproject nor codeguru), would you be interested by such a component ? Kind regards, JM Web: http://goa.ifrance.com
-
ATL/WTL vs MFCThanks Ernesto I totally agree. I use MFC because of its community and good references (books, websites...). I would like to learn VB too because It would improve my app dev workflow... I won't use WTL because I can't find anything interesting about it. No books, no references, it's not official so there's no support... The idea of developping an other MFC is a great idea but I talked with some guys about it and I don't think It can be a better library. It's supposed to be fast, small and flexible but actually It's a very very light MFC-like library and it lacks a lot of features. Moreover MFC7 is far better that MFC4.2... So I will stick with my good old MFC4.2 and Visual C++ 6 because It perfectly suits my need. But I will buy COM ATL 3.0 to learn a few things about COM/ATL :) Thanks again, JM Web: http://goa.ifrance.com
-
ATL/WTL vs MFCHi Michael, Thanks for the reference but isn't it too Advanced or "Internal" ? I want somekind of Workshop book. For example one of my all time fav book about MFC and Windows app dev is: Inside Visual C++. I thought "Developer's Workshop to COM and ATL 3.0 by Andrew Troelsen" could be that book. People also adviced me to buy: WROX - Beginning ATL 3 COM Programming Microsoft Press - Inside COM by Dale Rogerson I am also a bit scared because I don't know anything about DCOM nor COM+... Oh my god I feel dumb ^^. But first let's learn a few things about ATL/WTL :). Here is a very interesting article about MFC vs ATL/WTL: http://archive.devx.com/free/mgznarch/vcdj/1999/julmag99/atlinherit1.asp JM double zero ATL/WTL developer Web: http://goa.ifrance.com
-
ATL/WTL vs MFCHi, Well if WTL is that great why can't I find any books or references on it ? Nothing on Amazon nor MSDN. It sounds like a 007 library for spy developers :D. MFC is not perfect but I like it anyway, it's between the beauty and the beast which means you have both worlds. I can't dig into WTL or ATL if I can't find anything about useful information about it. The 5 articles from CodeProject don't really explain anything about ATL and the WTL one presents that library in its darker side. Any books or articles I should read ? Thanks again, JM Web: http://goa.ifrance.com
-
ATL/WTL vs MFCHello, I am new to ATL/WTL and I don't really understand why I would need these libraries. Actually I only developed my applications with MFC and some ActiveX components. I read some articles about ATL and WTL on CodeProject. In the one hand I read 5 articles about ATL and understood nothing, the writer mostly talk about pointers and vtables... What's his point ? What about saying "ATL is...". Then I read the introduction to WTL and understood that It was somekind of MFC-COM wrapper. Why would I need a MFC-COM wrapper to developer a software ? Moreover It seems that it's not an official library and I can't find any information on MSDN: "Your search using "All words" for ""wtl"" returned 0 results." If you have any good articles or books to advice me, that would great. I feel like I am losing something. Is "Developer's Workshop to COM and ATL 3.0" a good reference ? I don't really understand why I would need something else that MFC to develop a Windows Application. All your help is welcome, JM Web: http://goa.ifrance.com
-
ActiveX control for IE ?I wonder how I can use an ActiveX control in IE. I develop an ActiveX control... like a clock for example and I want the user to install the control... it displays a Yes/No license agreement... it installs the control and then it executes the control. Like it works for Quicktime plugins... Any tips ? Jean-Marc Molina Email: jmmolina@ifrance.com Web: http://goa.ifrance.com