How do i use COM connection point in VB.net?
I got one COM component ,and i need make the connetion point call back work .But i d't know the code . do's only one can give me some sample code or tell me how to make it work.Thanks.
do you know?
how many words do you know
See also questions close to this topic
Iterating over files in folder and subfolders in VB.NET
I've been trying for a while to get my app to iterate over all files in the specified directory and subdirectories It usually does just one then stops, does a few then stops or doesn't do any at all Here's the code that should be handling that
Dim result As New List(Of String) Dim stack As New Stack(Of String) stack.Push(inputDir) Do While (stack.Count > 0) Dim dir2 As String = stack.Pop Try result.AddRange(Directory.GetFiles(dir2, "*.*")) Dim directoryName As String For Each directoryName In Directory.GetDirectories(dir2) stack.Push(directoryName) Try Dim fileName As String For Each fileName In Directory.GetFiles(directoryName) stack.Push(fileName) ListBox2.Items.Add(fileName) If fileName.EndsWith(".bik") Then ListBox1.Items.Add("FILE " + fileName + " WILL NOT BE ADDED SINCE IT IS A BINK FILE") ElseIf fileName.EndsWith(".scd") Then ListBox1.Items.Add("FILE " + fileName + " WILL NOT BE ADDED SINCE IT IS A SCD FILE") ElseIf fileName.EndsWith(".ico") Then ListBox1.Items.Add("FILE " + fileName + " WILL NOT BE ADDED SINCE IT IS AN ICON FILE") Else iterateFiles2(fileName, Path.GetFileName(fileName)) End If Threading.Thread.Sleep(100) Next Catch ex As Exception End Try Next Catch ex As Exception End Try Loop
Example of what it does: https://i.stack.imgur.com/KBdGT.png (it'll only go over one of the 10 or so files)
Any answers are much appreciated.
Get a value by index from combobox class
i'm approaching to vbnet from vb6 and i'm triyng to get value from combobox using a class which contains the values i stored in. here is the class
Private m_ItemText As String Private m_ItemIndex As Int32 Public Sub New(ByVal strItemText As String, ByVal intItemIndex As Int32) m_ItemText = strItemText m_ItemIndex = intItemIndex End Sub Public ReadOnly Property ItemIndex() As Int32 Get Return m_ItemIndex End Get End Property Public ReadOnly Property ItemText() As String Get Return m_ItemText End Get End Property
I use this method charge the combobox
ComboBox2.Items.Add(New clsComboBoxItem("sometext", 1)) ComboBox2.Items.Add(New clsComboBoxItem("sometext 2", 2)) ComboBox2.Items.Add(New clsComboBoxItem("sometext", 3))
and this on combobox.selectedindexchanged
If ComboBox2.SelectedItem.GetType.ToString = itmCombo.GetType.ToString Then itmCombo = CType(ComboBox2.SelectedItem, clsComboBoxItem) MessageBox.Show("Item Text=" & itmCombo.ItemText & " and ItemIndex=" & CStr(itmCombo.ItemIndex)) End If
Can anyone tell help me to understand how get an element by his index stored in the class? Eg writing '2' into a text box, the combo box sould be show "sometext2". Suppose i want to expand the class adding some values, like m_ItemText2,m_ItemText3 etc, i would learn a method to get all of theese values. I hope I was clear Thanks in advance
Vb.net (Visual Basic) Connectivity from Parallels Windows 10 VM to Docker Azure SQL Edge on MAC Big Sur
I have Docker Azure SQL Edge running on MAC. I have a Parallels Win 10 running on my MAC Inside my Parallels Win 10, I have SSMS running and I can connect to the docker SQL using IPADDRESS(ofMac)\SQLEXPRESS,1433 and SA account.
I can connect to the Docker SQL Server on the MAC from my vb.net app in the Parallels Windows 10 VM. It connects and opens to the form where I select the database I want to open. It is here where I am getting an error. It says "CONTAINERID"\Guest login not found. I tried the connection string to use SA and I get same error. I tried connection string to use Integrated Security = SSPI and same error. The vb.net desktop app is trying to use windows authentication to connect and open the DB. And it is failing.
So I can connect to the SQL Docker image on my MAC from my VB.net desktop App running inside my Parallels Windows 10 Home Image. I just can't open a DB due to windows authentication failing.
Here are some details:
docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=1234Abcd" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge
I get this error: login failed for edcdded46cc9\Guest when I try to open a DB. I can connect to the docker SQL Server using SA no problem. When I try to connect and open a DB on the server, I get the error.
This line in my VB code is throwing the error:
mycomstr = Provider=sqloledb;Data Source=192.168.0.153\SQLEXPRESS,1433;Initial Catalog=CHOICEWORX-A;Integrated Security=SSPI;
I also tried the above string with SA account. I get same error.
SQL Docker Logs:
2021-10-23 23:09:53.59 Logon Login failed for user 'edcdded46cc9\Guest'. Reason: Could not find a login matching the name provided. [CLIENT: 172.17.0.1] 2021-10-23 23:12:54.15 spid61 . Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1. 2021-10-23 23:12:54.15 spid61 Starting up database 'CHOICEWORX-A'. 2021-10-23 23:12:54.24 spid61 Parallel redo is started for database 'CHOICEWORX-A' with worker pool size . 2021-10-23 23:12:54.28 spid61 Parallel redo is shutdown for database 'CHOICEWORX-A' with worker pool size . 2021-10-24 01:11:27.22 Logon Error: 18456, Severity: 14, State: 5. 2021-10-24 01:11:27.22 Logon Login failed for user 'edcdded46cc9\Guest'. Reason: Could not find a login matching the name provided. [CLIENT: 172.17.0.1] imadlodhi@Imads-MacBook-Air ~ %
Format data as an excel table using Powershell
I should format some data in an excel sheet as an excel table using powershell (manually it means selecting a range on a sheet and click on "format as a table"). Probably I need to use COM, but I don't know the syntax for a similar command. Is there anybody who has a script to take as an example or the link to a good COM guide where I could find something helpful? Thank you.
C# Program Can't Get Byte Array Back From A C++ COM Program
I can't seem to get a byte array in a C# program filled from a COM C++ program. The C# program includes a reference to the C++ DLL and is instantiated by:
_wiCore = new WebInspectorCoreLib.WICore();
uint imageSize = *image byte count*; // set to size of image being retrieved var arr = new byte[imageSize]; _wiCore.GetFlawImage(1, 0, ref imageSize, out arr);
[id(5)] HRESULT GetFlawImage([in] ULONG flawID, [in] USHORT station, [in, out] ULONG *pImageSize, [out] BYTE *pImageBytes);
This returns the image size correctly, but nothing in the array. I've also tried the signature (extra level of indirection for pImageBytes):
[id(5)] HRESULT GetFlawImage([in] ULONG flawID, [in] USHORT station, [in, out] ULONG *pImageSize, [out] BYTE **pImageBytes);
and in C# passing in an IntPtr but this returns the address of memory that contains the address of the image bytes, not the image bytes.
Any thoughts on what I'm doing wrong?
COM add-in - Most Popout buttons on ribbon not functioning with replace-all form region
I have an Outlook add-in (C++ COM) where I have a custom ribbon and a replace-all form region within the outlook compose window! My issue is that the little button (popout button options) in some of the groups on the ribbon do not work when clicked on (images attached). If I comment out the load of the replace-all form region (OFT), the buttons will work. I am trying to figure out how the form region relates to the ribbon. I do have a sample project, but I am not sure where I can upload the project.