vb

Getting the whole output of a string that contains chr(0)

Here is the sample: Dim TestString As String = "Hello," & Chr(0) & "World" MsgBox(TestString, , "TestString.Length=" & TestString.Length.ToString) Result - Messagebox shows "Hello," with title says TestString.Length=12 I guess the chr(0) is treated as the end of zero terminated string, but it's not what i want. What the ri...

How do I put a WebResponse into a memory stream?

What is the best way to get a file (in this case, a .PDF, but any file will do) from a WebResponse and put it into a MemoryStream? Using .GetResponseStream() from WebResponse gets a Stream object, but if you want to convert that Stream to a specific type of stream, what do you do? ...

How to associate all textbox controls on a form with the same event handler

VB 2008. I have several text boxes on a form and I want each of them to use the same event handler. I know how to manually wire each one up to the handler, but I'm looking for a more generic way so if I add more text boxes they will automatically be hooked up to the event handler. Ideas? EDIT: Using the C# sample from MusiGenesis (and...

VisualBasic Month function inconsistency

I'm working in a web application using VB.NET. There is also VisualBasic code mixed in it, in particular the Date variable and the Month function of VB. The problem is this part: Month("10/01/2008") On the servers, I get 10 (October) as the month (which is supposed to be correct). On my machine, I get 1 (January) (which is supposed t...

Exceptions Thrown (Errors Encountered) After Program Termination

I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these memory read/write errors seem to indicate something wrong in my "unsafe" code usage (pointers?). ...

Converting a class library to a webapp in Visual Basic?

I was delivered several hundred source files for a web app original written in classic ASP, but somewhat ported to VisualBasic.NET and ASP.NET It didn't come with any form of project or solution files. I'm trying to get it setup to build, but am struggling. If I try to open it as a WebSite (ala Web Site instead of Web Project), I get h...

How do you enable Visual Basic.NET namespace by default?

I'm coming from C# background and in Visual Studio. The namespace is shown by default but not in Visual Basic. Is there an option to enable namespace to be shown in Visual Studio 2008? ...

ASP .Net error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt. "

Hi I get the following error when trying to load an RSS feed: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." My code works fine from my local host, error only occurs when i upload it to my dedicated server! Here is the code: Protected Sub Page_Load(ByVal sender As Object, ByV...

Refactoring features in Visual Studio 2005 for VB

Hi, Does anybody know a good and free add-in for Visual Studio 2005 to get refactoring features in VB? Thanks in advance /Enrico ...

How to use sftp from within an MS Access database module?

I have a requirement to create a simple database in Access to collect some user data that will be loaded into another database for further reporting. There will be a module in the Access db that when invoked by the user (probably by clicking a button) will output a query to a delimited file. The user also needs a mechanism (for example...

Examples of Optimization in VB/VBA/VB.net?

Please post examples of optimization done in VB/VBA/VB.net? Optimization can be in the context of performance or space/maintainability. Edit: Please specify somewhere in your post which environment you know your technique works in. Thanks. ...

MS CA Exit Module Code or Tutorial

Hi I'm struggling to find examples/explanations of coding a MS Certificate Authority exit module. If anybody has any help or resources they can point me at I'd be grateful. Thanks Mark ...

Host C# winforms in VB6 applications

I have a VB 6 application and we are starting to port it over to C#. We have finished one of the screens and wanted to see if there was an incremental way of hosting the winform within VB to start to have the existing users get used to new screens. This is a migration strategy.. Any thoughts. ...

Stand-alone report preview through RDC/ActiveX Crystal Reports XI

I'm porting an application from Crystal Reports 8 to Crystal Reports XI in Delphi 5, using the RDC/ActiveX interface. In Crystal Reports 8, I was able to bring up the crystal reports default report viewer window for a report like so: RptInvoicing.Destination := 0; // To: window RptInvoicing.Action := 1; // Execute However, this does ...

VB code to combine two files, everything seems good why isn't it working?

Alright so I'm essentialyl trying to code something that will combine two files together in VB and output a single file that when run, runs both of them. I've grabbed this source from several places online and am just trying to get it to work. We have the main program that combines them with a GUI Const FileSplit = "@<>#<>#<>@" Priva...

Best way to make it so an exe can only be run once.

I've got a Visual Basic App that tends to get severely messed up if the installation runs more than once. It seems the occasionally client mistakes the installer for the shortcut to it later on down the road, runs the installer again and it messes everything up. I can't for the life of me figure out why so I decided the easiest way wou...

build a string using checkbox

can anybody show me how to build a string using checkbox. what would be the best way to do this. for example i have 4 checkbox's each with its own value (valueA, valueB, valueC, valueD) the thing is i want to display each result in different lines. result if B & C is selected : valueB valueC and how would i display this again if i...

What are underscored symbols in a VB DLL?

I have a C++ app in VS2005 and import a VB DLL. IntelliSense shows me all the symbols in the DLL as expected but it also shows all (or nearly all) of them again with an underscore prefix (no @s in them though). Why is this? What are the differences between the underscored items and the normal items? ...

How to create Windows firewall exception in Visual Basic 2005?

Is there a way I can create Windows firewall exceptions in VB2005? I'm trying to deploy a small app that opens up a few ports so I can connect to them and convert them using VMWare Converter. Thanks in advance, Clint. ...

How do I make the IsEnabled property of a button dependent on the presence of data in other controls? (WPF)

I have a "Login" button that I want to be disabled until 3 text boxes on the same WPF form are populated with text (user, password, server). I have a backing object with a boolean property called IsLoginEnabled which returns True if and only if all 3 controls have data. However, when should I be checking this property? Should it be ...