2 Replies - 378 Views - Last Post: 23 November 2017 - 02:54 PM Rate Topic: -----

#1 AmrAly  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 01-November 17

"Not Responding" appears when i take "Release folder"

Posted 23 November 2017 - 02:53 AM

Hi everybody,

I almost done, Now i have a completed windows application (I'm using VS 2015 MS Access 2013 on win 8.1), I believed that problems have gone away but this is not true. Any ways I have two problems. The first one is (My App. works well on my PC when i take "Release folder" to another place in my PC, but when i take "Release folder" to another PC every action on the application makes "Not Responding" . On the beginning i was confused but Task Manager clarified this situation it appeared that on every action on PC2 the CPU reaches to 47% then "Not Responding" then complete the action and some action reaches to 43% or 45% without "Not Responding" and on PC1 has a good relatively configuration CPU reaches to 51% without "Not Responding" and the time to perform the action is not completely reasonable but accepted)I noticed that this abnormal issue is due to the configuration of every PC (on my PC CPU reaches to 13.5% to perform the same action that takes 47% then "Not Responding" on the others). But is this an accepted solution "The configuration of every PC" i think that there is another solution...........

The second problem is (Pressing on the print button performs the printing action but enforce the application to exit by display a message

" 'App. name' Has Stopped Working..........Close The Program") This problem occurs on the PC1 and PC2 not on My PC.

My PC configuration(

OS: Windows 8.1 Enterprise 64-bit (6.3, Build 9600)

Processor: AMD A8-5500 APU with Radeon™ HD Graphics (4 CPUs), ~3.2GHz , Memory: 8GB RAM)


The PC1 configuration (Processor: AMD Athlon™ II X2 220 2.8 GHz , Memory : 4GB RAM) OS: Windows 7 SP1 32bit

The PC2 configuration (Processor: AMD E-300APU with Radeon™HD Graphics 1.30 GHz , Memory :3GB RAM) OS: Windows 8.1 Enterprise 64-bit

Thanks in advance and sorry for prolongation.

After searching on the web my second problem has solved, I found a method to make an (.msi package) for my application and this method succeeded and my second problem solved (The print button worked well)
But the problem now is my first problem still persists

Is This A Good Question/Topic? 0
  • +

Replies To: "Not Responding" appears when i take "Release folder"

#2 IronRazer  Icon User is offline

  • Custom Control Freak
  • member icon

Reputation: 1465
  • View blog
  • Posts: 3,715
  • Joined: 01-February 13

Re: "Not Responding" appears when i take "Release folder"

Posted 23 November 2017 - 08:12 AM

Yes i see you have been getting help with these problems HERE. However, there is not much we can do except guess why your application does this on other machines and not yours.

Since we have no idea what your code is doing or how you have it set up, my first few guesses would be that it is something in your Print Button code or something relating to the code in the Printing events that is causing it. It could also be that you are referencing something in your code that does not exist on the other computers in one of these events.

As i said though, we can only take wild guesses without seeing the related code and maybe even asking about other things after seeing that.

Also, did you try coping the Debug folder to the other computers to see if the exe in that folder does the same thing?
Was This Post Helpful? 0
  • +
  • -

#3 AmrAly  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 01-November 17

Re: "Not Responding" appears when i take "Release folder"

Posted 23 November 2017 - 02:54 PM

View PostIronRazer, on 23 November 2017 - 08:12 AM, said:

Also, did you try coping the Debug folder to the other computers to see if the exe in that folder does the same thing?

Thanks for paying attention,In the beginning i tried copying Debug folder and after build and change directory to Release folder i was copying the Release folder to the user PC and this is the reason to be here , when Mr Acamar stated that i must install my application by publishing it, My second problem of the print button has been solved, I found two methods to do this(first one is publishing the application and this method i failed to perform it in the right way it didn't succeed with me) and (the second one is creating MSI package and this method enables me to have an .msi file that can make my application setup on the user PC)
Now could we find a solution to my problem step by step ? Oh i forget an important thing, By the way my code is not a secret and this is some snippets that i suspicion is causing the problem
 
Option Strict On
Option Explicit On
'Option Infer Off
Imports System.Data.OleDb
Imports System.IO
Imports DAO
Imports System.DateTime
Imports System.Xml
Imports System.Management
Imports System.Windows.Forms
Imports System.Threading
Imports ApplicationEnhancement.Expiry

Public Class frm1

    Inherits System.Windows.Forms.Form

    Dim conn As New OleDbConnection("provider=microsoft.ace.oledb.12.0; data source=Dr_T.accdb;jet oledb:database password=my password")
    Dim cmd As OleDbCommand

    Dim f2 As frm2

Public Sub New()
        'MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()
        'Add any initialization after the InitializeComponent() call

        DTPickerNow()
        ''after option strict on
        DTPicker.Value = Now
        LoadPicture()
        ClearData()
        ClearGyn()
        lblSearch.Text = CType(dgvPatients.Rows.Count(), String)

    End Sub
'''''
Sub DTPickerNow()
        For Each x As Control In Panel1.Controls
            If TypeOf x Is DateTimePicker Then
                x.Text = CType(Now, String)
            End If
        Next
    End Sub
'''''''
Sub ClearData()
        ''## 'For loop' for erasing text box type in the form
        'For Each C As Control In Me.Controls
        '    If TypeOf C Is TextBox Then
        '        C.Text = ""
        '    End If
        'Next

        cbxPatName.Text = "" : cbxAddress.Text = "" : cbxHusband.Text = ""
        txtAge.Text = "" : txtPhone.Text = "" : cbxSearch.Text = ""
        cbxPatName.ResetText() : cbxAddress.ResetText() : cbxHusband.ResetText()
        cbxSearch.ResetText()
        ''##This line must come after the 'for loop' because for loop erase every textbox in the form
        ''##And the autonumber come after that
        txtNo.Text = GetAutonumber("Pat", "Patient_no")

        txtNo.Select()
        DTPickerEDD.Text = CType(Now, String)
        DTPickerNow()
        DTPicker.Text = CType(Now, String)
        cbxPatName.Text = "" : cbxAddress.Text = "" : txtAge.Text = ""
        txtPhone.Text = "" : cbxHusband.Text = ""

    End Sub

    Sub ClearGyn()
        For Each i As Control In Panel1.Controls
            If TypeOf i Is TextBox Then
                i.Text = String.Empty
            End If
        Next
        For Each combo As Control In Panel1.Controls
            If TypeOf combo Is ComboBox Then
                combo.Text = String.Empty
            End If
        Next
        DTPickerMns.Value = Now
        DTPickerLMP.Value = Now
        DTPickerEDD.Value = Now
        DTPickerAtt.Value = Now
        txtVis.Text = GetAutonumber("Gyn2", "Vis_no")
        txtVis1.Text = GetAutonumber("Gyn", "Vis_no")

    End Sub
''''''''
''##This code for load picture to the form
    Sub LoadPicture()
        Dim filename As String = System.IO.Path.GetFileName("\DrAhEssmat.png")
        Me.PictureBox1.Image = Image.FromFile(filename)
    End Sub
'''''
''##Very Useful code for make expiration date 
    Public Function DateGood(NumDays As Integer) As Boolean
        'The purpose of this module is to allow you to place a time
        'limit on the unregistered use of your shareware application.
        'This module can not be defeated by rolling back the system clock.
        'Simply call the DateGood function when your application is first
        'loading, passing it the number of days it can be used without
        'registering.
        'Ex: If DateGood(30)=False Then
        ' Cripple Application
        ' End if
        'Register Parameters:
        ' CRD: Current Run Date
        ' LRD: Last Run Date
        ' FRD: First Run Date
        Dim TmpCRD As Date
        Dim TmpLRD As Date
        Dim TmpFRD As Date
        'Dim dtfi As DateTimeFormatInfo
        'Dim styles As DateTimeStyles
        TmpCRD = CDate(Format(Now, ("dd/MM/yyyy").ToString))
        TmpLRD = CDate(GetSetting(Application.ExecutablePath, "Param", "LRD", "11/9/2017"))
        TmpFRD = CDate(GetSetting(Application.ExecutablePath, "Param", "FRD", "1/9/2017"))
        DateGood = False
        'If this is the applications first load, write initial settings
        'to the register
        If TmpLRD = CDate("11/9/2017") Then
            SaveSetting(Application.ExecutablePath, "Param", "LRD", CType(CDate(TmpCRD), String))
            SaveSetting(Application.ExecutablePath, "Param", "FRD", CType(TmpCRD, String))
        End If
        'Read LRD and FRD from register
        TmpLRD = CDate(GetSetting(Application.ExecutablePath, "Param", "LRD", "11/9/2017"))
        TmpFRD = CDate(GetSetting(Application.ExecutablePath, "Param", "FRD", "1/9/2017"))
        If TmpFRD > TmpCRD Then 'System clock rolled back
            DateGood = False
        ElseIf Now > DateAdd(("d").ToString, NumDays, CDate(TmpFRD)) Then 'Expiration expired
            DateGood = False
        ElseIf TmpCRD > TmpLRD Then 'Everything OK write New LRD date
            SaveSetting(Application.ExecutablePath, "Param", "LRD", CType(TmpCRD, String))
            DateGood = True
        ElseIf TmpCRD = CDate(Format(TmpLRD, ("dd/MM/yyyy").ToString)) Then
            DateGood = True
        Else
            DateGood = False
        End If
    End Function
    
    ''##When you put this function in the save button click you will notice the difference
    ''##Till now it is useful ( Null value solution )
    Public Function CheckNull(ByVal fieldValue As String) As String
        If fieldValue.Equals(DBNull.Value) Then Return "" Else
        If fieldValue = "N/A" Then
            Return "value for N/A"
        Else
            Return ""
        End If
    End Function


    Private Sub frm1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        'Me.Location = New Point(0, 0)
        'Me.Size = Screen.PrimaryScreen.WorkingArea.Size
        ReleaseMemory()

        ShowPatTable()
        ShowGynTable()
        ShowGyn2PatTable()

        RDXmlPatNames()
        RDXmlPatNames1()
        RDXmlPatNames2()
        RDXmlDrugs()
        RDXmlDiaInter()
        RDXmlInv()
        DGVArrange()
    End Sub
'''''''''''''''
    Sub FillPat()
        Dim con As New OleDbConnection("provider=microsoft.ace.oledb.12.0; data source=Dr_T.accdb;jet oledb:database password=**********")
        con.Open()
        Dim da As New OleDbDataAdapter("SELECT * FROM Pat ORDER BY Patient_no", con)

        Dim ds As New DataSet
        da.Fill(ds, "Pat")
        con.Close()
        'dgvVisit.DataSource = ds.Tables("Visits")
        With dgvPatients
            .DataSource = ds
            .DataMember = "Pat"
        End With

        ds = Nothing
        da.Dispose()
        con = Nothing
    End Sub
'''''''''''
Sub ShowPatTable()
        Using con As New OleDbConnection("provider=microsoft.ace.oledb.12.0; data source=Dr_T.accdb;jet oledb:database password=mero1981923")
            con.Open()

            Using cmd As New OleDbCommand
                cmd.Connection = con                               ''##

                cmd.CommandText = "SELECT * FROM Pat WHERE [email protected]_no"
                cmd.Parameters.Add("@Patient_no", OleDbType.Integer).Value = CInt(Val(txtNo.Text))
                Using dt As New DataTable
                    dt.Load(cmd.ExecuteReader)
                    If dt.Rows.Count > 0 Then
                        txtNo.Text = dt.Rows(0).Item("Patient_no").ToString
                        'txtName.Text = dt.Rows(0).Item("Name")
                        cbxPatName.Text = dt.Rows(0).Item("Name").ToString
                        cbxAddress.Text = dt.Rows(0).Item("Address").ToString
                        DTPicker.Text = dt.Rows(0).Item("Birthdate").ToString
                        txtAge.Text = dt.Rows(0).Item("Age").ToString
                        txtPhone.Text = dt.Rows(0).Item("Phone").ToString
                        cbxHusband.Text = dt.Rows(0).Item("HusName").ToString
                    End If
                End Using
            End Using
        End Using
    End Sub
''''''''''''
    Private Sub DGVArrange()
        With dgvPatients
            .RowHeadersVisible = False
            .Columns(0).HeaderCell.Value = "ID"
            .Columns(1).HeaderText = "Name"
            .Columns(2).Visible = False
            .Columns(3).Visible = False
            .Columns(4).Visible = False
            .Columns(5).Visible = False
            .Columns(6).Visible = False
        End With
        'dgvPatients.Sort(dgvPatients.Columns(0), System.ComponentModel.ListSortDirection.Ascending)

        With dgvGyn
            .RowHeadersVisible = False
            .Columns(0).HeaderCell.Value = "ID"
            .Columns(1).HeaderCell.Value = "No"
            .Columns(2).Visible = False
            .Columns(3).Visible = False
            .Columns(4).Visible = False
            .Columns(5).Visible = False
            .Columns(6).Visible = False
            .Columns(7).Visible = False
            .Columns(8).Visible = False
            .Columns(9).Visible = False
            .Columns(10).Visible = False
            .Columns(11).Visible = False
            .Columns(12).Visible = False
            .Columns(13).Visible = False
            .Columns(14).Visible = False
            .Columns(15).Visible = False
            .Columns(16).Visible = False
            .Columns(17).Visible = False
            .Columns(18).Visible = False
            .Columns(19).Visible = False
            .Columns(20).Visible = False
            .Columns(21).Visible = False
            .Columns(22).Visible = False
            .Columns(23).Visible = False
            .Columns(24).Visible = False
        End With
  
        With dgvGyn2
            .RowHeadersVisible = False
            .Columns(0).HeaderText = "No"
            .Columns(1).HeaderText = "ID"
            .Columns(2).Visible = False
            .Columns(3).Visible = False
            .Columns(4).Visible = False
            .Columns(5).Visible = False
            .Columns(6).Visible = False
            .Columns(7).Visible = False
            .Columns(8).Visible = False
            .Columns(9).Visible = False
            .Columns(10).Visible = False
            .Columns(11).Visible = False
            .Columns(12).Visible = False
            .Columns(13).Visible = False
            .Columns(14).Visible = False
            .Columns(15).Visible = False
        End With
        'dgvGyn2.Sort(dgvGyn2.Columns(0), System.ComponentModel.ListSortDirection.Ascending)

    End Sub
''''''''
    Private Declare Function SetProcessWorkingSetSize Lib "kernel32.dll" (ByVal hProcess As IntPtr, ByVal dwMinimumWorkingSetSize As Int32, ByVal dwMaximumWorkingSetSize As Int32) As Int32
    Friend Sub ReleaseMemory()
        Try
            GC.Collect()
            GC.WaitForPendingFinalizers()
            If Environment.OSVersion.Platform = PlatformID.Win32NT Then
                SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1)
            End If
        Catch ex As Exception
            MsgBox(ex.ToString())
        End Try
    End Sub
''''''''''''''''''''''
    Private Sub frm1_BindingContextChanged(sender As Object, e As EventArgs) Handles MyBase.BindingContextChanged

        FillPat()
        FillGyn()
        FillGyn2()

        DGVArrange()
    End Sub
''''''''''''''
    Private WithEvents usage As ApplicationUsage
    Private _maxTimes As Integer = 10
    Private _usageLimitExceeded As Boolean = False

    Private Sub frm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        '##To fit any screen resolution
        Me.Location = New Point(0, 0)
        Me.Size = Screen.PrimaryScreen.WorkingArea.Size

        Me.AutoScroll = True
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        ' Initialize the variable "usage" by using
        ' the NEW keyword along with the number
        ' of maximum "hits" you want to allow:
        usage = New ApplicationUsage(_maxTimes)

        ' Now check the usage. If the usage has been
        ' exceeded, the "MaximumExceeded" event will
        ' be raised:
        usage.CheckUsage()

        If _usageLimitExceeded Then
            MessageBox.Show(String.Format("The maximum usage of {0:n0} " & vbCrLf &
                                          "times has been exceeded." & vbCrLf &
                                          "Call 01067174141 for full version",
                                          _maxTimes), "Cannot Continue")
            Close()
        Else
            ' Just for demonstration here, if the
            ' maximum has not been exceeded then
            ' I'll just show the quantity of times
            ' this program has been run.

            MessageBox.Show(String.Format("Usage Quantity: {0:n0} Of " &
                                          _maxTimes, usage.UsageQuantity))
        End If
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        lblcurTime.Text = CType(Now.ToShortDateString, String)
        DateTimePicker1.Value = Now
        txtNo.Select()

        Fill_Auto()
        LoadPicture()
        DTPickerEDD.Text = CType(Now, String)
        lblSearch.Text = CType(dgvPatients.Rows.Count(), String)

        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''       
        ''##Code for KMA clinic application must be for one machine 
        'Dim SysFile As String = "C:\Drivers\Video\AMD1\CCC\localdata.ini"
        'If Not File.Exists(SysFile) Then
        '    'MsgBox("Welcome To KMAClinic, We are happy that you are trusted our product", MsgBoxStyle.Information)
        '    MsgBox("Please Call 0000000000", MsgBoxStyle.Exclamation, "Unregistered")
        '    End
        'End If
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        '##Set timer And test
        '##This code for Expiration date it is very useful
        If Not DateGood(5) Then  ''30 or any number for the expiration date
            MsgBox("Trial Period Expired!" & vbCrLf &
                  "Call 00000000", vbExclamation,
                  "Unregistered application")
            Close()
            End
        End If

    End Sub
''''''''''''
    Private Sub frm1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        If e.CloseReason = CloseReason.UserClosing Then
            usage.Save()
        End If
    End Sub

    Private Sub _
        usage_MaximumExceeded(sender As Object,
                              e As System.EventArgs) _
                              Handles usage.MaximumExceeded

        _usageLimitExceeded = True

    End Sub
''''''''''''''''
    Sub Fill_Auto()
        txtNo.Text = GetAutonumber("Pat", "Patient_no")
        txtVis.Text = GetAutonumber("Gyn2", "Vis_no")
        txtVis1.Text = GetAutonumber("Gyn", "Vis_no")
        txtNo.Select()
    End Sub



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1