Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
B

Barry True

@Barry True
About
Posts
25
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problems with IProgressDialog
    B Barry True

    As I recall, that's basically what we did as well. I'll double-check this when I can get the code fragment from my co-worker.

    C / C++ / MFC question

  • Problems with IProgressDialog
    B Barry True

    It's been a while since I had this problem but I believe what we ended up doing was to get the window handle of the dialog and force it down. I no longer have access to the code but if I can find out from a person who's still working on the project I'll try to post the code we used.

    C / C++ / MFC question

  • Getting version information into a DLL using manually created .rc file
    B Barry True

    What and where is mergeres.exe?

    C / C++ / MFC c++ question announcement learning

  • Getting version information into a DLL using manually created .rc file
    B Barry True

    First off, I'm running Visual C++ 6.0. I've got a DLL project that runs a batch file that uses the Message Compiler to create the .rc and .h file from a .mc file, then uses the Resource Compiler to create the .res file, and finally uses the linker to create the DLL from the .res file. What I'd like to do is to get the VERSIONINFO information into the .res or .rc file so that we can see this version information in the DLL when the user right clicks on the DLL in Explorer and selects Properties. Does anyone know a way to do this?

    C / C++ / MFC c++ question announcement learning

  • Mouse scroll wheel and MSHFlexGrid
    B Barry True

    Actually it does work (at least it does in our implementation). Just change the ScrollTrack property of the MSHFlexGrid control on your form to True.

    Visual Basic tutorial question

  • Editing cells in MSHFlexGrid control [modified]
    B Barry True

    I've got a VB DLL (VB6) that displays a form with an MSHFlexGrid control that we allow the user to edit. We are displaying combo boxes, text boxes, and other controls to allow the user to edit the cell data when the user clicks in the cell. We've got code to adjust the size and location of the text box and combo box so it is as close to the size and position of the cell. What I'm finding, however, is that with some cells the size and position of the control is pretty close to the cell's size and location. In others, however, the position is noticeably off (as much as half the cell width and height). Here is the subroutine we are calling to position the text box. The code for positioning the combo boxes is similar. Private Sub ShowMyTextBox(myText As TextBox) On Error GoTo ErrHandler Dim strTitle As String strTitle = "frmSettings_ShowMyTextBox" With myText .Width = MSHFlexGrid1.CellWidth .Left = MSHFlexGrid1.CellLeft + MSHFlexGrid1.Left .Top = MSHFlexGrid1.CellTop + MSHFlexGrid1.Top .text = MSHFlexGrid1.text & g_FirstTextChr SelectText myText .Visible = True .SetFocus .ZOrder 0 End With Exit Sub ErrHandler: HandleErrorMsg strTitle, Err, IDS_ERR_MSG2, vbExclamation End Sub The SelectText line above just selects all the text in the text box. The HandleErrorMsg line is just a sub in a BAS module that logs error information to a log file. My question: Is there a better way to position the control over the cell so the difference in the cell's size and position and the control's size and position isn't so noticeably different? -- modified at 17:34 Friday 27th April, 2007

    Visual Basic question help

  • Problems moving date and time control on MFC dialog [modified]
    B Barry True

    I was able to work around the issue but I really don't like the solution. I used the CWnd::SetWindowPos method passing a NULL for the pWndInsertAfter parameter and 0 for the flags. This, in essence, reverses the tab order of all the controls on the dialog since the code is invoking this for each of the controls on the dialog in order from top-to-bottom and left-to-right on the dialog. After doing this, I added code to go back through each of the controls in the same order calling CWnd::SetWindowPos with the proper CWnd pointer for the pWndInsertAfter parameter and SWP_NOMOVE and SWP_NOSIZE for the nFlags parameter. Some additional information: The date and time picker controls don't show up in the Controls window when the dialog is displayed in the Resources panel in the IDE. It appears the date and time pickers are being accessed through the IDTPicker interface in mscomct2.ocx. This OCX is being imported in the class definition header file and the four controls are defined as MSComCT2::IDTPickerPtr data types in the class definition. I'm not sure if this has anything to do with my intial problem. While the workaround is probably sufficient for our needs, I'd still like to know why CWnd::SetWindowPos with the SWP_NOZORDER flag or CWnd::MoveWindow didn't work on the date and time pickers.

    C / C++ / MFC c++ question

  • Problems moving date and time control on MFC dialog [modified]
    B Barry True

    I've got an MFC CDialog class that displays and manages a dialog. There are several controls on the dialog (combo boxes, edit boxes, static text boxes, etc.). Included in the mix are four Microsoft date and time controls. The dialog is used in three separate instances. Not all of the controls are relevant in all three instances so we hide the controls that aren't relevant in each instance, move the controls around on the screen, and resize the dialog to eliminate dead areas on the dialog. We are getting the CWnd for each control and using the CWnd::SetWindowPos() method for each control to move it where we want. To eliminate the need to know which control appears before it in the Z-Order, we pass a NULL for the first parameter and use the SWP_NOZORDER parameter for the flags to keep from changing the tab order of the controls. This works perfectly for all the controls except the four date time pickers. When the dialog is displayed, the date/time picker controls are not visible. It appears that they were moved off the screen somehow or the dialog itself is now at a higher Z-Order than the date and time picker controls. The code was originally invoking SetWindowPos with the first parameter set to NULL and the nFlags parameter set to 0. This changed the tab order for all the controls but the date and time picker controls were visible after everything was moved. The only thing I've changed is to pass the SetWindowPos call the SWP_NOZORDER flag. I've also tried invoking CWnd::MoveWindow instead of CWnd::SetWindowPos but the results were no different. Why is just setting the nFlags parameter to SWP_NOZORDER causing the date and time picker controls to not show up on the dialog after the move? -- modified at 16:08 Monday 23rd April, 2007

    C / C++ / MFC c++ question

  • Problems setting tab order in dialogs
    B Barry True

    Actually I found out what was causing my problems with the CDialog classes. The app we are using is trapping the keystrokes. Some other of our DLLs were using a hook into the app to get the keystrokes passed down to our DLL code. Once I added this hook code into the CDialog2 DLL (see original posting) the tab keys worked. The reason I didn't stumble on this earlier is that we have so many DLLs as part of the project we are working on and the people that originally designed the other DLLs are no longer with the project (typical). I now just have to find out how to do this in the ATL3 DLL code. I've got another template that works in our code so I'll just take a look at that. Thanks for your help.

    C / C++ / MFC question c++

  • Problems setting tab order in dialogs
    B Barry True

    No. None of the dialogs are configured with this extended style. -- modified at 15:52 Tuesday 10th April, 2007

    C / C++ / MFC question c++

  • Problems setting tab order in dialogs
    B Barry True

    I have three DLLs that display dialog boxes. The classes that display the dialog boxes for two of them are derived from CDialog and the third one is an ATL dialog. For sake of argument, we'll call the two CDialog classes CDialog1 and CDialog2 and the ATL dialog ATL3. The CDialog1 dialog has over 60 objects on it, a mix of combo boxes, edit boxes, radio buttons, and command buttons. CDialog2 has a much smaller number of objects on it but they are all standard controls. The same is true for ATL3. I've got the tab order set in all three dialogs so that pressing the tab key should allow the user to traverse the dialog in top-to-bottom, left-to-right order. However, when I run the application that loads these three DLLs the tab order for CDialog1 appears to be exactly opposite to what the tab order was defined. When the CDialog2 and ATL3 dialogs are displayed the tab key does nothing on either one of them. All three have one of the command buttons set as the default button. My questions are: 1) Why does CDialog1's tab order at run-time appear to be exactly backward from it's defined tab order? 2) Why does setting the tab order for CDialog2 and ATL3 not appear to be working? 3) Does setting a default button on the dialog have an affect on the tab order?

    C / C++ / MFC question c++

  • Mouse scroll wheel and MSHFlexGrid
    B Barry True

    Anyone know how to get the mouse scroll wheel to work in an MSHFlexGrid (or any control with vertical scroll bars, for that matter) in VB6?

    Visual Basic tutorial question

  • Selecting multiple rows in an MSHFlexGrid
    B Barry True

    I finally figured out my problem. I was looking at the .row property instead of the .rowSel property. Once I figured this out the rest was relatively easy.

    Visual Basic question

  • Changing MSHFlexGrid so it doesn't select the first non-fixed row when clicking in a fixed row
    B Barry True

    Does anyone know if there is a way to configure the MSHFlexGrid control so it doesn't highlight the first non-fixed row when the user clicks in a fixed row?

    Visual Basic question

  • Running regsvr32.exe from CreateProcess
    B Barry True

    I'm not running multiple copies of regsvr32 that I'm aware of. The only thing I can think of that would cause problems is that the process that I'm invoking regsvr32 from doesn't have admin privileges. However, I can set up a test app using VB and run it from an account that I know have admin privileges and I get the same results. If I set up a Visual C++ app that does the same exact thing as the VB test app, it works perfectly. -- modified at 12:37 Monday 5th March, 2007

    Visual Basic question com help

  • Selecting multiple rows in an MSHFlexGrid
    B Barry True

    I've got an MSHFlexGrid on a form and it is set up to not highlight cells or rows when the user clicks. Howver, I've put code behind the click event to check the background color of the cell in which the user clicked. If it is not yellow, I set the background color of all cells in the row to yellow. If it is yellow (i.e., selected) I set the background color back to white. What I want to do is to allow the user to select multiple rows by holding the shift key down while they click but this doesn't seem to be working. When the shift key is held down during the click event, the row that is selected appears to be the same row that was selected when the first cell was clicked in rather than the actual row in which the mouse click event occurred. Does anyone know how I can get tis to work the way I described?

    Visual Basic question

  • Context Sensitive Help in an ATL Dialog
    B Barry True

    This worked. Thanks again.

    ATL / WTL / STL c++ help question

  • Running regsvr32.exe from CreateProcess
    B Barry True

    Sorry. In the previous example I should have added the trailing Chr(34) for the ending set of double-quotes instead of the end paren.

    Visual Basic question com help

  • Running regsvr32.exe from CreateProcess
    B Barry True

    I'm just setting up the command line in a string and passing the string to CreateProcess like this: Dim cmdLine as String cmdLine = "regsvr32.exe " & Chr(34) & "C:\Program Files\ProgramFilesFolder\DllFilename.dll") I'm passing a NULL string for the application name, a NULL for the process attributes and thread attributes, not inheriting the handles, NORMAL_PRIORITY_CLASS for the priority class, NULL for the environment pointer and current directory, and pointers to a startup info and process info structure with just the sizes set in both. Should any of these parameters on the CreateProcess call be set differently?

    Visual Basic question com help

  • Running regsvr32.exe from CreateProcess
    B Barry True

    I am but I am enclosing the path in double-quotes. I found this out the first time I tried it without double-quotes. Regsvr32 complained about not being able to find the C:\Program component. What I found was that I could set up an console app built in Visual C++ to do this and it worked fine if I ran it from the command line. But if I called the Visual C++ executable from my VB app, it gave me the same error. It looks like it has something to do with trying to run regsvr32.exe from a VB instantiated thread.

    Visual Basic question com help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups