vb6

Will a VB6 App Using wiaaut.dll work on Windows Vista or 7?

旧巷老猫 提交于 2019-12-23 21:32:03
问题 I downloaded the Windows Image Acquisition Automation Layer sdk redistributable from Windows and the VB6 app I wrote to capture still images from a DSLR, wia-compliant camera works great on Windows XP. Will the same app work on Windows Vista or 7? Microsoft says, "Windows Image Acquisition Automation Library v2.0 is only supported on Windows XP with Service Pack 1 installed.", but will the APIs work on newer OSs nonetheless? I really don't want to re-write the whole thing in C++ ... Is there

Use a window handle as an owner for a VB6 form

别说谁变了你拦得住时间么 提交于 2019-12-23 20:52:01
问题 What is the Win32 equivalant of Form2.Show vbModeless, Form1 that allows me to set the owner (not the parent) to an arbitrary hWnd and set the default position, etc? As far as I'm aware, this can only be set when creating a window. 回答1: I'm not sure what you are trying to accomplish, but I think you might be looking for the SetParent function. Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long hWndChild is the handle to the child window.

Easiest way to find previous instance of an application

末鹿安然 提交于 2019-12-23 20:24:27
问题 I have rewritten a VB6 application in Delphi. It should have only one instance running. How can I do this with minimum of code? In VB6 we just have to use one single line of code > If App.PrevInstance Then 'Take some action End If On goggling I did find a solution but it is very length and we have to mess with .drp file. I do not want to do that. I want something simpler. 回答1: I have some code along the lines of: var AppMutex: THandle; { .... } initialization // Create the mutex AppMutex :=

VB 6 Checking if a file on the network exists takes too long

限于喜欢 提交于 2019-12-23 19:53:24
问题 The following code: If FileExists(XCustPath + "XCust.dat") Then XCustRun End If and this code: Public Function FileExists(ByVal Fname As String) As Boolean Dim lRetVal As Long Dim OfSt As OFSTRUCT lRetVal = OpenFile(Fname, OfSt, OF_EXIST) If lRetVal <> HFILE_ERROR Then FileExists = True Else FileExists = False End If End Function XCustPath points to a mapped network location with the file XCust.dat inside it. But on the line: lRetVal = OpenFile(Fname, OfSt, OF_EXIST) It takes forever and

Is there a VB6 function analagous to C's sscanf?

▼魔方 西西 提交于 2019-12-23 18:35:28
问题 I'm trying to read in a file consisting of lines of text of the following sort of form... first value 1352.2 second value 12 third value 32323 first value 1233.2 second value 22 third value 23333 first value 1233.1 second value 21 third value 64344 so I'm looking for a function analagous to fscanf or sscanf to munch each line up in one go. Is there such a function or must I pick apart each line by hand (there are several different kinds of lines). 回答1: While MarkJ has given you the VB6 way of

Why is my VB6 variant changing depending on when it is assigned?

不羁的心 提交于 2019-12-23 18:15:55
问题 I am new to VB6 (and visual basic in any form) development and I've come across a problem. There may be lexical errors below because I formatted the code to be a little more readable inside of the post here, but the essence of the question remains. Here is the code My problem is that the values displayed by the MsgBox calls (the second set of them, the ones that reference the variables scrWord and resWord) differ depending on when I assign to the variables scrWord and resWord. If I assign to

VB6/VBA Do not Allow COM Add-In to load

心不动则不痛 提交于 2019-12-23 17:59:22
问题 I have a VB6/VBA application that hooks into Excel and loads a workbook. It has been working great for many years. We have now upgraded to Excel 2010 and have ran into some issues. After troubleshooting it seems that if i turn off the PowerPivot COM Add-In the process is able to run as it did before with no issues. While I look for the exact cause of this i wanted to see if i can turn off that Add-In just for my app. I load up Excel like this: Set xlApp = CreateObject("Excel.Application")

How to Generate a well formatted XML file using VB 6.0?

我与影子孤独终老i 提交于 2019-12-23 16:44:59
问题 I'm working on Visual Basic 6.0 Project and i need to generate a well formatted XML file whose looks like this: <Myinfo> <FirstName>My First Name</FirstName> <LastName>My Last Name</LastName> <StreetAdd>My Address</StreetAdd> <MyInfo> Note: i got the job done generating the XML file, but i'm still in need for the right formatting as shown above. The XML file i generated is formatted like in one single line like this: <Myinfo><FirstName>My First Name</FirstName><LastName>My Last Name</LastName

Intermittent SQL Server ODBC Timeout expired

懵懂的女人 提交于 2019-12-23 16:36:54
问题 We have a bunch of VB6 applications that access two different database servers (both 32-bit windows 2003, one SQL Server 2000, one SQL Server 2005). About every ten minutes or so, we are getting a few errors: [Microsoft][ODBC SQL Server Driver]Timeout expired [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. [Microsoft][ODBC SQL Server Driver]ConnectionRead() This is happening on more than a dozen different computers at random times. We also have IP

listview with multiple imagelist and icons/image

笑着哭i 提交于 2019-12-23 15:44:15
问题 i need a way to use two imagelist on a listview. one of the image list if for header icons which contain 16x16 icons, and another will contains 32x32 thumbnail pictures within the sub items. The image below shows what am trying to do 回答1: i found a trick which solves the issue. the trick is to create a 16x16 icon on a 32x32 canvas and center it. this is because the thumbnail size is 32bit max. so i have one image list for 16pix isonc and another for 32pix icons when thumbnail is needed, i