vb6

Why is VB6 still so widely used?

Note that this question is not meant to start an argument, I am genuinely curious: Back in the 90s I used to work for a large CPU maker and we were building some debuggers. All our core logic was in C++, but the GUI was made in VB6. We couldn't figure out MFC and it was too much a hassle. We glued together VB6 and C++ using COM which we...

How to get string from the output of ReadProcessMemory

This is a snippet of my code. Declare Function ReadProcessMemory Lib "kernel32" _ (ByVal hProcess As Long, _ ByVal lpBaseAddress As Long, _ lpBuffer As Any, _ ByVal nSize As Long, _ lpNum...

Default Property for dotNet Interop Usercontrol

I need to set the default property of a dotNet Control used by an VB6 Application. <ComClass(myControl.ClassId, myControl.InterfaceId, myControl.EventsId)> _ <DefaultProperty("NewProperty")> _ Public Class myControl Public Const ClassId As String = "86252de2-ca87-4468-adbe-ad7c47747759" Public Const InterfaceId As String = "c1c...

CDO.Message - to many connections

I am writing a newsletter application using CDO.Message. But get an error back that we have to many connections. Seems they have a limit of 10 simultaneous connections. So, is there a way to send several messages on one connection, or disconnect faster? There is a cdo/configuration/smtpconnectiontimeout parameter, but I think that's m...

Getprivateprofilestring Bug

Hi I encrypted some text and put it in a INI file. Then I used getprivateprofilestring() to retrieve the value but some of the end characters are missing. I suspect it may be a new line character causing it to be incomplete. Writing to the INI file is OK. Opening the INI file and looking at the sections and keys - everything is in order...

Best Development tools for Upgrading from VB6.0

Im planning to upgrade a large vb6 application to .net. The project uses many third party components eg VSFlexGrid as well as crystal reports. It also uses old VB6 dlls whose source code is unavailable. My questions are Should I convert the source to C# or is VB.net robust enough? What do I do about third party components that are not ...

VB/VBA: Fetch HTML string from clipboard (copied via web browser)

It seems that when you copy something from a web browser to the clipboard, at least 2 things are stored: Plain text HTML source code Then it is up to the software that you are pasting into can determine which one it wants. When pasting into MS Excel 2003, you have a paste special option to paste HTML, which will paste the formatted...

How do you create an Excel worksheet through VB6 without the Excel Object?

I was recently put in charge of updating a VB6 data collection app, to add the ability to generate Excel reports and print them through the app (both have to be done on same computer). Normally this wouldn't be an issue, I've generated Excel reports with VB6 before using the Excel Object. So I went ahead and coded together the changes a...

VB6 web application - RM or Non-RM - does it really matter?

I'm supporting a legacy VB6 web application. We generally try to use Retained in Memory (RM) components. However, some components are "borrowed" from a Windows application. Since those components contain forms, they cannot be marked as RM. As a result, we currently have a mix of RM and non-RM components. The question has been raised...

adding items to listview at runtime

Hi guys. When I add new values to a listview using : Set lstView = ListView(0).ListItems.Add(, , txtName) lstView.ListSubItems.Add , , txtValue lstView.Refresh The only problem is that this only displays a blank new line in the listview, any idea how to update it correctly? Normally I am using a recordset so simply clear...

Include sql scripts in a VB6 application

I am maintaining an old VB6 application, and would like to include SQL scripts directly in part of the project. The VB6 application should then extract the text of this script and execute it on the server. The reasons for this approach are various - among others, we want to deliver only an updated executable rather than a complete updat...

How can you calculate the appropriate Font Size if the deployment PC has a different font DPI?

I'm trying to figure out the font DPI size on the target Windows machine and modify our app's font so that it appears the same size as it would if the target machine had the same dpi as the dev machine. (So a larger Target DPI would mean we'd make our fonts smaller than at dev time). I'm wondering if there are any problems with the solu...

Automatic type conversion in Visual Basic 6.0

When we convert a float to integer in visual basic 6.0, how does it round off the fractional part? I am talkin about the automatic type conversion. If we assign like Dim i as Integer i=5.5 msgbox i What will it print? 5 or 6 ?? I was getting "5" a couple of months before. One day it started giving me 6! Any idea whats goin wrong? D...

Making a SETUP file

I have a VB project that runs on SQL SERVER 2005, while making the setup file for it, how do I include the DB? ...

How to resolve Sybase table locks (VB6)?

I am not a great VB programmer, but I am tasked with maintaining/enhancing a VB6 desktop application that uses Sybase ASE as a back-end. This app has about 500 users. Recently, I added functionality to this application which performs an additional insert/update to a single row in the database, key field being transaction number and the...

Opening a VB6 form from WPF application

hello all, We are currently working on porting an old VB6 application to WPF. The plan, in phase one, is to port several key forms and not all the application. Its been brought up that we might try and open some of the old VB6 form from within the WPF application (as modal forms), thus providing greater functionality then intended for t...

More elegant solution for pulling value from DB using recordset

Is there a better solution (using less code) for the following code snippet. It is something that I find myself doing a lot of in VB6 and was hoping to trim it down. As I understand it Connection.Execute will not work SQL = "SELECT SomeID FROM TableA" RecordSet.Open SQL, Connection, adOpenStatic, adLockOptimistic, adCmdText ...

Running a non-thread-safe dll in a multithreading windows http server

I need to encapsulate a VB6 application as a COM object that will be called by IIS. One of the dlls used by the VB6 app is NOT thread-safe. How can I make sure that whenever my COM object is called it doesn't share the same dll with other instances of itself? I read somewhere that ActiveX exes run each instance in a different process,...

raising a vb6 event using interop

Hi, I have a legacy VB6 component that I've imported into VS using tlbimp.exe to generate my interop assembly. The VB6 component defines an event that allows me to pass messages within VB6. Public Event Message(ByVal iMsg As Variant, oCancel As Variant) I would really like to be able to raise this even in my C# program, but its gettin...

VB plus color in grids

Is there a way to put color in rows(flexgrids) ? If so, how ? Thanks. ...