vb6

Attempting to learn polymorphism, etc. in VB6, but my code doesn't do what I want it to

两盒软妹~` 提交于 2020-01-11 11:09:29
问题 Here's what I've got on a command button; it's just creating variables and attempting to output their ID (which should be an instance variable inherited from the base class.) Private Sub Command1_Click() Dim ball1 As Ball, ball2 As Ball Dim cube1 As Cube, cube2 As Cube Set ball1 = New Ball Set cube1 = New Cube Set cube2 = New Cube Set ball2 = New Ball MsgBoxTheID (ball1) 'errors; should be 0 MsgBoxTheID (ball2) 'errors; should be 3 MsgBoxTheID (cube1) 'errors; should be 1 MsgBoxTheID (cube2)

Attempting to learn polymorphism, etc. in VB6, but my code doesn't do what I want it to

拟墨画扇 提交于 2020-01-11 11:09:13
问题 Here's what I've got on a command button; it's just creating variables and attempting to output their ID (which should be an instance variable inherited from the base class.) Private Sub Command1_Click() Dim ball1 As Ball, ball2 As Ball Dim cube1 As Cube, cube2 As Cube Set ball1 = New Ball Set cube1 = New Cube Set cube2 = New Cube Set ball2 = New Ball MsgBoxTheID (ball1) 'errors; should be 0 MsgBoxTheID (ball2) 'errors; should be 3 MsgBoxTheID (cube1) 'errors; should be 1 MsgBoxTheID (cube2)

Best IPC for VB6 and .net application

天涯浪子 提交于 2020-01-11 07:12:18
问题 In our application (a document management system) we are supposed to be notified of screen changes (or notify the other program of screen changes) in order to keep the two applications looking at the same data, one being the order fulfillment app, the other the document viewer of the original fax. The fulfillment app is written in vb6 and the document manager is in .net 3.5 (c#). It runs on a terminal server so it also has to be session aware. The document viewer or the fulfillment app may be

How can I copy an open file using VB6?

半世苍凉 提交于 2020-01-10 05:23:17
问题 I have a legacy VB6 application that uploads file attachments to a database BLOB field. It works fine unless a user has the file open. I tried creating a copy of the file, then uploading that copy, but to my surprise, the FileCopy procedure gets a "permission denied" error whenever you try to copy a file that is open by the user. This suprised me, because you can copy a file in Windows Explorer while it is open, and I was assuming that the FileCopy method used the same API call as explorer.

How can I subtract a previous row in sql?

梦想与她 提交于 2020-01-09 10:09:18
问题 What should I query if I wanted to subtract the current row to the previous row. I will use it on looping in vb6. Something Like this: Row 1 2 3 4 5 On first loop value 1 will not be deducted because it has no previous row, which is ok. Next loop value 2 will then be deducted by the previous row which is value 1. And so on until the last row. How can I achieve this routine? By SQL query or VB6 code.Any will do. 回答1: Assuming you have an ordering column -- say id -- then you can do the

How can I subtract a previous row in sql?

邮差的信 提交于 2020-01-09 10:07:57
问题 What should I query if I wanted to subtract the current row to the previous row. I will use it on looping in vb6. Something Like this: Row 1 2 3 4 5 On first loop value 1 will not be deducted because it has no previous row, which is ok. Next loop value 2 will then be deducted by the previous row which is value 1. And so on until the last row. How can I achieve this routine? By SQL query or VB6 code.Any will do. 回答1: Assuming you have an ordering column -- say id -- then you can do the

Calling a VB6 method from a .NET DLL

混江龙づ霸主 提交于 2020-01-09 08:08:19
问题 I have a DLL written in VB 6 and another DLL written in Visual Studio 2005 (VB.NET). Now I want to invoke the method of the VB DLL from my .NET DLL. What should I do for this? Any thoughts? 回答1: As VB6 creates COM DLLs, Visual Studio should have no problems generating an interop stub for you. Simply add a reference to the VB6 DLL from your .NET project by selecting Add Reference in Visual Studio and finding your DLL under the COM tab. Make sure the VB6 DLL is registered on your machine before

How to check type of object in VB 6 - Is there any method other than 'TypeName'

て烟熏妆下的殇ゞ 提交于 2020-01-09 05:40:18
问题 How to check type of object in VB 6 - Is there any method other than 'TypeName' because its not feasible to check it witrh 'TypeName' I am expecting something like QuichWatch window. 回答1: For object variables, use TypeOf ... Is : If TypeOf VarName Is TypeName Then ''# ... End If For example: Dim fso As New Scripting.FileSystemObject If TypeOf fso Is Scripting.FileSystemObject Then Debug.Print "Yay!" End If 回答2: Just to add to @Tomalak's answer... If the object variable has not been

VB6 to VB.net conversion [closed]

孤街醉人 提交于 2020-01-09 05:36:34
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Exact duplicate: Best strategy for moving applications from VB6 to VB.Net Exact duplicate: Conversion tool comparisons for VB6 can any

Compile a DLL in C/C++, then call it from another program

情到浓时终转凉″ 提交于 2020-01-08 18:18:13
问题 I want to make a simple, simple DLL which exports one or two functions, then try to call it from another program... Everywhere I've looked so far, is for complicated matters, different ways of linking things together, weird problems that I haven't even begun to realize exist yet... I just want to get started, by doing something like so: Make a DLL which exports some functions, like, int add2(int num){ return num + 2; } int mult(int num1, int num2){ int product; product = num1 * num2; return