启动 exe 的行是:
Shell("""D:\glut\SB5\VisualStudio2008\Chapter06\TexturedTriangle\TexturedTriangle.exe"" """ & lat & " " & lng, vbNormalFocus)
并且纹理存在于函数参数中的同一路径。从 vb 代码的输出执行 exe 时,我只看到一个没有任何纹理的三角形
它还说
找不到 TexturedIdentity.vp 的着色器。当文件位于同一路径时
有什么问题?
Shell 命令将使用当前进程目录而不是目标 exe 目录启动应用程序。
要解决您的问题:尝试使用 System.Diagnostics.Process:
Dim exePath As String = "D:\parent\child\TexturedTriangle.exe"
Dim info As New ProcessStartInfo(exePath )
info.WorkingDirectory = IO.Path.GetDirectoryName(exePath)
info.Arguments = lat & " " & lng
Process.Start(info)