Click here to Skip to main content
15,891,976 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Adding Problem Pin
svanwass5-Nov-07 7:39
svanwass5-Nov-07 7:39 
AnswerRe: Adding Problem Pin
Cedrickdeorange5-Nov-07 8:52
Cedrickdeorange5-Nov-07 8:52 
GeneralRe: Adding Problem Pin
leckey5-Nov-07 9:59
leckey5-Nov-07 9:59 
QuestionUsing VB in Excel Pin
nick45-Nov-07 5:09
nick45-Nov-07 5:09 
Questionmysql and vb.net connection error Pin
tj285-Nov-07 4:57
tj285-Nov-07 4:57 
AnswerRe: mysql and vb.net connection error Pin
DigiOz Multimedia5-Nov-07 5:20
DigiOz Multimedia5-Nov-07 5:20 
AnswerRe: mysql and vb.net connection error Pin
tj285-Nov-07 17:29
tj285-Nov-07 17:29 
QuestionApplication Exits at the beginning. Please Help [modified] Pin
s3rro5-Nov-07 3:55
s3rro5-Nov-07 3:55 
Hi,
I have the following code, and my application falls into the if statement and exits but i cant find why. Can anyone tell me the solution.
--------------
Private Sub TimerInitialize_Timer()


'On the simulator, use the TmpMdb data base, that contains the new elemets.
'On the server pass "" to use the default data base (MDB).

TimerInitialize.Enabled = False
If InitSystem() <> True Then
'Can't start
Application.Exit()
End If

'#If afServiceEnabled Then
' NTServiceCtrl.StopService
'#End If

End Sub

--------------

the InitSystem code is the following.

---------------------------------------


Public Function InitSystem() As Boolean
'-------------------------------------------------------------------
' Initialize and start the system. Called from the main Load_Form.
' Inputs: none ' Outputs: none
'-------------------------------------------------------------------
Dim DnList As Collection
Dim MyDn 'must be variant to enumerate collection items
Dim ch As Long
'The following causes: [32021] TAPI properties not supported in this build:
'Dim myLineApp As Long 'myLineApp = LineGroup1.AppHandle(1)

'Open data base
myDataAccess = New DatabaseAccess(Application.StartupPath)


'Setup path to the MediaPath repository location
SysOptions.sMsgRepositoryPath = Environ(CTIDIR_TOKEN)
If SysOptions.sMsgRepositoryPath = "" Then
'No set in the environment, use default
SysOptions.sMsgRepositoryPath = CTIDIR_DEFAULT
End If

' Set the voice directory path
MainFrame.VoiceDirectory = SysOptions.sMsgRepositoryPath & VAP_FILE_DIR

' Start the engine
MainFrame.StartSystem(False)

'On Error GoTo Err_InitSystem
DnList = GetDnListToMonitor(APP_NAME)
BugMessage("Number of entries: " & CStr(DnList.Count))

If DnList.Count > 0 Then
'Found some valid channels
iMaxChannel = 0
iMinChannel = 1000
For Each MyDn In DnList
ch = DirectoryNumToTapiDeviceID(0, MyDn)
If ch = -1 Then
BugMessage("Unknown TAPI device name: " & MyDn)
Else
'Channels can be added dynamically but only after StartSystem.
'Also, you must add 1 to the raw TAPI device ID for AddChannel.
ch = ch + 1 'Must add one
MainLineGroup.AddChannel(ch)
If ch > iMaxChannel Then
iMaxChannel = ch
End If
If ch < iMinChannel Then
iMinChannel = ch
End If
BugMessage("Added ch:" & ch & " for " & MyDn)
End If
Next MyDn

'Allocate per channel data for all channels
ReDim CallData(0 To iMaxChannel + 1)
Else
'No chanels to monitor, it's not gonna work...
BugMessage("InitSystem: No channels to monitor")
InitSystem = False
Exit Function
End If

' Initialize global System Options from MediaPath data base
mdbGetSysOptions(SysOptions)
InitSystem = True
Exit Function

Err_InitSystem:
If Err.Number = 32302 Then 'System already running
BugMessage("InitSystem: system already started")
Err.Clear()
Resume Next
End If
BugMessage("InitSystem: [" & Err.Number & "] " & Err.Description)
Err.Clear()
InitSystem = False
End Function




-- modified at 10:13 Monday 5th November, 2007
AnswerRe: Application Exits at the beginning. Please Help Pin
Kschuler5-Nov-07 7:40
Kschuler5-Nov-07 7:40 
GeneralRe: Application Exits at the beginning. Please Help Pin
s3rro5-Nov-07 8:15
s3rro5-Nov-07 8:15 
GeneralRe: Application Exits at the beginning. Please Help Pin
Kschuler5-Nov-07 8:18
Kschuler5-Nov-07 8:18 
QuestionFrom Windows application to web- application Pin
PaulMiedema5-Nov-07 2:11
PaulMiedema5-Nov-07 2:11 
AnswerRe: From Windows application to web- application Pin
DigiOz Multimedia5-Nov-07 5:29
DigiOz Multimedia5-Nov-07 5:29 
GeneralRe: From Windows application to web- application Pin
PaulMiedema6-Nov-07 0:00
PaulMiedema6-Nov-07 0:00 
GeneralRe: From Windows application to web- application Pin
ChandraRam6-Nov-07 1:06
ChandraRam6-Nov-07 1:06 
GeneralRe: From Windows application to web- application Pin
PaulMiedema7-Nov-07 1:47
PaulMiedema7-Nov-07 1:47 
GeneralRe: From Windows application to web- application Pin
DigiOz Multimedia6-Nov-07 3:51
DigiOz Multimedia6-Nov-07 3:51 
GeneralRe: From Windows application to web- application Pin
PaulMiedema7-Nov-07 1:41
PaulMiedema7-Nov-07 1:41 
QuestionFilePutObject assistance, please Pin
IceWater425-Nov-07 1:47
IceWater425-Nov-07 1:47 
AnswerRe: FilePutObject assistance, please Pin
AliAmjad5-Nov-07 2:21
AliAmjad5-Nov-07 2:21 
QuestionInitialize a date picker Pin
nishkarsh_k5-Nov-07 0:25
nishkarsh_k5-Nov-07 0:25 
AnswerRe: Initialize a date picker Pin
AliAmjad5-Nov-07 2:31
AliAmjad5-Nov-07 2:31 
AnswerRe: Initialize a date picker Pin
Muhammad Shahid Farooq5-Nov-07 2:32
professionalMuhammad Shahid Farooq5-Nov-07 2:32 
Questioncan I connect my ASP.net project written in VB.Net to an excel or SPSS Pin
Knowledgestudent5-Nov-07 0:05
Knowledgestudent5-Nov-07 0:05 
QuestionData Grid View Behaviour ? Pin
NasirLCCI20074-Nov-07 23:53
NasirLCCI20074-Nov-07 23:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.