過去データをダウンロード(初期セットアップ)でJVLinkエラーメッセージがでました。

お疲れ様です。

過去データをダウンロード(初期セットアップ)でJVLinkエラーメッセージがでました。
JVLinkエラーメッセージ = ハンドルされていない例外

詳細のコピー
System.Runtime.InteropServices.SEHException
HResult=0x80004005
Message=外部コンポーネントが例外をスローしました。
Source=<例外のソースを評価できません>
スタック トレース:
<例外のスタック トレースを評価できません>

クイックウオッチ
$exception??{“外部コンポーネントが例外をスローしました。”}???System.Runtime.InteropServices.SEHException
Data??{System.Collections.ListDictionaryInternal}???System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
ErrorCode???-2147467259?Integer
HResult???-2147467259?Integer
HelpLink???Nothing???String
InnerException???Nothing???System.Exception
Message???“外部コンポーネントが例外をスローしました。”?String
Source???“Interop.JVDTLabLib”???String

名前
値
種類

StackTrace
" at JVDTLabLib.JVLinkClass.JVGets(Object& buff, Int32 size, String& filename)" & vbCrLf & " at データベース.Form1.RaceGet(String strDataSpec, String strFromTime, Int64 lOption) in E:\JRA-VAN\VisualBasic2026\データベース\データベース\Form1.vb:line 406" & vbCrLf & " at データベース.Form1.Button1_Click(Object sender, EventArgs e) in E:\JRA-VAN\VisualBasic2026\データベース\データベース\Form1.vb:line 90" & vbCrLf & " at System.Windows.Forms.Control.OnClick(EventArgs e)" & vbCrLf & " at System.Windows.Forms.Button.OnClick(EventArgs e)" & vbCrLf & " at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)" & vbCrLf & " at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)" & vbCrLf & " at System.Windows.Forms.Control.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.ButtonBase.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.Button.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)" & vbCrLf & " at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)" & vbCrLf & " at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)" & vbCrLf & " at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)" & vbCrLf & " at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)" & vbCrLf & " at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)" & vbCrLf & " at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()" & vbCrLf & " at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)" & vbCrLf & " at データベース.My.MyApplication.Main(String[] Args) in :line 83"
String

TargetSite??{Int32 JVGets(System.Object ByRef, Int32, System.String ByRef)}???System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

コードは以下です

    ' JVLink オブジェクト生成

    Dim lReturnCode As Long
    Dim lReturnReadCode As Integer
    Dim strBuff As String = vbEmpty            ''JVRead:データ格納バッファ
    'Dim strFileName As String = vbEmpty        ''JVRead:ダウンロードファイル名


    ' 初期化
    Dim lReadCount As Long              ' JVLink 戻り値
    Dim lDownloadCount As Long          ' JVOpen:総ダウンロードファイル数
    Dim strLastFileTimestamp As String = String.Empty ' JVOpen: 最新ファイルのタイムスタンプ

    '引数設定
    'JVLink 初期化
    lReturnCode = clsJVLink.JVInit("UNKNOWN")
    'エラー判定
    If lReturnCode <> 0 Then
        MessageBox.Show(
                    "JVInit エラー コード:" & lReturnCode & ":",
                    "エラー",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    )
        Me.Cursor = System.Windows.Forms.Cursors.Default
        Exit Sub
    End If

    '\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
    'JVLinkダウンロード処理
    '\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
    lReturnCode = clsJVLink.JVOpen("RACE",
                                         "19930707000000",
                                         3,
                                         lReadCount,
                                         lDownloadCount,
                                         strLastFileTimestamp)

    If lReturnCode <> 0 Then
        Throw New Exception("JVOpen 失敗: " & lReturnCode)
        MsgBox("JVOpen エラー:" & lReturnCode)
        Exit Sub
    End If
    Console.WriteLine("JVOpen OK 読込件数=" & lReadCount & " DL件数=" & lDownloadCount)

Dim Buff As String ''バッファ
Dim BuffSize As Integer ''バッファサイズ
Dim BuffName As String ''バッファ名
Dim strData As String ''読込みファイル数
Dim ReturnCode As Integer ''JVLink戻値
Dim bytData(0) As Byte ''JVGets用バッファポインタ

'バッファ領域確保
BuffSize = 110000
Buff = New String(vbNullChar, BuffSize)
BuffName = String.Empty
strData = New String(vbNullChar, BuffSize)

'エラー判定
If lReadCount >= 0 Then
Do
'バックグラウンドでの処理
System.Windows.Forms.Application.DoEvents()
Try

        ReturnCode = clsJVLink.JVGets(bytData, BuffSize, BuffName) ここでエラーメッセージがでる、= ハンドルされていない例外

ReturnCode = 28955???
bytData = {Length=28956}
BuffSize = 110000
BuffName = “H1VM2007079920230808163921.jvd”

???If ReturnCode >= 0 Then
If bytData IsNot Nothing AndAlso bytData.Length > 0 Then
strData = Encoding.GetEncoding(932).GetString(bytData)
Else
ReturnCode = -1
End If
End If
Catch ex As COMException
Debug.WriteLine($“HRESULT: {ex.HResult:X}, Message: {ex.Message}”)
End Try

コードはJRA-VANのBasic2019から引用させていただきました。
只、苦言を申し上げますとJVData_Structure.vbのデーター構造体にミスのコードが散見されます。
今回もJRA-VANのBasic2019から引用させていただきました、コードにミスがあるのか、私のコードミスなのか、なぜハンドルされていない例外が出るのか、ご教授お願い致します。

2019はサポート終了いたしました。2026を提供しております。よろしくお願いいたします。競馬ソフト開発体験教室