vb6

Parse finnish date string to Date Type in VB6

ぃ、小莉子 提交于 2020-01-14 01:45:32
问题 I'm getting a Finnish date string that looks like: 29.7.2011 9:27 I'm trying to cast this string to a Date object in VB6. I've tried using the Format function but it doesn't seem to swallow the date string or I'm doing something wrong. These are some approaches I've tried: theDate = Format(dateString, "General Date") theDate = Format(dateString, "DD.MM.YYYY MM:HH") Any ideas? Thanks. 回答1: Rather than manually parsing the string yourself, which is prone to errors, and which gets messy if you

VB6 Variant type

放肆的年华 提交于 2020-01-13 20:30:08
问题 I come from an Object Oriented background. Why does "Test" (notice the quotes) display (in the message box) in this code fragment. I would expect the logical test: 'If Test = "True"' to return False because the variant contains a Boolean and not a String. Therefore I would not expect the Message Box to appear, but it does: Dim Test As Variant Test = True If Test = "True" Then //line 5 MsgBox ("Test") End If 回答1: Variant type values in VB6 (and most other languages that support them)

FilePut does not prepend the two length bytes when writing a string to a binary file from C#. FilePutObject throws exceptions on classes/structs

浪尽此生 提交于 2020-01-13 19:46:53
问题 I have a app that needs to be both read and write compatible with a VB6 binary file. I learned about the Microsoft.VisualBasic.FileSystem class and I am trying to write out a structure to the file. FileSystem.FileOpen(file, "test.bin", Microsoft.VisualBasic.OpenMode.Binary); FileSystem.FilePut(file, patch.intTest); FileSystem.FilePut(file, patch.dateTest); FileSystem.FilePut(file, patch.stringTest, StringIsFixedLength: false); FileSystem.FilePut(file, patch.boolTest); Everything writes

Deleting certain character from right and left of a string in vb6 (TrimChar)

吃可爱长大的小学妹 提交于 2020-01-13 11:11:09
问题 I want to delete some certain characters that used wrongly in a string. "........I.wanna.delete.only.the.dots.outside.of.this.text..............." as you can see I can't use replace for this. I must find a way to delete only the characters at left and right of a string and those dots only an example of characters that I want to delete. I have an array of those unwanted characters. So after the process string should look like "I.wanna.delete.only.the.dots.outside.of.this.text" but I couldn't

How can I debug a VB6 IIS Application on Windows 7 64-bit

别来无恙 提交于 2020-01-12 14:26:48
问题 I have a need to be able to debug a Visual Basic 6 IIS Application on Windows 7 64-bit. Not just for a single problem but for continuing development. An attempt to debug results in an error "An unspecified error has occurred" from the WebClass runtime. If I do not debug and simply access the compiled webclass the page loads just fine. Therefore, I don't believe there is anything wrong with the registration / configuration of the application but rather this is somehow related to Windows OS

How can I debug a VB6 IIS Application on Windows 7 64-bit

末鹿安然 提交于 2020-01-12 14:26:43
问题 I have a need to be able to debug a Visual Basic 6 IIS Application on Windows 7 64-bit. Not just for a single problem but for continuing development. An attempt to debug results in an error "An unspecified error has occurred" from the WebClass runtime. If I do not debug and simply access the compiled webclass the page loads just fine. Therefore, I don't believe there is anything wrong with the registration / configuration of the application but rather this is somehow related to Windows OS

Does VB6 support unsigned data types?

浪尽此生 提交于 2020-01-12 08:01:31
问题 In order to settle a bet with one of my colleagues, I would like to find out if VB6 natively supports any unsigned data types. I believe the answer to be "no", but I can't seem to find any official documentation confirming that. A simple link to a Microsoft document would be an acceptable answer; an historical justification as to why such types are not supported would be an added bonus. 回答1: As Kris said, they're not supported, except for the Byte datatype, which is only available as unsigned

Vb6 How do I make a Random String of 0-9 and a-z of x characters

纵饮孤独 提交于 2020-01-12 06:58:29
问题 Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can't seem to find a good example, any ideas? 回答1: Function RandomString(cb As Integer) As String Randomize Dim rgch As String rgch = "abcdefghijklmnopqrstuvwxyz" rgch = rgch & UCase(rgch) & "0123456789" Dim i As Long For i = 1 To cb RandomString = RandomString & Mid$(rgch, Int(Rnd() * Len(rgch) + 1), 1) Next End Function Please be aware that the built-in random number generator is not cryprographically secure

How to install VB6 SP6 on Windows 8.1 x64?

与世无争的帅哥 提交于 2020-01-12 04:43:11
问题 Need to support some old projects directly in the newest OS, not in a virtual machine. I've installed VB6 from the VS6 disk #1 successfully, but I cannot install the SP6 for this development environment. When I launch it, an information window that informs me about the installation progress appears for some milliseconds, but the required files (ADVPACK.DLL, msvbvm60.dll, ...) aren't updated in the system folder. The About dialog in VB6 IDE also proves that - I do not see "SP6" anywhere in it.

how do I express the term if x is integer in VBA language?

给你一囗甜甜゛ 提交于 2020-01-12 03:09:06
问题 how do I express the term if x is integer in VBA language ? I want to write a code that does something if x is integer and does something else if its not with vba excel. Sub dim() Dim x is Variant 'if x is integer Then 'Else: End Sub 回答1: If IsNumeric(x) Then 'it will check if x is a number If you want to check the type, you could use If TypeName(x) = "Integer" Then 回答2: This may suit: If x = Int(x) Then 回答3: It depends on if you mean the data type "Integer", or Integer in the sense of: "A