vb6

How can I get the name of a Visual Basic control given its HWND?

孤街浪徒 提交于 2019-12-24 02:59:36
问题 I'm working on a little macro record/replay tool which can automate a few very old Visual Basic 6 GUIs we have. To do so, I'm identifying the controls by their name (the value of the name property of a control, that is). One part of this tool needs to determine the name of a control given its HWND. For newer Visual Basic applications which were done using VB.NET, I can use the WM_GETCONTROLNAME window message. This works nicely. However, this message is not understood by older windows. Is

Changing the location of an existing VBA Reference from C:\Windows\system32\ to a shared drive

老子叫甜甜 提交于 2019-12-24 02:17:05
问题 I've been trying for a while now to get a reference file to be loaded externally to no avail. To be specific I am trying to load a "Microsoft Date and Time Picker Control 6.0(SP4)" which usually resides in C:\Windows\System32\MSCOMCT2.OCX However some people that run a macro containing this element don't have that "MSCOMCT2.OCX" file on their PCs so I thought I will move the MSCOMCT2.OCX to a shared location and reference the code to use the shared one instead (so everyone will have access to

How can I send an e-mail from a vbs script

妖精的绣舞 提交于 2019-12-24 02:16:45
问题 How can I send an e-mail from a vbs script - on a machine that cannot connect to the internet (it's in my non-internet zone). I've hacked the following together from my googling, but is seems to require a call to Microsoft's server. What about the situation where I'm not able to reach microsoft.com? sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(sch & "sendusing") = 2 ''cdoSendUsingPort .Item(sch &

How to delete VB code from an Excel sheet using C#?

心不动则不痛 提交于 2019-12-24 02:00:58
问题 Does anyone know how to delete all VB code form an Excel workbook using C#? This code doesn’t work. It removes first (last one) VBComponent, but rises ArgumentException on second one. VBProject project = workbook.VBProject; int componentsCount = project.VBComponents.Count; for (int i = componentsCount; i >= 1; i--) { VBComponent component = project.VBComponents.Item(i); project.VBComponents.Remove(component); } Any suggestions? :) 回答1: I solved it with Sam's help. I suspect that each Excel

VB6 killing timers

夙愿已清 提交于 2019-12-24 01:01:33
问题 I'm programming in VB6 because we are using legacy code and hardware (external electronics). My programs are build around timers where I would use tasks in OS programming. The timers are running until their job is done. A flag is set and another timer is started. I want a supervisory timer that controllers the other timers When the timers produce no result or are waiting for a real world event that never comes (Do while loop) I want to kill the timer. In electronics we have a 'watch dog timer

Using Sax parsing to edit and write XML in VB6

社会主义新天地 提交于 2019-12-24 01:00:00
问题 So I am trying to edit an xml (output is an xml) using SAX parsing in VB6 (for an ancient COM component). I would prefer to use DOM parsing but the size of the xml (over 20MB's potentially) forces me to use SAX. I am relatively new to VB6 and I have no experience in SAX parsing. I have looked around online but even the best resource I have found (http://www.developerfusion.com/article/84405/sax-and-vb-6/) gives me little insight into how to combine grandchilren tags with existing attributes

Calling DLL functions from VB6

微笑、不失礼 提交于 2019-12-24 00:49:22
问题 I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installed. What could be the problem? I've declared all my public functions as follows: #define MYDCC_API __declspec(dllexport) MYDCCL_API unsigned long MYDCC_GetVer( void); . . . Any

How evaluate concatenated string as indexed XPath expression in VB6

妖精的绣舞 提交于 2019-12-24 00:48:45
问题 I've built an Xpath expression by concatenating strings in VB6: strXPath = "xDOC.selectNodes(" & """/GroupType1""" & ").item(" & CStr(i) & ").selectNodes(" & """/OperationStageCollection/OperationStage""" & ").length" "i" is an integer used to index into I want to evaluate strXPath to get a loop counter, for example: n = CInt(strXPath) n is declared as Integer; strXPath is declared as string. VB6 throws a Type Mismatch error on the above evaluation expression. I must be missing something

Force date to US format regardless of locale settings

若如初见. 提交于 2019-12-24 00:48:24
问题 I have a VB6 program with this line: strDate = Format(Date, "ddmmmyyyy") I need it to always come out in this format according to the Cultural settings for Windows for English (United States): 17Jul2012 Unfortunately when the culture is set to something else, French, for example, I get this: 17juil2012 Is there any way to make the date format always use the English US formatting? 回答1: Rather than mess about trying to enforce a culture-specific format, why not just hard code the month names

How can I use a VB6 COM 'reference' in IronPython?

我们两清 提交于 2019-12-24 00:28:48
问题 I'm currently developing what is more or less a script that needs to get some data from a VB 6 COM dll. This dll is currently used in a MS Word VBA project, and it exports classes, etc to the VBA code. It is added in the Tools -> References menu in the VBA editor, and I can see it's classes in the object browser of VBA. From my readings, it is possible to use a VB6 COM library in VB.NET (or at least, it is supposed to be able to.) As it should be possible in VB.NET, and since .NET runs on the