I am currently in the process of converting a program I have developed from VB6/VBA to Visual Basic.NET. The object of this function is to run a query on an SQL Server Hosted database and output the results to Excel. I have a couple of last final problems though, in the old vb6 lines:
I m comparing two images in VB.Net..I get the code in C# & dat code is working 100 % Correctly..Now want to convert dat code to vb.net..& i need help in just converting two lines-
I need assistance converting the following C# code which works into VB code. The code detects when a specific type of USB device is connected and disconnected and writes the status to a status strip:
I got this code from msdn[URL]..I have most of it converted but having an issue with the following sub getting it converted correctly Protected Overrides Sub AdjustEventHandlers(ByVal sender As
I am converting a c++ code to vb but there is a problem, i dont know how this code work, if you know what is type of SetFilter parameters and SetBitFilter tell me. i cant use SetBitFilter in vb because it give me an error this is cause of i dont declare them correctly or their values. but when i use SetFilter it work few second and it stop working and with a dialog that have 2 button (close and debug)
I found some code on the net that is supposed to convert a BMP file into a AVI file.
[URL]
The example is in C# so i converted it using a C# to VB.NET converter and fixed a few of the conversion bugs. The code executes but fails on the line 'Throw New AviException("error for AVIFileOpen")' saying 'AVI exception unhandled'.
I have some code, that I am converting from C# to VB, in the code is the following line.
int index = ((int)document.GetCharAt(wordOffset +1)) % 256
that translates to something like this:
Dim index as Integer = CInt(document.GetCharAt(wordOffset + 1)) Mod 256
The problem is that the GetCharAt() function returns a Char type (pretty obvious from the name). VB throws an error saying that Type Char can't be converted to Type Integer. So my question is, what is the result of the explicit conversion in C# code?
I never used delegate before Currently I am converting some C# code to VB.NET and am having some issue, it says
Error 2 Method 'Private Sub OnNewMessage()' does not have the same signature as delegate 'Delegate Sub OnChangeEventHandler(sender As Object, e As System.Data.SqlClient.SqlNotificationEventArgs)'.
I was looking for a way to get a direct link from mediafire's file hosting service. By default, when a user visits a download link, he will be presented with a download page where he has to wait for the download to be processed and then a link will appear.This link will appear in the div id 'download_link'.[url]
I have created a custom ribbon for Excel 2010. This ribbon has a custom tab with various custom buttons. I have these buttons programmed to run an existing Macro in Excel. This is functioning just fine, but I would rather have the button run the code instead of activating the Macro. Basically, the Macro inserts a template worksheet after the active sheet.how to convert this simple VBA code to VB.Net?
Sub Insert_Sheet_AfterActiveSheet() Sheets.Add After:=ActiveSheet, Type:="C:template sheet.xls" End Sub
I'm converting some C# code to VB.Net, as it's a language I know better, I've got some code that I can't figure out...
Dim mybtn As New ImageButton() mybtn.ImageUrl = _imgUrl Select Case _buttonType Case ButtonType.Backpage
[CODE]...........
This is giving 2 errors:
Me.btnBackpage_Click = Delegate 'System.Web.UI.WebControls.CommandEventHandler' requires an 'AddressOf' expression or lambda expression as the only argument to its constructor.
And
mybtn.Command = 'Public Event Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
I have this snippet of VB.NET code that I want to convert to VBScript. It basically starts Microsoft Word, displays the Open dialog and mail merges the selected document.
Dim oMissing As Object = System.Reflection.Missing.Value Dim oEndOfDoc As Object = "\endofdoc" Dim oFalse As Object = False 'Start Word and create a new document. Dim oWord As Word._Application Dim oDoc As Word._Document
Visual Studio 2005.I was converting some of my source code to C#.However, when I was doing the code snippet below, I noticed I don't have the IsNumber method.Why is the IsNumber missing? I wanted to use it so that I can force a user to enter only numbers.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar.IsNumber(e.KeyChar) = False Then
I was trying to figure out how to convert a string (that the user would input to the program via a textbox) into actual code for the program to compile. For example, if the user was to enter: (5*100)+(20-3). How could you take that inputted string, and have the program solve it and return the value?
i'm making a console program that consults a website of my work but it uses https and has a Untrusted certificate so i get this error: This Connection is Untrusted i did some research on the internet about this issue and come up with this code
//for testing purpose only, accept any dodgy certificate. public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
All the automated, online converters weren't able to convert this code. Unfortunately my brief knowledge of C# has also let me down. The code originates from a blog, linked from another of my questions.
The back color of button 1 is red. However when I use this code the textbox types "red" instead of "#ff0000". Is this because when typing HTML, most normal people would type:
<font color="red"> <!--- Instead of typing ---> <font color="#ff0000">
way to do this without third party components? I have been trying to do it using a reference to Acrobat, but I I cant make it work... Specifically I would like to pass the Save As dialogue a filename and extension....
here is the code I am working with:
AcroXApp = CType(CreateObject("AcroExch.App"), Acrobat.CAcroApp) 'Removing toolbar buttons from the user interface With AcroXApp
I am having trouble converting some code from VB6 to VB.NET (I don't have as much experience with .NET). When I run the 'Select function (from the WS2_32.dll library) in .NET, using the same parameters as the VB6 program, it returns a result of -1 (indicating an error). I think the error may be related to an upgrade comment I saw about marshalling, but I was not sure what I needed to do to declare the function differently. Here is the code that I believe is related to the problem (including the upgrade warnings from Visual Studios):
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Private Structure FD_SET Dim fd_count As Integer <VBFixedArray(FD_SETSIZE)> Dim fd_array() As Integer Public Sub Initialize()
We use a number of VB6 DLLs in classic ASP, using Server.CreateObject in the ASP page. The DLL code has recently (as a test) been converted to VB.Net 2008, and all the obvious issues that usually arise have been dealt with, meaning we are now able to use a .Net version of the DLL in classic ASP using interop (by using regasm to register the assembly for use in COM). The code that the converter added to the objects to make them usable in COM was <System.Runtime.InteropServices.ProgId("My.ObjectName")>, just before each class definition.
We have started noticing an inconsistent performance issue when using this new version of the DLL vs. the VB6 version in that it can sometimes take much longer to perform some tasks (even the task of constructing the objects from the DLL). In fact the same unit of work, including some DB work - now through interop ADO - can vary wildly (This is not limited to ADO work though!). We have started looking into this to try to figure out if it's some constant source of inefficiency, or if it's a load issue (threading related maybe).
I cannot seem to find a straight answer to the issue of threading when converting the code base. The DLL in VB6 is configured to use "Apartment Threading", the only other option being "Single Threading". Is this something that requires attention and is relevant when converting to .Net given we are still using the DLL through COM, and does anyone know what needs changing/configuring/checking?
I was wondering, is their any way to change a string into a line of math code. I was working on a graphing calculator project and am having trouble splicing up everything into variables and coefficient and operators. Example, having this block of code work
Would it be possible to basically make a full web page appear in a windows form application as an image? Sort of like a print screen command, but just for the web page itself. I need this to show any web page in overview as a image in my program, but I have no idea how to go about this. I suppose it would be almost like a web browser; other then that you can't click links or interact with the page at all, as it is an image. Preferably without loading the web page then converting it, but having it as in image as you load any given page - not sure if it's possible with just VB. Even a rudimentary method would be much appreciated.Note: I'm not to great with VB, so if you don't mind, please provide as much detail as you can with any given code,
I have converted this parallel extension c# code sample to VB.NET
[URL]
using the Developerfusion tool here but I am getting multiple errors that I cannot resolve with my limited C# experience.
1) After getting errors I converted System.Runtime.CompilerServices.Extension to Global.System.Runtime.CompilerServices.ExtensionAttribute which is the closest I could come up with, and I get errors on the line (26)
Return SendTaskCore(ping, userToken, Function(tcs) ping.SendAsync(address, tcs))saying that ping.SendAsync(address, timeout, tcs) does not produce a value
2) Around line 196 handler = Function(sender, e) EAPCommon.HandleCompletion(tcs, e, Function() e.Reply, Function() ping.PingCompleted -= handler)
I get an error on 'ping.PingCompleted' saying'Public Event PingCompleted(sender As Object, e As System.Net.NetworkInformation.PingCompletedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.