vb6

does VB6 allow referencing Form instance as a singleton just by naming its data type? or what is happening?

笑着哭i 提交于 2020-02-03 09:32:47
问题 I am seeing code like "Unload frmMain" where from what I can tell frmMain is the type/module name, and I don't think it could also be simultaneously a variable name of the "ObjFrmMain" sort. Nevertheless, this command does successfully induce the form in question to unload. So is the data type being used as an alias for its single existing instance? Or maybe for all of its instances? Does VB6 do similar things to data types other than those derived from Form? 回答1: Yes, VB6 has odd object

How can I make a certain part of my form scrollable?

試著忘記壹切 提交于 2020-01-30 11:16:10
问题 I'm making a program in vb6 that requires me to be able to scroll a certain area of the screen to the right. It consists solely of lines and picture boxes, is there a way to only scroll that area? Thanks! 回答1: Here is a simple example illustrating what you requested. The key is that the scrollable area must be a container control hosting the controls you wish to scroll. Option Explicit Private oldPos As Integer Private Sub Form_Load() HScroll1.Min = 0 HScroll1.Max = 1000 HScroll1.SmallChange

http get in vb6 and receive xml data

我怕爱的太早我们不能终老 提交于 2020-01-30 01:15:00
问题 I don't know much thing in vb6. I have a problem I need to make a http get request to a server, and the response will be some xml data. i also have to send some data to server via query string. I'm new to vb6 and don't have any idea about how to do that. need your help. 回答1: Your best bet is using the DOMDocument class, which should be on all versions of Windows from 2000 to 7. Add a reference to a version of "Microsoft Xml". Dim oDocument As MSXML2.DOMDocument Set oDocument = New MSXML2

Connecting VB to MySQL

 ̄綄美尐妖づ 提交于 2020-01-25 12:55:48
问题 I would like to ask some help on how to connect VB6 to MYSQL? Please provide references as well. Many Thanks 回答1: Google indicates you can use ADO and the MySQL ODBC drivers. Dim strConnection$, conn As Connection 'Fill in the placeholders with your server details' strConnection = "Driver={MySQL ODBC 3.51 Driver};Server=myServerAddress;" & _ "Database=myDataBase;User=myUsername;Password=myPassword;Option=3" Set conn = New Connection conn.Open strConnection ODBC connection string for MySQL

Calling a Module and a Class within a Form

让人想犯罪 __ 提交于 2020-01-25 06:48:05
问题 I have an Employee class where I call my database connection Module to make a query. I am getting "Compile Error: Expected function or variable", which I'm not understanding, because I have the empObj set at the top of the form. I would like to return the value from the Employee.getEmployee method. Can someone please show me how to call the Employee class from my form? Do I have to import the class first? I don't believe VB6 supports the Imports keyword. This is my form: Option Explicit

Distributing Visio addin developed in VB6

亡梦爱人 提交于 2020-01-25 04:41:11
问题 I have old VB6 Addin (Visio) source code that generates DLL when compile. I need to distribute this dll to end user, but when I run following command as Administrator on user's PC: regsvr32 MyAddin.dll it throws: The Module "MyAddin.dll" was loaded but the call to DllRegisterServer failed with error code 0x80004005. To debug this I created a new VB6 Addin project, changed Application to "Microsoft Visio" in Connect.Dsr. and tried to installed this dll to fresh windows 10 VM having Visio.

Compare two date times

♀尐吖头ヾ 提交于 2020-01-24 12:24:48
问题 label1 displays the last transaction date/time which I get from a database through a query. label2 is the system date/time. I have a timer that executes a command button after which I want to check if the date/time in label1 is smaller than 5 minutes. If so then I want to show a massage. But I don’t know why my code is failing to perform this function. Any help will be much appreciated. Private Sub Command1_Click() Dim date1 As Date Dim date2 As Date date1 = Format(Now, "yyyy/mm/dd hh:mm:ss")

in vb6, how do I retrieve a char* parameter from a C dll?

对着背影说爱祢 提交于 2020-01-24 12:04:30
问题 I am calling a C dll from my VB6 application. The dll has a function call signature as follows. void WINAPI geterrstr(char* foo); where foo is a string that has to be returned. In my VB6 application, I have tried calling my dll by using the following syntax, but it returns an empty string. Declare Sub geterrstr Lib "technopnp.dll" (ByRef lpbuffer As String) Any ideas? 回答1: You should be able to; Declare Sub geterrstr Lib "technopnp.dll" (ByVal lpbuffer As String) ... dim buff as string buff

What exactly is a “File Number”?

别说谁变了你拦得住时间么 提交于 2020-01-24 04:12:06
问题 I'm working in some C# code that had earlier been converted over from VB6 and it does lots of file I-O. All over the place I see this: fn = VBNET.FileSystem.FreeFile(); ...followed by VBNET.FileSystem.FileOpen() , some file I-O, and then VBNET.FileSystem.FileClose() . The call to FreeFile() generates a "file number", which is required to open the file. But what IS a file number and how do you release it back to the system when you're done with it? The documentation at http://msdn.microsoft

How to determine if DLL is COM or .NET?

这一生的挚爱 提交于 2020-01-24 03:05:52
问题 I have an updater program, the pulled files from server has mixed vb6 dll and .net DLLs in one directory. How to determine if a dll is a COM one? (so i can invoke regsvr32 to it from the updater program) 回答1: I guess one way to do it would be to try load the file with System.Reflection.Assembly.LoadFile(). If you get a BadImageFormatException, it's not a valid .NET assembly. There's probably a neater way of doing this, but this should work. http://msdn.microsoft.com/en-us/library/b61s44e8