Author Topic: V 396 error when adding purchased controls  (Read 2801 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
V 396 error when adding purchased controls
« on: January 05, 2015, 09:42:06 PM »
after adding purchaced controls and when I build advHMI i get this error , not sure what it means . red text is the 1st error line



Error   1   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterH.vb   293   33   AdvancedHMIControls
Error   2   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterH.vb   298   25   AdvancedHMIControls
Error   3   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterH.vb   309   25   AdvancedHMIControls
Error   4   'Format' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterHoriz.vb   29   35   AdvancedHMIControls
Error   5   'InStr' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterHoriz.vb   35   20   AdvancedHMIControls
Error   6   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterV.vb   294   33   AdvancedHMIControls
Error   7   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterV.vb   299   25   AdvancedHMIControls
Error   8   'MsgBox' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterV.vb   310   25   AdvancedHMIControls
Error   9   'Format' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterVert.vb   29   35   AdvancedHMIControls
Error   10   'InStr' is not declared. It may be inaccessible due to its protection level.   C:\! ! Advance HMI\HMI-V396-Building\AdvancedHMIControls\PurchasedControls\LinearMeterVert.vb   35   20   AdvancedHMIControls


 Private Sub KeypadPopUp_ButtonClick(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Controls.KeyPadEventArgs)
        If e.Key = "Quit" Then
            KeypadPopUp.Visible = False
        ElseIf e.Key = "Enter" Then
            If m_CommComponent Is Nothing Then
                DisplayError("CommComponent Property not set")
            Else
                If KeypadPopUp.Value <> "" Then
                    Try
                        If m_KeypadMaxValue <> m_KeypadMinValue Then
                            If KeypadPopUp.Value < m_KeypadMinValue Or KeypadPopUp.Value > m_KeypadMaxValue Then
                                MsgBox("Value must be >" & m_KeypadMinValue & " and <" & m_KeypadMaxValue)
                                Exit Sub
                            End If
                        End If
                    Catch ex As Exception
                        MsgBox("Failed to validate value. " & ex.Message)
                        Exit Sub
                    End Try
« Last Edit: January 05, 2015, 10:15:47 PM by Darrell »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: V 396 error when adding purchased controls
« Reply #1 on: January 06, 2015, 06:41:14 AM »
I was doing some porting to Mac iOS and Linux, so I removed some references and forgot to put them back.

- Right click the AdvancedHMIControls project in Solution Explorer and select Properties
- Go to the References atb
- At the bottom you will see Imported Namespaces
- Scroll down the list to find Microsoft.VisualBasic and check that box

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: V 396 error when adding purchased controls
« Reply #2 on: January 06, 2015, 06:55:52 AM »
Thanks , very much appreciated
Darrell

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: V 396 error when adding purchased controls
« Reply #3 on: January 06, 2015, 09:17:26 PM »
getting the same message , just the LinearMeter controls that it wont take

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: V 396 error when adding purchased controls
« Reply #4 on: January 06, 2015, 09:25:55 PM »
Replace each MsgBox with this and let me know if that helps :

System.Windows.Forms.MessageBox.Show

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: V 396 error when adding purchased controls
« Reply #5 on: January 06, 2015, 10:21:31 PM »
crashes the program , Ill just wait till it sorted out later

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
V 396 error when adding purchased controls
« Reply #6 on: January 07, 2015, 12:26:18 AM »
Darrell,

I had the same problem as you and I added the "Microsoft.VisualBasic" Namespace as Archie noted and this did not help.
What I found was that if I added "Microsoft.VisualBasic.Strings." in front of the three function errors this fixed my problem.
I have attached a picture showing the details for the "LinearMeterVert.vb" and the "LinearMeterHoriz.vb".
I hope that this helps you with your problem.

Doug Lyons

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
V 396 error when adding purchased controls
« Reply #7 on: January 07, 2015, 06:04:43 AM »
Darrell/Archie,

I found another way to make this work and that is by adding "Imports Microsoft.VisualBasic" as shown below.
I have no idea why this would be necessary but it may help point to the problem.

Doug Lyons

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
V 396 error when adding purchased controls
« Reply #8 on: January 07, 2015, 06:16:31 AM »
Archie,

I think that I may have found the actual problem.
It appears that you must select the "AdvancedHMIControls" section of the Project.
The go to the Properties and References and check the Microsoft.VisualBasic there.
I have included screen captures of what seems to work with the least amount of effort.
These are shown as they were found and need to be checked to work correctly.
Surely enough when I checked in my Version 3.95 project this item was selected.
This single change seems to fix all that happened to me that was similar to Darrell's problems.

Doug Lyons
« Last Edit: January 07, 2015, 06:21:47 AM by DougLyons »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: V 396 error when adding purchased controls
« Reply #9 on: January 07, 2015, 06:10:57 PM »
I added these references back in for version 3.97