140,149 questions
Best practices
0
votes
4
replies
60
views
Upgrading from .NET framework 4.8 VB.NET project to .NET 10
I have an application which was written years ago in VB.NET. Recently I migrated it to .NET framework 4.8. This change was smooth.
Now I am planning to migrate it to an ASP.NET Core 10 Web API using C#...
5
votes
1
answer
106
views
Word.Document Close ComException
We have some legacy code that late binds to Microsoft.Office.Interop.Word to do various things with documents.
This code has worked fine for years.
The Solution is written in VB.NET and consists of ...
1
vote
0
answers
43
views
Issue width from xlsx (closed xml) to pdf (itextsharp)
I’m having an issue with the text font. I’m trying to convert an Excel file to PDF using ClosedXML and iTextSharp, and I want the text to fit perfectly inside each cell. However, sometimes the text ...
3
votes
1
answer
94
views
Why does calling ToString give different results with a Double returned by CDbl and a Double returned by Double.Parse?
Demo code:
System.Console.WriteLine($"CDbl: {(CDbl("234.56"))} {(CDbl("234.56")).GetType} {(CDbl("234.56")).ToString("0.0")}")
...
0
votes
1
answer
129
views
Catia copy selected bodies from part to part in product level
I'm trying to copy bodies from selected parts to a target part, but there is a unique problem when copying and pasting bodies at product level. I also managed constraints with multiple axes, but ...
0
votes
0
answers
92
views
How can I check if a Windows service is running on a remote server in VB.net?
Colleagues, I have a client-server application. Within the server, I've created a Windows service that uses an ODBC connection via a DSN.
Sometimes when I check the server, I see that the Windows ...
2
votes
1
answer
136
views
System.EntryPointNotFoundException calling Visual C++ DLL from VB.NET
EDIT 5
I have erased the previous post, since the code has been fully changed (hoping no rules violation).
I removed all previous references to problematic String variables.
Now the question:
For ...
0
votes
1
answer
90
views
DS-K1T320MFWX – SDK connects but fails to retrieve access events or users (VB.NET)
I'm working with a Hikvision DS-K1T320MFWX terminal and trying to integrate it using the official SDK downloaded from Hikvision's website. I'm developing in VB.NET, and the connection works fine: I ...
0
votes
0
answers
58
views
Marshal.GetActiveObject Fails with error code 0x800401E3
I am attempting to connect to SolidWorks via this code:
Dim swApp As SolidWorks.Interop.sldworks.ISldWorks = _
TryCast(System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks....
0
votes
0
answers
27
views
SMTP Error: server does not support secure connection [duplicate]
Try
' Force TLS 1.2 (needed for .NET 4.0/4.5)
System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, Net.SecurityProtocolType)
' Create mail
Dim mail As New MailMessage()
...
0
votes
0
answers
85
views
Export Crystal Report to stream as PDF - Error when viewing in Chrome
I have a Crystal Report that I'm trying to export as a stream as a PDF. I'm able to view it in the Crystal Report Viewer in the browser, but when I open the PDF in a new tab in Chrome, I get an error ...
0
votes
1
answer
86
views
VB NET Microsoft.Office.Interop open XML file as XML table
I have a piece of code where I am opening an XML file from VB NET console app, than I Save As this file as XLSX file
Dim oxl As Excel.Application
Dim owbs As Excel.Workbooks
Dim owb As Excel.Workbook
...
0
votes
0
answers
73
views
I have a VB.net application that calls a Fortran DLL. It works fine. But when I recreate the DLL using VB.net, the execution speed becomes unusable
Background: I have developed and maintain a relatively large application using VB.net that does modeling, structural analysis, structural engineering, etc. One of the key steps during the analysis ...
0
votes
1
answer
102
views
.NET Framework 4.8-targeted application is working fine in a machine which only have .NET Framework 4.7.2
I have an exe which is written using .NET Framework 4.8.
I have the following line in the vbproj file of the exe.
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8&...
-3
votes
1
answer
104
views
How to Record Video Using directshow.dll and VB.NET
I am trying to create an app using Visual Studio 2022, VB.NET and directshow.dll to start webcam, display what is being captured, and record it to the *.avi file.
So far I can start the webcam and ...
0
votes
1
answer
63
views
Microsoft.Office.Core Reference Ambiguity
I'm having difficulties building a Word add-in for Release, due to some confusing errors caused by my references.
Simplifying it as much as I can, here's my troublesome code (which works in Debug mode)...
1
vote
2
answers
99
views
Sorting a list of objects. Is it possible to use a property as parameter?
This is a simple class (Person) with a shared list (Persons). My question concerns the possibility of improving the code in the method SortByPropertyName. It works as it is but, it would more handy if ...
1
vote
1
answer
219
views
SupportedRuntime options in app.config for C# project that support <targetFrameworks> with multiple values
I'm migrating legacy C# / VB.NET applications to newer frameworks.
I moved project files from legacy project files (non-SDK) into modern SDK style. Now I also added net452 and net481 as options to ...
0
votes
0
answers
108
views
Hope to cope with exceptions inside tasks
Here's my example code. It's of no use, but it's short.
I have an array to switch on or off the creation of Exceptions at different parts of my code and two functions. The first (Level 0) is an ...
0
votes
2
answers
70
views
ASP.NET WebForms dropdown causes page to clear on selection change
I am currently working on an old WebForms application in VB.NET. I am supposed to add a dropdown to an existing page that has been working with all controls so far. This dropdown appears in the ...
0
votes
2
answers
91
views
What is the difference between the two versions of OpenTextFileReader() in Visual Basic?
Visual Basic .Net has two versions of OpenTextFileReader(), as listed below:
Microsoft.VisualBasic.FileIO.FileSystem.OpenTextFileReader(String) As System.IO.StreamReader
Microsoft.VisualBasic....
1
vote
1
answer
117
views
How to pass a string as a pointer to byte array from a managed code to an unmanaged function
I need to use a Windows API function in my VB.NET application.
I need to pass an ASCII string of text to that function. This string is stored as a zero-terminated byte array.
What I currently do is I ...
2
votes
1
answer
62
views
Problem calling overloaded child class sub from abstract interactor, parent class interface implementation. Visual Basic
This might be a VB problem but I'm not sure with all the searching I've done.
Public Interface IAmmo
Sub Draw(g as Graphics)
End Interface
Public MustInherit Class Ammo
Inherits BaseObject
...
1
vote
0
answers
112
views
Using the MELSEC Communication Protocol, Correct way to Read Multiple Data Register for Mitsubishi FX5UC-32MT/DSS-TS PLC
I'm working with a Mitsubishi FX5UC-32MT/DSS-TS PLC and trying to read data from multiple D registers using the MC protocol, specifically the 0406 command (QnA-compatible 3E frame for multiple-block ...
2
votes
0
answers
133
views
Application developed in .NET 4.8 is working fine on a machine with only .NET 4.7 is installed. Is that expected?
I have a .NET application which is developed using .NET 4.5. Now this is migrated to .NET 4.8. It is a Windows application. I have a web service also targetting .NET 4.8.
When I deploy the web service ...