Hello, It is not really what I was looking for because I would like to keep my code as is, just add the the routine that maximizes the dialog and re-organizes all the controls. If I would like to do it as described in this article, I would have to change a big part of my code to create all controls independantly, etc ... But never the less, I will have a look in the part that calculates the new position and size of the control ... ;-)) Thanks Regards DD
Qadddd
Posts
-
Programatically resise a Dialog and reoganize its controls -
Programatically resise a Dialog and reoganize its controlsHello, Good idea to put all my business in the OnSize() function. My biggest problem now is to determine the position, length and height of each control depending on the screen resolution. Thanks for help Regards DD
-
One more on print orientation and paper size specificationsHello, <> If I asked you for more details, it is simply because I don't see any link between your code and mine and, as it is, it does not help me at all. I don't see how I can use it. Evermore, I received compilation errors. <> It is not what I expected from you, I just need some explanations that I could understand and, if possible, linked to the code I wrote . This will probably help me to understand this function usage <<1) "before you start printing" means before you start outputting anything to the printer DC.>> Is this answer supposed to help me ... really ?? <> Work is what I am doing almost every nights until 2am when I write my (quite big) application after my normal work day. I can't offer me the luxury to loose 2 days in searching and trying without success. <> I spend 2 days to "play" with MSDN documentation and search thru codeproject and codeguru articles to find a basic article that explains how to use this DEVMODE easily in a context that matches my type of program. I also wrote a lot of code to try it. Ok. I can retrive the current DEVMODE, but when I change the content, how do I precise that I want to use it ?? ResetDC is a CDC method, I have no CDC, just a HDC, so ... And it is because I did not find the correct way to use it, that I finally post my question ... <> I am trying to find a solution that suits my code, I am not copying your code without trying to understand it, it is not very funny. Nevertheless, thanks for your time and your example I can't understand. DD
-
mark a row as selected in a list controlStrange .. it doesn't work. In fact, if I add the LVS_SHOWSELALWAYS option, the control works as if there was a hot item, the fact to keep the mouse pointer over an item selects it, but as soon as I click my buttons, the highlight desappears ... Very strange ... Could it be a kind of icompatibility with another option? I also use : LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_INFOTIP, LVS_REPORT I really don't understand what happens .. Thanks in advance for help DD
-
mark a row as selected in a list controlgood idea !! it is true that the list lost control because I clicked the button ... Thanks for answer DD
-
mark a row as selected in a list controlhello, that's exactly what I tried (except if my memory fails), LVIS_SELECTED as value and as mask ... I also tried LVIS_FOCUSED ... but without success. I will doublecheck tonite. This should immediatly highlight the item, no need of redraw or something else ? Thanks for the answer DD
-
mark a row as selected in a list controlHello guys, I am trying to play with a List control (report style) and I would like to do the following thing : I select a row in my list (that becomes highlighted) and, thanks to 2 buttons (UP and Down), I exchange the place of this raw with the previous one (UP) to make it go to the top of the list or with the next one (DOWN) to make it go to the bottom of the list. After a click on one of my buttons, I exchange the 2 rows, my row is no more highlighted and I would like it to keep highlighted. I have tried to play with the SetItemState to set the focus and the selection bits to make it highlighted again but without success. So my question is : how do I give my row this selected aspect (highlight) by program? Thanks in advance DD
-
What should I do to use SSTab control activeX in VC++ ?Hello, I would like to use VB activeX SSTab control 6.0 SP5 in VC++. So I add this activeX to my project (Dialog Application), I add one of this tabbed dialog in my dialog to do a kind of property sheet. Ok, it is very easy to create a property sheet with x tabs, choose the style, the color, etc etc ... But : 1) Why can't I see clearly the control in my dialog when I create it? I just can see the border but I can see it when I launch the app or have a preview of the dialog in the ressource editor ... 2) when we read MSDN, it is easy to add controls in the tabs by just selecting the tabs and add control in it ... when I do it, controls doesn't "belong" to the tabs, they are just over it and desappear as soon as I click on another tab ... what's wrong with this ? 3) how do I 'link' my SSTab pages with the controls or with the other doughter dialogs, as I do with property sheet ? 4) How do I set the values in these pages? How do I retrieve the input values, the clicks done on various controls, etc etc ?? I do not find any doc describing how I should do this :-( Any infos appreciated Thanks in advance DD
-
How can I produce a report ...Hello, Finally I choose to play with GDI . So I use these pDC->MoveTo(Startx, z) and pDC->LineTo((Startx + LTot), z) to draw the grid and these pDC->GetTextExtent(C61Title[0]) and pDC->TextOut(a, b, C61Title[0]) to put my value in the grid. Now, in order to better differenciate the titles from the values, I would like to fill in grey the cells before writting my titles in ... do you have an idea of how I can do this ? Thanks in advance DD
-
VC++ - WinXP vs Win2k + ODBC + Dbase filesHello, yes, how stupid I am !! you are totally right, I modified this option on my Win2k station and forget to say to do so when configuring the WinXP station. Thanks DD
-
VC++ - WinXP vs Win2k + ODBC + Dbase fileshello, So I have written a little application in VC++, and I access a dBase files via ODBC. My development machine has a Win2k OS. I copy all .dbf and all .dbt files from my machine to another one with a WinXP OS. When I start my application on both machines, I have discrepencies in the number of records returned by my SELECT statement even if the files are totally identical : it seems than I receive deleted records on the XP machine. When I look at table used with FoxPro on my Win2k machine,all extra records have a black square -I assume this means deleted row? - at the beginning of the row) and that these deleted records are not returned on Win2k machine ... 1) does it look like an already known problem ? 2) on Win2k machine, the MSJET40.dll must be issued from a SP5 when i look at its version#: I wanted to upgrade it to the latest version SP8, but when I try to launch the upgrade exe, I receive an error message that tells me that I must at least be with SP3 ... How is this check performed ? 3) Is there a difference between MSJET on Win2k and winXP ? Any information or solution is welcome ... DD
-
VC++ / ODBC / CSV files : how to perform UDDATE and DELETE statementsHello, I was talking of this limitation only for ODBC used to access CSV files (and maybe others)! But fortunately, it works fine with MySQL and SQL Server (for those I already used) and probably Oracle and a lot of more DB's, else it would have a very reduced interest to use ODBC. Because if we do SELECT to extract our data and INSERT to add them, we are obliged to UPDATE and also DELETE them ... Look at http://support.microsoft.com/?kbid=281759 Nevertheless, I have 2 remarks for Microsoft : 1) I find to easy to say "We don't support UPDATE nor DELETE for ODBC on CSV file" 2) I would have prefered a clear message as "This SQL statement is nor supported by this ODBC driver" instead of "Bad request format" ! The 1st msg indicates clearly that it works (not) as designed, while the 2nd msg can mean that you are stupid and don't how to write a SQL UPDATE statement ... I am lucky, my files will become soon a table under MySQL and, as they are not so big, I have been writing some dirty code to rapidly do the UDDATE. Regards, DD
-
VC++ / ODBC / CSV files : how to perform UDDATE and DELETE statementsHello, I was writing a little application and I wanted to save some informations in a CSV format file. I expected to use ODBC to interface my file. I wrote some INSERT and SELECT statements and it worked fine. But when I wanted to use the UPDATE, I got an error message saying that "my command had a bad format" ... They could have said "ODBC doesn't support UPDATE or DELETE" !!!! Because, after having searched a while what could be wrong in my format , I came on the web and found a note on microsoft site saying that ODBC doesn't support UPDATE or DELETE ... Nevertheless, is there really no way to make it work? Should I write some code that will delete the line from the file and use an INSERT after ? Is there any way to retrieve the path I set in ODBC to access my file ? Thanks in advance for help DD
-
How can I access to files with .DBF extension ?Hello, my code seems to work correctly, but I have some problems : 1) SELECT in the files returns me no record but an error message: "Impossible de trouver le fichier memo xBase Demande", in english it can be traduced by "impossible to find the requested xBase memo file" .... If I open the file with Excel and launch my appli accessing the file, all records are correctly selected and returned ... Strange I know, but true. Simple, to test my appli and until I have a better solution, I just open all accessed files with Excel at the same time ... Any idea on the cause of this problem and its solution? 2) I thought I had a too old version of my ODBC drivers, so I wanted to upgrade them ... With microsoft, it is never easy to find anything, so what should I upgrade to upgrade my ODBC drivers ? Seems to be MSJet engine ... So I downloaded the lastest MSJet4.0 sp8, but when I want to install it, it refuses to do it and tells me that I should already have at least the sp3 installed to install this sp8 ... The problem is that, when I verify manually the version of the dll, the version corresponds to a sp5 ... So I don't know what to do to perform my installation ... 3) ODBC and MDAC ... are both linked ? if I upgrade ODBC, should I also upgrade MDAC ? and if yes, which version of MDAC should I install (I have the MDAC 2.5 sp2 installed at the moment)? 4) in one of my dbf table, I have to make a selection on an ID to retrieve a record. This ID seems to be numeric but must not be declared as a standard numeric or even text value (I am thinking to an auto incremented value or style like that) because, in my clause WHERE, when I don't use the quotes, ODBC send me a error message saying that my format is not correct, and when I use the quotes, I don't receive the error, but no record is returned (even if my file is opened with Excel ...) is the any other way to write my request ? Sorry to bug you again with this but I am a little bit stuck Regards DD
-
ODBC - dbf files - strange error msgHello, in my VC++ application, I use ODBC dbf files driver to access a file.dbf. In my code, I open the data the database connection (it works normaly). Then I do my request : "SELECT Field1,Field2 FROM tab WHERE (Field0 = value)". Here, I recieve an ODBC error message "Impossible de trouver le fichier memo xBase Demande", in english it can be traduced by "impossible to find the requested xBase memo file" .... 1) what does ODBC want to say with this message ? 2) what is the cause of this message What is strange : I just open the file dbf with Excel (no modification in file, no save of file, just open to view the content), I restart my VC++ application and the Select returns me some rows ... just as the fact to have the file opened makes it work ... I tried several times and without Excel, I have the msg, with excell it works ... Any idea appreciated DD
-
How to display an image loaded from a file on a dialog ?Hello, what I would like to do is to display a logo (jpg or bmp) in a static control on a dialog. This logo will always have the same size and will be stored in a file logo.jpg or logo.bmp located on user station, it will be loaded in the dialog at initialization time (no bitmap stored in the ressources). This will allow me to be more flexible and to customize the dialog for each user station. I will just give each user a different file logo.jpg or logo.bmp. Thanks in advance for any information Regards DD
-
VC++ - ODBC : can't reach the last records of my file.dbfok, i have found my 1st problem ... it is due to the wrong date format I passed in the WHERE clause, it must me in the US format (MM/DD/YYYY) and I was giving it in french format (DD/MM/YYYY) ... So, I don't need to upgrade the MSJet stuff Nevertheless, I would like to know if anyone has an idea on the strange message displayed by the prog supposed to upgrade MSJet ... Regards DD
-
VC++ - ODBC : can't reach the last records of my file.dbfI used ODBC "dBase files" to access a file GSTAT.DBF, my code is the following : DBName = GlobalDSN + "Gstat;UID=;PWD:"; ErrMsg = ""; res = "SELECT DATUM,CASHT,MCASHT,NETROOM,MNETROOM from GSTAT WHERE (DATUM = #08/01/2004#)"; gDB.OpenEx(DBName,CDatabase::noOdbcDialog); TRY { rs.Open( CRecordset::forwardOnly, res ); NbRecord = rs.GetRecordCount(); } CATCH(CDBException, e) .... The problem is that it works perfecly on the 1061 first records, but it refuses to find me the records 1062-1068 (1068 being the last record in file)... and I wonder why ? I thought that it could be due to a problem with MSjet 4.0 dll because mine is quite "old" (as far as I can see, my version 4.0.4431.3 is from SP5. I downloaded the SP8 from MS, but when I was to install it, I receive a message from the installation program saying that my version is too old and that I should have at least the SP3 ... Once again, I don't know why Any idea on 1st or 2nd of my problem will be appreciated DD
-
How can I access to files with .DBF extension ?BadJerry wrote: "Select * from MyTable" BTW I suspect the table name is the name of the dbf file... ok, this pleases me !!! BadJerry wrote: consider using ADO though... I am using these files just to pick some basic informations in, no delete, no update, no complicated SQL stuff. The dBase application producing these files will soon desappear to be replaced by something using Oracle ... So I will keep it like that. But just for my info : what is the advantage of CDaoDatabase compared to CDatabase class ? The example I looked before was using CDaoDatabase, I took the code and didn't see a lot of benefits using this class. Further more I need to import a lot of code to make it even compile, the CDaoDatabase isn't known while you just add #include "afxdb.h" for Cdatabase ... BadJerry wrote: Une fois que tu auras fait ca une fois, tu verras, ca n'a rien de sorcier! oui, c'est la premiere fois que ca fait mal ... A la prochaine DD
-
How can I access to files with .DBF extension ?re hello ! BadJerry wrote: did not realise you were French too my perfect english probably ... ;-))) BadJerry wrote: Then in ODBC, you do not need to repeat the path of your file, simply the name of the DSN? I aggree ! but I for step 4 : A) the DSN should be set to the directory containing the file.dbf and the I specify the name of the file.dbf in the rs.Open( CRecordset::forwardOnly, SQLCmd )(what I suppose) or B) the DSN should be set to the directory+file.dbf and then, I have no clue on what SQLCmd has to be in the rs.Open( CRecordset::forwardOnly, SQLCmd) ? DD Et merci pour le Bonne chance, je n'ai pas fini de souffrir avec ce que que je suis en train de faire ...