Microsoft Knowledge Base Email Alertz

You have a container class that contains an Assign method for the Enabled or some other logical property. You create another container class based on this original container class. You create a third container class based on the original container....

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 221730 - Last Review: October 15, 2002 - Revision: 1.0

FIX: Enabled_Assign Fires Incorrectly for Container in Container

This article was previously published under Q221730

On This Page

SYMPTOMS

You have a container class that contains an Assign method for the Enabled or some other logical property. You create another container class based on this original container class. You create a third container class based on the original container. This third container class also contains an instance of the second container class. If you add an instance of the third container class to a form, and toggle the value of logical property in the member container, the parameter passed to the Assign method for the member container will be of numeric rather than logical data type.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022  (http://kbalertz.com/Feedback.aspx?kbNumber=194022/EN-US/ ) INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295  (http://kbalertz.com/Feedback.aspx?kbNumber=194295/EN-US/ ) HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

Steps to Reproduce Behavior

  1. Type the following in the Command window:
    CREATE CLASS basecontainer AS CONTAINER OF test.vcx
    					
  2. From the Class menu, select Edit Property/Method.
  3. Highlight the Enabled property in the Property/Method information list box.
  4. Click the Assign Method check box and then click the Apply and Close buttons.
  5. Add this code to the Enabled_assign method:
    LPARAMETERS lNewVal
    THIS.Enabled = m.lNewVal
    IF VARTYPE( m.lNewVal) # "L"
       MESSAGEBOX( "Enabled_Assign was passed a non-logical value." ; 
          + chr(13) + "The value passed was "+trans(m.lNewVal))
    ENDIF
    					
  6. Save and close the class.
  7. Type the following in the Command window:
    CREATE CLASS SubCont OF test.vcx AS basecontainer FROM test.vcx
    					
  8. Save and close the class.
  9. Type the following in the Command window:
    CREATE CLASS OtherCont OF test.vcx AS basecontainer FROM test.vcx
    					
  10. In the Class Designer, add an instance of the SubCont class to the OtherCont container.
  11. Save and close the class.
  12. Create a new form called Test.
  13. Add an instance of the OtherCont class to the form.
  14. Right-click on OtherCont1 and select Edit from the context menu.
  15. Click the SubCont1 container.
  16. Change the Enabled property of SubCont1 to .F. in the Property Window.
  17. Save and run the form.
  18. You should see the message where the enabled_assign method is receiving a non-logical parameter. Notes: This will also occur with other logical properties such as Visible.

APPLIES TO
  • Microsoft Visual FoxPro 6.0 Professional Edition
Keywords: 
kbbug kbfix kboop kbvs600sp3fix KB221730
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate