|
-
Oct 25th, 2025, 02:06 PM
#7
Thread Starter
Junior Member
Re: Including c# program as a reference in a VB.NET app
And now really stumped ,. . Another MS suggestion was to recreate the project from scratch in VS2022 - so I created the Create Memory file app and copied the form and code - no errors until debug, the 2 error on file locked and no form display.
The I created a completely new app with 1 start button and 1 text box - now the form displays, but no display in the text box. Here is the code
Imports System.IO.MemoryMappedFiles
Imports System.Threading
Public Class Form1
Public WithEvents MEMSTimer As New System.Windows.Forms.Timer()
Dim LoopForever As Boolean = True
Dim GPSINS_Memory_File_Name As String = "GPSINSMemoryData"
Dim AHRS_Memory_File_Name As String = "AHRSMemoryData"
Dim Switch_Memory_File_Name As String = "SwitchMemoryData"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim MMS = MemoryMappedFile.CreateNew(Switch_Memory_File_Name, 20, MemoryMappedFileAccess.ReadWrite)
Dim GPS = MemoryMappedFile.CreateNew(GPSINS_Memory_File_Name, 400, MemoryMappedFileAccess.ReadWrite)
Dim AHRS = MemoryMappedFile.CreateNew(AHRS_Memory_File_Name, 400, MemoryMappedFileAccess.ReadWrite)
Do Until LoopForever = False
'sleep for xx.0 Seconds
Call DisplayStatus
Thread.Sleep(100)
'Button1.BackColor = Color.GreenYellow
'Thread.Sleep(100)
Loop
End Sub
Private Sub DisplayStatus()
TextBox1.Clear()
TextBox1.Text = "Running"
TextBox1.BackColor = Color.Green
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|