Topics
-
IComparer use
by Guest Krassimir Manev- 0 replies
- 531 views
I'v created IComparer for SortedList collection but compiler do not like how I'm using it: class IntReverse : IComparer { public int Compare(object x, object y) { int xcopy = (int)x, ycopy = (int)y; if (xcopy > ycopy) return -1; else return 1; } } class Program { static void Main() { IComparer comp = new IntReverse(); SortedList<int,string> a = new SortedList<int, string>(comp); } } Error message: Error CS1503 Argument 1: cannot convert from 'System.Collections.IComparer' to 'int' Continue reading...
-
C# coding question on search within files
by Guest dpcgraham- 0 replies
- 494 views
hello. I'm trying to find a code that allows admin to search for keywords within numerous files i'd actually love an explanation about how to do it :) the search for filename is easy, but actual keywords within the file? Thanks a lot. Dania Continue reading...
-
Parameter Invalid when inserting images into RTB
by Guest Tewl- 0 replies
- 527 views
Hello~ I have a relatively simple (Windows Forms) chat application that I use to monitor incoming messages and I have been wanting to insert images preceding the lines based on what kind of message it is. However, I did not want to use the copy/paste method. So I did some searching online and came across the code below which seems to work except that overtime I end up getting an Invalid Parameter Exception. I searched around and found that my gdi objects building up until the application crashes. The function has calls to dispose of the objects. The images I am using are stored in an imagelist which is also used by listview. Other than that, there are no other code rel…
-
save data from two forms into same table in winforms application
by Guest Ravi Kumar12233- 0 replies
- 523 views
I have two winforms where form 1 is used to enter data from first seven fields and other forms is used to enter for last three fields , where i have the table stored in MSSQL server , but the problem is whenever i tried to save data in second forms it is getting stored in first row itself instead of the row where the first form is updating , so anyone please help how to link these two forms and get them saved in the same row : below is the code for saving the data in Second form, and images are attached: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using S…
-
Need Help to Convert Visual Foxpro button click event to Visual Studio C# click event
by Guest JohnnyAB2020- 0 replies
- 512 views
Below is a click command I had in an old Visual Foxpro project I am trying to get into Visual Studio C# , basically it would go thru the employee training table and required training table if the employee had all the right training for a department it would change the field value in employee table under that department to true. d_training fields dept, form_num, ftitle departments fields numb, dept employee fields e_id, firstname, lastname, dep01, dep02, dep03 thru dep45 e_training fields eid, first, last, number, title So if required training for dept01 was 1,2,3,4 and e_training had 1,2,3,4 for that employee it would change dept01 to true in the employee table …
-
Xamarin binding C library params not working (variadic functions)
by Guest Toine db- 0 replies
- 522 views
I need to use a C library and I got it to work on the emulator easily, but on an arm64 device only with some strange trickery. The issue is that C functions with … (variadic functions) do not pass values correctly from C# to the library. This is the C function, with ... cmd_ln_t * cmd_ln_init(cmd_ln_t *inout_cmdln, const arg_t *defn, int32 strict, ...) { va_list args; const char *arg, *val; char **f_argv; int32 f_argc; va_start(args, strict); f_argc = 0; while ((arg = va_arg(args, const char *))) { ++f_argc; E_INFO("name: %s ", arg); E_INFO(" retrieving value..."); val = va_arg(args, const char*); E_INFO("value retrieved. \n"); …
-
publish c# API
by Guest Carmond- 0 replies
- 541 views
publish c# api and got: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.DefaultPublishTabProvider.InitializeProvider(IVsHierarchy hierarchy) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.DefaultPublishTabProvider.CreateViewAsync(IVsHierarchy project, IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.ManagedPublishProvider.<CreateViewAsync>d__3.MoveNext() help pls Continue reading...
-
publish c# API
by Guest Carmond- 0 replies
- 514 views
publish C# api and got: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.DefaultPublishTabProvider.InitializeProvider(IVsHierarchy hierarchy) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.DefaultPublishTabProvider.CreateViewAsync(IVsHierarchy project, IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Provider.ManagedPublishProvider.<CreateViewAsync>d__3.MoveNext() can you help ? Continue reading...
-
Desktop Push Notifications on multiple devices.
by Guest KashGoyal- 0 replies
- 503 views
Hi Everyone, Currently I am working on a Windows Desktop Application made in WPF and .Net Core 3.0. Recently my client asked me to implement push notifications in my Desktop Application. The scenario is if there are multiple users that are working on the application on different computers.. for our example lets assume 2 users working on 4 systems (each user logged in to 2 computers) and suppose User1 had done some operation on his system so I want that a push notification should go to User1 logged in on another Computer. Also, User2 should not receive any notification for obvious as operation is performed by User 1. I am not sure how to achieve this functionality in WP…
-
C# Wait for download to finish and check folder for files and display in list box ( form a dll )
by Guest Mion Shion- 0 replies
- 489 views
ok i have a program where it connects to my ftp server downloads a file once downloaded and extracted i want to check the dir path that has just been created and add all the files in there to list box but the download i have created is done in a dll, and my program creates the dir if does not exist and adds a zip once downloaded will extract this zip file and from there i want to show those files in a list box only issue i have here is i am trying to find a way of waiting for the download to complete before i look for those files, the code i have in the dll is this. private void wc_completed(object sender, AsyncCompletedEventArgs e) { …
-
try catch is slow and more slow if you are trying to retrieve the "Number" property
by Guest zequion1- 0 replies
- 500 views
When an error occurs in any of my functions, execution is sent to a function that composes the error message.Many errors are not important and should not be displayed on the screen. imagine for example a loop where an error frequently occurs. The problem is that when I want to retrieve the "Number" property, if it doesn't exist in the exception type, an added try catch is produced which slows down the execution even more.How can I tell if the exception has "Number" without fires try catch? Function example (resume): public static dynamic Fcn_Error_Excepcion(dynamic ErrorExcp) { try { if (ErrorExcp is System.Exception) { …
-
OpenSubKey() Registry key's “Absolute Path”?
by Guest AlaskanRogue- 0 replies
- 535 views
Using Microsoft.Win32.RegistryKey C# functions which require a registry path, like OpenSubKey(), using a path like @"SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" generates an error stating “Absolute path information is required.” What is the syntax to create the absolute path required? Continue reading...
-
How to get current row column value from binding source in c#
by Guest NazHiM- 0 replies
- 636 views
Hi All How to get current row column value from binding source in c# i am using C# windows form anybody can help me! with provide some code snippet Continue reading...
-
Asynchronous Operator | TCP | Serialization
by Guest Arsium- 0 replies
- 636 views
Hello dear Sirs, I need your help to make my server and client asynch. Here is the code Dll to serialize : Public Class Class1 <Serializable()> Public Class PacketMaker Public Property File As Byte() Public Property Type_Packet As PacketType End Class Public Enum PacketType As Integer MSG = &H5057 File = &H5056 End Enum End Class Server : Imports System.Net Imports System.Net.Sockets Imports System.Runtime.Serialization.Formatters.Binary Imports System.Text Imports System.Threading Imports ClassLibrary1.Class1 Public Class Form1 Public T As TcpListener = Ne…
-
2 diff blob format reading error
by Guest gwafy- 0 replies
- 596 views
I have 2 diff. image format stored in db2 database as blob one start with 0000000C6A5020200D0A87 which cannot be displayed in picture box I get error invalid parameters and the other start with FFD8FFE000104A4649460 with no problem. So, I tried more than 1 solution till I finally succeeded to display both of them as in the below code But I got both as in Pic. How can I display both Pic. In the right format? Solution1 OleDbDataAdapter1.Fill(DataSet11, "PORT_IMAGE") Dim c As Integer = DataSet11.Tables("PORT_IMAGE").Rows.Count If c > 0 Then Dim output = New Bitmap(Width, Height) …
-
How to restore SQL Server database
by Guest ahmeddc- 0 replies
- 571 views
hi I used this code to restore the database from a specified path or root path, but the following error occurs my code Public conA As New SqlConnection("Data Source=DESKTOP-TRRGQMF\SQLEXPRESS2014; Initial Catalog=namedb; Integrated Security=true") Try cmd = New SqlCommand("restore database namedb from disk='C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS2014\MSSQL\Backup\namedb.bak'", conA) conA.Open() cmd.ExecuteNonQuery() conA.Close() Catch ex As Exception MsgBox(ex.Message) End Try another way 'Try ' Dim database As String = conA.D…
-
[Announcement] “Visual Basic” Forum will be migrating to a new home on Microsoft Q&A!
by Guest Charles He21- 0 replies
- 630 views
This "Visual Basic" Forum will be migrated to a new home on Microsoft Q&A! We've listened to your feedback on how we can enhance the forum experience. Microsoft Q&A allows us to add new functionality and enables easier access to all the technical resources most useful to you, like Microsoft Docs and Microsoft Learn. Now until Nov 29, 2020: You can post any new questions on Microsoft Q&A or here. From Nov 30, 2019 until Dec 14, 2020: New posts - We invite you to post new questions in the "Visual Basic" forum's new home on Microsoft Q&A. The current forum will not allow any new questions. Existing posts - Interact here with existing…
-
Portable App with Database
by Guest DexterCamarillo- 0 replies
- 610 views
I have this problem when publishing and installing my app in another pc. This program is a windows application written in c#. This comes with a local db (.mdf) I made the Connection String to be relative, that is Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\SampleDb.mdf;Integrated Security=True" providerName="System.Data.SqlClient In the publish setting I did not include the SQL Server 2012 Express Local DB. Only the .Net Framework 4.7.2 is included. Then I encountered this error when running the app in another PC error: 52: Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly inst…
-
Using True Type Font Error: "Parameter Is Not Valid."
by Guest deskcheck1- 0 replies
- 630 views
I'm developing a Windows desktop Form application using VS2019. I am using a Google True Type Font Family, "Federo-Regular.ttf". I want to use it for some controls on my Form1. The custom font is loaded via a method when Form1 loads: Private Sub SetForm1CustomFont() Dim privateFonts As New System.Drawing.Text.PrivateFontCollection() Dim filePath As String = IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Federo-Regular.ttf") privateFonts.AddFontFile(filePath) Dim font24 As New System.Drawing.Font(privateFonts.Families(0), 24) Dim font12 As New System.Drawing.Font(privateFonts.Families(0), 12) Me.LblLogo…
-
StartupNextInstance not always firing
by Guest mjscott007- 0 replies
- 640 views
My Windows Form app processes files and is called from the right-click context menu from Windows Explorer. The user selects one or more files, right-clicks on the selection, then picks my app from the context menu. The behaviour of Windows is to call the app once for each file in the selection, and the filename is passed as an argument. Since my app is a "single instance application", I need to use the MyApplication_StartupNextInstance event to capture all the filenames selected. It works - most of the time. Every once in a while (1 out of 5 or so), it misses a file with no error or explanation. I'll select 4 files in Win Explorer, right-click, select my program, and my p…
-
Who's Online 0 Members, 0 Anonymous, 21 Guests (See full list)
- There are no registered users currently online