Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21630 articles
Browse latest View live

VB6 in Windows 10: Mouse-dragging markers get stuck on desktop

$
0
0
I'm using VB6 in Windows 10 (yeah, I know it's old school, but VB6 is what I know and have been using for years, and it mostly works okay in Windows 10.)

With VB6 in Windows 10, there is a problem with dragging objects around on a form with the mouse. This is described in the topic "VB6 under Windows 10: I've lost mouse dragging outline." When dragging objects around on a form the objects disappear until you release the mouse.

Somewhere along the line I found somewhat of a fix for this - I think it had something to do with using Windows XP Compatibility Mode - but after working on a project session for a while I lose the outlines again. Closing the VB6 editor and then restarting it restores the functionality of the mouse-dragging outlines again for a while.

This is annoying but I can live with it as the price of using VB6 in Windows 10, which doesn't like VB6 very much!

But even more annoying is that after using the mouse to select an area with multiple objects on the form so I can drag all the selected objects around together, VB6 puts the mouse-dragging anchor marks semi-permanently on my PC desktop. (See picture attached illustrating what I mean.)
Name:  Desktop_with_VB6_anchors.jpg
Views: 64
Size:  79.0 KB

Closing the VB6 editor doesn't remove the marks from the desktop. Changing the desktop background picture doesn't help either. Clicking the "Show Desktop" portion at the bottom-right of the desktop doesn't help. The anchor marks remain on the desktop for up to 24 hours and then disappear, or I can get rid of them by rebooting the PC.

It's not a big deal, just a nuisance, but I wonder if anyone has a solution to this problem or any suggestions?

I suspect that the answer to my question is "This application is known to have compatibility issues and is not recommended for use with Windows 10. To avoid weird problems, try using a more modern version of Visual Studio instead, dummy!"

Or, the solution is probably so technical that it's not worth even messing with it?
Attached Images
 

Help me create manifest for using MSWINSCK.OCX in my program.

$
0
0
I heard there's a way you can make it so that you don't need to register OCX files and ActiveX DLL files on the end-user's computer (and therefore make the program portable, without need for an installer). I've heard this involves creating a manifest file in the form of ProgramName.exe.manifest as the file name. The file is an XML file with all the info needed to make the OCX (or ActiveX DLL) work with your program. In my case, my program is called TCP Communicator, and it uses MSWINSCK.OCX. The name of the manifest file is "TCP Communicator.exe.manifest" and its contents are
Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <assemblyIdentity name="TCP Communicator" processorArchitecture="X86" type="win32" version="1.0.0.0" />
    <file name="MSWINSCK.OCX">
        <typelib tlbid="{248DD890-BB45-11CF-9ABC-0080C7E7B78D}" version="1.0" flags="control,hasdiskimage" helpdir="" />
        <comClass clsid="{248DD896-BB45-11CF-9ABC-0080C7E7B78D}" tlbid="{248DD890-BB45-11CF-9ABC-0080C7E7B78D}" progid="MSWinsockLib.Winsock" threadingModel="Apartment" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
    </file>
</assembly>

This was automatically generated using a tool I downloaded called UMMM (Unattended Make My Manifest), which takes all the work out of finding the required GUIDs in the registry, and completely generates the manifest file for you without you having to type any lines of XML code. I'm not 100% sure if this tool works though, because this manifest is NOT letting me use MSWINSCK.OCX in my program. Testing it on a computer without the OCX file already registered, results in my program generating an error about the OCX file not being registered (apparantly ignoring the manifest file). So the manifest file is somehow broken, either because UMMM doesn't work properly, or because I don't know how to use it.

Can somebody take a look at the above XML code that I pasted from the manifest file, and verify if it is in fact correct?

Typeof

$
0
0
I have a form that has 16 textbox's not visable and depending on how questions are answered
it will display anything from 2 to 16 in pairs I want to be sure that the user has input a value
so I tried this code but ctl does not show a value

For Each ctl In frmAddSpec.Controls
If TypeOf ctl Is TextBox Then
if ctl.Value > 0 Then bComp = True
End If
Next

All declarations have been made elsewhere
Can you help

New Win10 development machine, VB6 IDE "mostly" going fine, but...

$
0
0
Hi All,

Well, I finally broke down and bought a new development machine this weekend, with the latest Win10 of course.

With a thorough review of my notes, and some liberal use of the metaphorical sledge hammer, the VB6 IDE is pretty much up and running.

Just as an FYI for others, the "tricks" I've found are:
  • Place a zero-byte MSJAVA.DLL in the C:\Windows folder.
  • When installing, don't install the ADO stuff, even though the installer issues a warning about it.
  • Definitely install VB6 SP6 (and I also installed a couple of other KB releases).
  • Set compatibility to Windows Vista SP2 on the VB6.EXE.
  • As a further FYI, the mscomctl.ocx and mscomct2.ocx seem to be working just fine.


But I do have one problem. I've lost my selection box. Here it is on my old Win7 computer:

Name:  Drag.gif
Views: 38
Size:  7.8 KB

And then, when I finish dragging the box over the controls, I don't get my selection handles. Here those are on my Win7 computer:

Name:  Sel.gif
Views: 28
Size:  7.3 KB

What's interesting is that they are actually selected on the new Win10 computer. I just can't see what I'm selecting, and I can't see what I've selected when I'm done.

Anyone have any ideas?

Thanks,
Elroy
Attached Images
  

VB6 Encryption & Decryption

$
0
0
Hi Members of VB forums,

I am new in the VB6 developping, and i am from a french spoken country so excuse my english if it's bad.
i came wanted to build a little program that can do encryption and decryption in VB6 and Asp but i have some problems to make it work. the promgrams uses ASCII switch to mixed caracters just like it is shown here : http://www.sourcecodester.com/tutori...using-vb6.html
Code:

        Private Sub Command1_Click()
        Text2.Text = Encrypt(Text1.Text, Len(Text1.Text))
    End Sub
   
    Public Function Encrypt(Name As String, Key As Long) As String
    Dim v As Long, c1 As String, z As String
        For v = 1 To Len(Name)
            c1 = Asc(Mid(Name, v, 1))
            c1 = Chr(c1 + Key)
            z = z & c1
        Next v
        Encrypt = z
    End Function
   
    Private Sub Command2_Click()
        Text2.Text = Decrypt(Text2.Text, Len(Text1.Text))
        Text1.Text = ""
    End Sub
   
    Public Function Decrypt(Name As String, Key As Long) As String
    Dim v As Long, c1 As String, z As String
        For v = 1 To Len(Name)
            c1 = Asc(Mid(Name, v, 1))
            c1 = Chr(c1 - Key)
            z = z & c1
        Next v
        Decrypt = z
    End Function

but i want to use my own encryption that will give :

123456789 = Qj>:i5&F:LaGYXuyxr

abcdefghij = Luvwi5zn>:Kw?6wtg:,,

0123456789 = A/uy&Fi5&F:LaGYXuyxr

1234567890 = ZV=?d@D)|i3kBo(l/e&gt;a

i have seen from some websites that the encryption and decryption goes like here :
Code:

function encrypt(ecode)
Dim texts
dim i
for i=1 to len(ecode)
texts=texts & chr(asc(mid(ecode,i,1))+i)
next
encrypt = texts
end function

function decrypt(dcode)
dim texts
dim i
for i=1 to len(dcode)
texts=texts & chr(asc(mid(dcode,i,1))-i)
next
decrypt=texts
end function

function mistake(preString)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
for i = 1 to length
seed = int(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
next
dim dist
dist=""
for i = 1 to len(texts)
if mid(texts,i,1)<>"'" then
dist=dist+mid(texts,i,1)
end if
next
mistake = dist
end function

So i am asking how can i put this into the codes i post above that will give encryption and decryption into a text box in vb6 so that when i type '123456' it will give this 'Nqo(&FZV|ixr' in the encrypted text box, and when i click decrypt it will give the '123456'
I have tried but now luck.
i am a computer techncian and i am new into programmming stuffs. any help is welcome
Thanks.

Compatibility

$
0
0
Hello,
I'm in the process of upgrading my VB6 computer from a Windows 2000 to Windows Vista. Will applications compiled in Windows Vista work on XP and 2000?

Thanks

Windows 10 Version Issue.

$
0
0
Microsoft says GetVersionEx is deprecated for releases after Windows 8.1, so I decided to go directly to the registry to get the information. According to Microsoft:
Windows Vista - Version 6.0
Windows 7 - Version 6.1
Windows 8 - Version 6.2
Windows 8.1 - Version 6.3
Windows 10 - Version 10.0

But when I look up the value for CurrentVersion under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion for Windows 10, I find "6.3". Does anyone have an explanation for this?

J.A. Coutts

Need help with school project

$
0
0
Hey there,
At school my teacher gave me vb project that we haven't studied yet... and of course i have no idea how do it.
The image updated below is the task.How can it be drawn any tips?
Attached Images
 

Load dll from memory ?

$
0
0
Hi all,

I was wondering if it is possible to load a dll from memory rather than from a file on disk.

Can the bytes of the dll file be stored in an array and then load the dll in the calling/current process from that array ?

I can't use the LoadLibrary API because it expects to be passed a file path in its argument.

A web searched came up with this https://www.joachim-bauch.de/tutoria...l-from-memory/

The code is written in C which I am not very good at .

Does anybody know if this can be done with calssic VB ?

Regards.

Instantly Proxy Change

$
0
0
After a long haul, hello everybody! I noticed that the proxies did not change instantly, although I tried a couple of things I saw on the forum. How can I change proxies immediately after I press the button on my program? Is there a way to do this without any error or don't went out internet or something? Thanks...

[RESOLVED] How to get RTF inner-format-text directly from the clipboard ?

$
0
0
Really sorry, I asked too many questions about clipboard. Now I need to get RTF inner-format-text(RichTextBox1.TextRTF) directly from the clipboard. Please see below:
Attached Images
 

Enumerate Selected Control while in IDE Design Mode

$
0
0
Does anyone have any clue how to enumerate the selected control(s) while in the VB6 IDE design mode? I don't care how. I'll work with anything.

It can be through the Add-In extensibility model, through API calls, within the same project or an independent project.

I'll settle for just those controls with a hWnd, but ideally I'd like to include labels, lines, shapes and any other "light-weight" control.

I suspect a deep-hacking of the clipboard could get it done (if I were willing to press Ctrl-C after the selection), but even that seem a dubious proposition.

Any Ideas?

Elroy

EDIT1: And by "selected", I mean those controls we've drawn a selection rectangle around and "selected".

[RESOLVED] Enumerate Selected Control while in IDE Design Mode

$
0
0
Does anyone have any clue how to enumerate the selected control(s) while in the VB6 IDE design mode? I don't care how. I'll work with anything.

It can be through the Add-In extensibility model, through API calls, within the same project or an independent project.

I'll settle for just those controls with a hWnd, but ideally I'd like to include labels, lines, shapes and any other "light-weight" control.

I suspect a deep-hacking of the clipboard could get it done (if I were willing to press Ctrl-C after the selection), but even that seem a dubious proposition.

Any Ideas?

Elroy

EDIT1: And by "selected", I mean those controls we've drawn a selection rectangle around and "selected".

Add-in for Win10 to get back multi-select handles, a problem...

$
0
0
Ok, my Add-In is coming along nicely. However, my typical AlwaysOnTop function no longer seems to be working.

Everything is working fine (so far) except for that. I've attached the entire project. To use it, compile to DLL, get out of that project, open another project (or a blank one), look under your add-ins and load the "Mark Selected Controls" add-in, then again under add-ins click the "My AddIn", then select some controls on a form and "Mark" them with the box on the top-left of your screen.

Everything is coming together but I can't figure out how to make them stay on top of the form we're designing.

Any ideas?

Thanks,
Elroy
Attached Files

Interesting code formats and code snippets.

$
0
0
When searching for clipboard info, I saw the following snippets. I suddenly feel that this code format is very interesting, it is JavaScript and Json style. I think, if VB6 also has such a script interpreter, then VB6's power will be greatly enhanced.

The following three functions are:

wx.setClipboardData(OBJECT)
wx.getClipboardData(OBJECT)
wx.connectSocket(OBJECT)
Attached Images
   

Problem with JSON

$
0
0
hi i have a webbroswer and i send a request via url, but the response is in JSON and the application prompts me to download the file instead of displaying it like chrome would, is there a way to store to response in a string or display it in webbrowser, ideally in a string though?

Obsolete OCX references in VB6 Project / Components list

$
0
0
I created an OCX but every time I compile it to implement a change it appears as a new listing in the Project / Components list, so I end up with a bunch of occurrences of the same OCX in the list and only one of them works.

Someone told me that compiling the OCX with the Binary Compatibility option On will prevent new references to the OCX from appearing in the Components list, but how do I get rid of the old / obsolete references which are still listed?

Is this a registry issue, and if so, should I use a registry cleaner? Everything I've heard about registry cleaners makes me leery of doing that. But I'm not very knowledgeable about registry operations and am hesitant to try to manually remove the old references to the OCX from the registry. Will Microsoft's old regclean be of any use here? I'm running the VB6 editor in Windows 10.

Any advice would be much appreciated.

A challenge, related to Add-Ins

$
0
0
Ok, I sort of asked this before, but I think I made it too complex. I'll just outline it in terms of a new project.

Here are the steps:
  1. Open the VB6 IDE.
  2. Start a new project (File/New) and select "Addin" from the New Project Options.
  3. Immediately add another form (Form1) to this Addin project (just a regular form).
  4. Maybe make this new form (Form1) smaller. It can be as small as you like.
  5. Open the frmAddIn's code window (not the new form).
    • Under the OKButton_Click event, it'll have some MsgBox code. Delete this, and replace it with "Form1.Show".
  6. Save it all somewhere. I just created a New Folder on my desktop.
  7. Compile the DLL (File / Make MyAddin.dll).
  8. Close this project, saving again if it asks.
  9. Open another fresh/new VB6 project. This time, just a Standard EXE project.
  10. Your new add-in should be loaded. To activate it, click My Addin under Add-Ins.
  11. Once activated, click the "OK" button on the My Add In form. This will load that Form1 we added.


Now here's the challenge. That Form1 from the Add In? I'd like it to always stay on top of whatever forms (i.e., designer forms, such as the Form1 from the Standard EXE) the Standard EXE project might have open. I've tried my typical "Always On Top" function. I've tried setting the parent to the desktop. I've tried setting the parent to the Standard EXE's designer form. Nothing seems to work.

Any Ideas?

Thanks,
Elroy

p.s. You can get this new Add-In out of the way by telling it not to load in the Add-Ins Manager. If you want to completely get it off the list, open RegEdit, go to HKCU\Software\Microsoft\Visual Basic\6.0\Addins, and then delete the "MyAddIn.Connect" key. If you're really a purist, you could also unregister the DLL with regsvr32 /u.

p.p.s. If you actually get into a debugging mode for the add-in, trying to do this, it helps if you set the add-in to not auto-load. To do this, double-click (open) the Connect (under Designers in the project window). And then, set Application Version to "Visual Basic 6.0". And then, under "Initial Load Behavior" select "None". To test with a Standard EXE, you'll have to load it each time, but it's still much easier to re-compile the Addin.dll each time for testing.

[RESOLVED] Array of controls

$
0
0
I am creating an array of controls on a frame. The array isI generated in code. The purpose of the frame is to be able to slide the frame up when he controls fill the frame giving me more room to add lines as needed. A vertical scroll bar is not needed as the scrolling is done in code.
The code is simple. The first of the controls are placed on the frame in design time. Then I use the Load control (next Index), Place the control, and make it visible. The problem is that the next row (index) of controls do not appear on the frame in the proper position. The new controls appear directly on the form with the position relative to the form coordinates, not the frame coordinates.
Can anyone tell me what I am missing?.

Thanks

justify TextBoxes

$
0
0
I made a function to justify the text in textboxes individually. So, user can right click on a text box and set the justification right, left, or center. I also have the 'default popup' turned off. So my own popup will appear. Works well, but, once the justification is re-set by user, the next time the textbox is right-clicked, the 'default popup' appears instead of mine.

So, I'm guessing I'm missing an API? Below is a line of code from an API I'm using.

Code:

OldWindowProc = SetWindowLong(Me.Controls("Text1.Text").hwnd, GWL_WNDPROC, AddressOf NoPopupWindowProc)
This code is in the Form Load, and a little different of one in Form Unload.
Viewing all 21630 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>