vb6

How to do “Public Declare Ansi Function” in Visual Basic 6.0?

眉间皱痕 提交于 2019-12-25 01:19:31
问题 I'm trying to convert this VB.NET / C# declaration into a Visual Basic 6.0 one, having trouble (included is the C# version, converting to VB.NET not a problem): [DllImport("urlmon.dll", CharSet = CharSet.Ansi)] private static extern int UrlMkSetSessionOption( int dwOption, string pBuffer, int dwBufferLength, int dwReserved); As you can see, in Visual Basic/C# we have that CharSet=CharSet.Ansi part, which I don't know how to do in Visual Basic 6.0 - I tried adding the A at the end of the Alias

How can I programatically print a DataReport to a pdf file?

a 夏天 提交于 2019-12-25 01:16:03
问题 I'm updating old VB6 code to save its DataReports out to a PDF, rather than bringing up a print dialog. I cannot simply write the PDF within the code (using a VB6 PDF library, etc.), since all our software already uses DataReports, and writing print code for each one would be tedious, at best. Currently, the process requires an employee to print the DataReport to a PDF print driver, naming it manually and saving it to where it needs to go. I need to automate this all, so that the name and

Run a batch program(.bat) through a Visual Basic 6.0

一世执手 提交于 2019-12-25 01:09:00
问题 I want to run a batch program(.bat) through a Visual Basic 6.0 application and also want to print the output of the batch program(.bat) in the Visual Basic 6.0 application. I want to execute the dir command in the batch file so that VB6.0 application can print the output in a text box. VB6.0 code: Dim com As String Dim wshThisShell Dim lngRet As Long Dim strShellCommand As String Dim strBatchPath As String Sub C0ding() Set wshThisShell = CreateObject("WScript.Shell") strBatchPath = "C:\first

Spurious “cannot load control, license not found” error?

ぐ巨炮叔叔 提交于 2019-12-25 01:06:14
问题 When I try to load a form in the designer, it shows "runtime error 0" and produces a log file which contains: Line 15: Cannot load control xxxx; license not found. But the control in question DOES NOT have any licensing restrictions . It has no installer and requires only registration (regsvr32). Not only that, but for years this had worked without any problems and only just recently this has started. It affects a number of forms which have any controls from a particular OCX. So it appears

Testing Active X DLL - runtime error 91 object variable or With block variable not set

强颜欢笑 提交于 2019-12-24 20:03:17
问题 I created a skeleton Active X DLL with its Instancing property set to MultiUse and only one function which does nothing but pop up a message box saying that it has been called. Then I created a test program and added the DLL to its References. I added code to declare a variable of the DLL's Classmodule, to create a new object and to call the function. In all cases I used Intellisense code completion, so VB6 certainly about the DLL and it's class & method. However, when I run the tester it

Visual Basic 6 and UTF-8

Deadly 提交于 2019-12-24 19:53:16
问题 currently I have a ancient VB6 procedure that open text file as follow Public Function ApriFile(sFile As String, iCanale As Integer) As Boolean On Error GoTo ApriFileErr ApriFile = False NumberError = 0 sErrore = "" Close #iCanale 'Apertura archivio di input Open sFile For Input As #iCanale ApriFile = True Exit Function ApriFileErr: ApriFile = False 'Errore nell'apertura del file If Err.Number <> 0 Then NumberError = Err.Number sErrore = Err.Description End If End Function How can use the

What could cause Run-time error 1012 Error accessing application data directories

删除回忆录丶 提交于 2019-12-24 19:34:02
问题 Friend of mine has a problem :). There is an application written in Visual Basic 6.0 (not by him). One of users reported that when it run on Windows 2000 and tried to scan folders on disk it raised box with message: Run-time error 1012 Error accessing application data directories We couldn't google anything about it and didn't find anything about runtime error 1012 in VB6 help files. My guess was that VB calls some old API function which returns folder to which app has no access (private,

VB6: “Visual basic has stopped working”

巧了我就是萌 提交于 2019-12-24 15:27:24
问题 I have a problem with my microsoft visual basic 6 ide, as it's giving me "Visual basic has stopped working" error, from the very start when trying to open my vb project. It is not a code related problem as the same error pumps out when trying to open a perfectly good older working project. Also, trying to open the ide, in order to create a new fresh project, that it lets me. The problem appeared, when, while debugging project code, I stopped it (closed the ide) without pressing the stop

Compiling a VB6 COM DLL through command line gets a different CLSID each time

血红的双手。 提交于 2019-12-24 15:14:01
问题 Let dllproject.vbp be a DLL VB6 project. Each time i compile through this Line : VB6.EXE /MAKE dllproject.vbp /outdir somedir The compiler produce a dll with another CLSID. Why ? (EDIT) 回答1: Found why here. In a few word, binary compatibility must be activated. A good way is to keep a copy of the dll (renamed .cmp) for example and reference this copy for version compatibility (Project -> [project name] properties.... 来源: https://stackoverflow.com/questions/34681408/compiling-a-vb6-com-dll

My client/server program created in vb6(winsock) dont work on WAN but perfectly works n LAN Why?

只愿长相守 提交于 2019-12-24 12:55:14
问题 I've created a simple client/server program with the help of winsock in vb6. It perfectly works on LAN but the problem is it doesn't work on WAN. All ports are already open, Firewall is already Off, I have dynamic IP so I used No-ip to get named IP address. One more think I want to ask is , is it important to open port on both client and server? For eg- I've created the program on port 50505 and on the client computer the port is open but is it important to open 50505 on server also?? Here is