Page 2 of 2 FirstFirst 12
Results 41 to 60 of 60

Thread: Problem with executable file

  1. #41
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Problem with executable file

    When I try to run it I get an error message because RotateText.ocx is missing. I can ignore that (I think) but there are also errors involving two missing references, PISDK 1.3 type library and PISDKParse 1.1 type library. If I comment out the global references to them I get to frmMain Form_Load and I run into this.

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim intCol As Integer
    3.     Dim intwidthcounter As Integer
    4.     Dim colcounter As Integer
    5.     Dim rowcounter As Integer
    6.     Dim i, j, k As Integer
    7.     Dim optButton As Integer
    8.     Dim CurrentTab As Integer
    9.  
    10.    
    11.     frmMain.Caption = "Manual Entry PM10 - Revised July 4, 2005" 'frmMain.Caption & " (Version " & App.Major & "." & _
    12.         App.Minor & "." & App.Revision & ")"
    13.    
    14.    [HL="#FF8080"]ListIndex = 0[/HL]
    How can that compile?

  2. #42

  3. #43

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by MartinLiss
    BTW, it's a very common mistake but in Dim i, j, k As Integer only k is actually defined as an Integer and the other two are left as Variants.
    Wasn't aware of that (saw others doing this and thought it was OK). Thanks for the tip.

    As for the other problem. Did you rem out the call to PIConnect (uses the PISDKs which are used by dedicated server you don't need). Attached is the RotateText.ocx. Are you saying the program "hangs" when you get to "ListIndex = 0"? Maybe it's related somehow to the error messages you received.

  4. #44
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Problem with executable file

    I removed your RotateText.ocx because I assume it's a commercial product. I did rem out the call to PIConnect but that doesn't affect the fact that I don't have those references since there are variables that refer to them. Regarding ListIndex = 0, no it doesn't hang, it's just that that is not valid code and so the program won't run. The ListIndex must be associated with a ListBox or Combobox, eg MyListbox.ListIndex = 0.

  5. #45

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    As for the PI-SDKs, I just realized it is because the app specifies these under Project>>References. Will have to PM you a revised vbp file. As for the "ListIndex = 0", I rem'd this.

  6. #46
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Problem with executable file

    OK, using your new files I can get it to run after doing the following and a few other things.

    VB Code:
    1. '    Public srvPI As PISDK.server
    2.     Public strMessage As String
    3.     Public con_lngError As Long
    4. '    Public p_ptPoint As PIPoint
    5. '    Public alAlias As PIAlias
    6. '    Public mod_Level As PISDK.PIModule

    Please tell me exactly how to reproduce your problem after I compile.

  7. #47

  8. #48
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Problem with executable file

    strStep is referenced in RefreshRecipeGrid but it isn't defined within the scope of that sub. It is defined in LoadRecipe. Did you mean it to be global or should I add a Dim for it in RefreshRecipeGrid? BTW, you have strStep defined as a string, but you use it as a counter. It should be a Long or an Integer (and iof course you should then call it lngStep or intStep).

  9. #49
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Problem with executable file

    I've just realized that your problem may be because you have code problems even though you were obviously able to compile your program. I compiled it too, once, but when I tried it again starting with a different sub open the compile failed. If you have invalid code in a compiled program I assume you can get weird results.

  10. #50
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Problem with executable file

    Stan,

    Each time you call GetBackUpCurrent() or GetBackUpNext() it will trigger cboAppovedDate() because you change the text of cboApprovedDate.

    VB Code:
    1. frmMain.cboApproved.text = frmBackUpCurr10.lblDateApprove.Caption
    2.  
    3. and
    4.  
    5.    frmMain.cboApproved.text = frmBackUpCurr10.lblDateApprove.Caption

    You will need to move the code to a sub and then call it when you need it. You will need to redo your routine and move it to a module for various forms call these routine and in turn run the code in the cboApprovedDate_Change() routine.

    Your problem is procedural.

  11. #51

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by MartinLiss
    OK, using your new files I can get it to run after doing the following and a few other things.

    VB Code:
    1. '    Public srvPI As PISDK.server
    2.     Public strMessage As String
    3.     Public con_lngError As Long
    4. '    Public p_ptPoint As PIPoint
    5. '    Public alAlias As PIAlias
    6. '    Public mod_Level As PISDK.PIModule

    Please tell me exactly how to reproduce your problem after I compile.
    Using the drop downbox, load one of the 2 grades. Then load the 2nd grade. Now toggle back and forth on the Current Grade and Next Grade buttons.

  12. #52

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by MartinLiss
    I'm sorry but ListIndex = 0 still isn't valid. What is it that you are trying to do with that statement?
    It's not necessary in the code. It should be rem'd out.

  13. #53

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by MartinLiss
    strStep is referenced in RefreshRecipeGrid but it isn't defined within the scope of that sub. It is defined in LoadRecipe. Did you mean it to be global or should I add a Dim for it in RefreshRecipeGrid? BTW, you have strStep defined as a string, but you use it as a counter. It should be a Long or an Integer (and iof course you should then call it lngStep or intStep).
    You are correct. It should be an integer. I've not defined Option Explicit so it is not reallyb necessary to define it. But if it were, it should be global (I have a module where I define the Public variables).

  14. #54
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Problem with executable file

    Stan,

    I guess you didn't like my comments ... I feel slighted

  15. #55

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by Stan
    I knew that each time the user clicked on the current or next grade buttons that the cboApproved was updated and it's Change event would be triggered, which would initiate the query. An option would be to put the query in a module and call it from the cmdCurrGrade and cmdNextGrade buttons. But what would I do if I want use the cboApproved to select a new date? If I tried calling the module from the cboApproved Change or Click event I run into the same problem as if I put the query within the event. Any thoughts/suggestions?
    We seem to have come full circle on this. Above is a quote from an earlier posting. Really appreciate you guys sticking with me for so long on this one. My coding skills are modest and I've picked up a lot of useful info unrelated to my problem in this thread. But the problem remains. How can I address the issue in the above quote? Is there a difference between _Change and _Click where they are invoked under different conditions?

    Cheers

  16. #56
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Problem with executable file

    Stan,

    Even if you selected a different date in the cboApprovedDate combo box, the Change event would not fire. So, having the routine in that sub would not amount to much, except trouble.

    Here is a program I put together for you to see what I mean. Put a break point on the DoEvents in the Change Event and select an item.
    Attached Files Attached Files

  17. #57

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by randem
    Stan,

    I guess you didn't like my comments ... I feel slighted
    Not sure what I did to offend you... but my apologies anyway

  18. #58
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Problem with executable file

    Stan,

    Well, Did you try the code? You probably have even seen my other post have you?

  19. #59

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Yes I did try it. I can see the difference between the _Click and _Change events. Will try to see how I can use this to get around my problem. BTW - didn't have time to respond to your emails (if that's what you miffed about). Will do so now.

  20. #60

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    Montreal, Quebec
    Posts
    400

    Re: Problem with executable file

    Quote Originally Posted by randem
    Stan,

    Well, Did you try the code? You probably have even seen my other post have you?
    Ah... I see why you're miffed with me. You probably didn't realize that my Post #55 was in response to your Post #50 (amazing... is this a record for number of postings). Sorry for any confusion. What you pointed out is the crux of my problem I believe.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width