Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Color Picker in form
Message
De
03/02/2007 16:30:31
Tim Muller
Innovative Solutions, Inc.
West New York, New Jersey, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Calling Color Picker in form
Divers
Thread ID:
01192141
Message ID:
01192141
Vues:
87
I am using the following to call the Color Picker

oDlg = Createobject("GetColorEx")
= oDlg.Getcolor(255)

DEFINE CLASS GetColorEx AS form
*Left = 100 && Set Dialog Position by positioning the form
*Top = 100 && Set Dialog Position
AutoCenter = .T.
Name = "GetColorEx"
DoCreate = .T.
Visible = .F.
lUserCancel = .F.

ADD OBJECT oCDC AS OleControl WITH ;
OleClass = "MsComDlg.CommonDialog"

PROCEDURE oCDC.Init
This.Flags = 2+1
This.CancelError = .T.
ENDPROC

PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
IF nError = 1429
This.lUserCancel = .T.
ENDIF
ENDPROC

PROCEDURE GetColor(tnInitColor)
LOCAL lnColor
IF PCOUNT() > 0
Thisform.oCDC.Color = tnInitColor
ENDIF
Thisform.oCDC.ShowColor()
IF Thisform.lUserCancel
lnColor = -1
ELSE
lnColor = Thisform.oCDC.Color
ENDIF
RETURN lnColor
ENDPROC

ENDDEFINE

This sits in a PRG that is called from the menu. I have not touched the PRG in over a year. Everything worked fine until several weeks ago. It still comes up, but when the form is closed, the mouse no longer works in VFP. My menu hot keys still work and when I use a menu hot key to bring up a form, I can type in the form but not use the mouse (except inside a combo). If I run the above PRG from the Command Window, everything works fine.

If I move the EXE of my app to another machine, I have the same failure issues.

I am suspicious that the Common Dialog on my machine has developed a problem. Can I just restore the common dialog DLL/EXE from a backup?

Any thoughts?


Tim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform