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

Focusing an effect in a tab

$
0
0
So, I've been working in a web-browser, However, There is an issue I am facing, I am using AxWebBrowser (Microsoft Web Browser) however, I wanted to make a history function, It is going well, And I am new to Visual Basic, Or anything related to Coding Languages, But however, I want a button that navigates the browser to one of the sites, As a result, I am using Listbox, To list the history, The history loads well, However, Going back to the site already visited, Isn't going well..

So, I am using the following code..
Code:

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        tab.AxWebBrowser1.Navigate(Me.listbox1.SelectedItem)



When I press the button, It navigates me no where.

So I tried using
tab.AxWebBrowser1.Navigate("http://www.facebook.com")

And for a mysterious reason, It also didn't work, I suspected that this problem because I am in a tabbed browser, And it doesn't know which tab should it navigate in, So, Is there is a way I can focus the effect of the Navigation code on the Current tab?

Or, If possible, Is there is a solution for the navigation problem if it is not a tab problem?

Thanks in advance, And I apologize if I posted in the wrong section, I am a complete newbie to coding and such..

Font dialogue box

$
0
0
I'm trying to avoid using the CommonDialog box and by trawling the web I have succeeded in finding ways round it for Open, Save, Colour and Print. Only one remains. Can anyone help me find an alternative Font dialogue routine?

[RESOLVED] Can this Loop be made any Faster?

$
0
0
Hello,

Just going through my code & trying to optimize some stuff.

Can anyone think of a faster way of executing this?


Code:

Dim newArr()          As Byte

''
''
ReDim newArr(0 To fLen + 1)
For xIndex = 0 To fLen Step 2              'we're swapping pairs
  If (xIndex + 2) > fLen Then Exit For    'Prevent Overflow
  newArr(xIndex) = oldArr(xIndex + 1)
  newArr(xIndex + 1) = oldArr(xIndex)
  DoEvents
Next xIndex

how the input format to date hours minutes seconds oracle from vb6

$
0
0
I have an error when the input date hours minutes seconds to oracle from vb6 . the error is:
date format picture ends before converting entire input string
strdate = Format ( TGLMASUK , "dd - mmm -yyyy hh : mm : ss " )
TGLMASUK = " 01-09-2014 09:22:32 "
if anyone can help ?
thank you

:thumb:

VB6 Subclasser issue

$
0
0
I used Paul Caton and LaVolpe cSelfSubHookCallback for few years,Most of time is is fine but I recently found it has 'Unicode' issue.
I had two obvious evidences.
1st: I can't get Unicode Char from IME (Refer to 785175) if I use cSelfSubHookCallback. But The subclass I extract from Krool (698563) work just fine. I can get right Unicode Char.

2nd. Furthermore, for verification, I replace Krool's Subclasser in CommonControls with Lavolpe's cSelfSubHookCallback, I can't get Kazakh Char and double unicode issue.

So I decided to stick to Krool's Subclasser But Krool's Subclass also give me headache. The exact same code, cSelfSubHookCallback works fine but Krool's failed. Evidence:

I want to fill my brush into Edit Control using WM_CTLCOLOREDIT message

Code:

'In UserControl_ReadProperties:

    Set subclasser = New cSelfSubHookCallback
    subclasser.ssc_Subclass UserControl.hWnd, 0, 1, Me
    subclasser.ssc_AddMsg UserControl.hWnd, MSG_AFTER, WM_CTLCOLOREDIT, WM_CTLCOLORSTATIC

'In Subclass Procedure:
    Select Case uMsg
                                     
      Case WM_CTLCOLOREDIT
            Call pvOnCtlColorEdit(wParam, lParam, lReturn)
      Case WM_CTLCOLORSTATIC
            Call pvOnCtlColorStatic(wParam, lParam, lReturn)
    End Select

cSelfSubHookCallback is OK.Always Fill colors when I am typing. But Krool's failed, the first time fill right, but next time fill with whitecolor:

Code:

Call ComCtlsSetSubclass(UserControl.hWnd, Me, 1)
Select Case wMsg
                                     
      Case WM_CTLCOLOREDIT
            Call pvOnCtlColorEdit(wParam, lParam, WindowProcUserControl)
            Exit Function
      Case WM_CTLCOLORSTATIC
            Call pvOnCtlColorStatic(wParam, lParam, WindowProcUserControl)
            Exit Function
    End Select
    WindowProcUserControl = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)

So,what is the solution for right Subclasser?

Edited:
Comparison:
1. Krool's Subclass : Don't have bHandled flag, Just use Exit Function to skip defProc.
2. Krool's Subclass : no need to AddMessage
3. The sequence of multi-Subclassers are opposite,The last Proc is the Last Proc.
4. The proc is Function vs Sub with lReturn
5. cSelfSubHookCallback can remove Message at any time But Krool's Subclass need to remove yours Proc.
6. Krool's Subclass use Implement
7. Krool's Subclass doesn't have MSG_BEFORE and MSG_AFTER (May this is the reason???)

For my case (TextBox + ListBox -->ComboBox,when I click button to bring out ListBox,click an item then hide listbox), Look like Krool's Subclass can't 'detect' WM_CTLCOLOREDIT properly (My debug Window shows only 3 times after the uc show and a Click,then no more trigger). But cSelfSubHookCallback keep triggering (6 times total,every click -show Listbox and hide listbox,has 4 times). What is wrong with the Subclasser or my miss usage?
Attached Images
 

Clone a UDT of Variable Size?

$
0
0
Hello,

I have a pretty large UDT. Lets call this myUDT.
When i clone this

tmpUDT = myUDT

From time to time this does NOT get cloned :/
I have an empty UDT!!!!!

If my memory servers me correct then, I remember that the copyMemory API is not good with variable sized UDTs?

Are there any workarounds ?

MsComm1 stopped working on all programs(solved)

$
0
0
Hi guys,

I stumbled on something strange.
All my programs that use MSComm1 to read data from an Arduino stopped working.
They do not receive any data anymore.
I checked Arduino by serial monitor and used Putty and confirm all data is received by those two programs.
I checked and use the same serial ports as the Putty program.
I tested on XP and Windows 7 PC but all same problem.
Code has not changed.
For the programming I make several versions incrementing in number but the older versions have same problem where they also worked before.
Normally in the immediate screen I can see if there is any problem with wrong data transmition.
But the this screen stays empty.
Also the programs that are converted to exe files behave the same way.

Any one an idea how I can determen what goes wrong.
I already undressed one program to have only send the data to a label.
Not working either.
It must be something with the Mscomm1 but no idea how to tackle.

Can it be an Windows Update causes this problem?

Thanks in advance, Paco

[RESOLVED] Clone a UDT of Variable Size?

$
0
0
Hello,

I have a pretty large UDT. Lets call this myUDT.
When i clone this

tmpUDT = myUDT

From time to time this does NOT get cloned :/
I have an empty UDT!!!!!

If my memory servers me correct then, I remember that the copyMemory API is not good with variable sized UDTs?

Are there any workarounds ?

[RESOLVED] Missing .frm file

$
0
0
We recently discovered that the .frm file for one of our VB6 projects is missing.
We have searched extensively for it but it cannot be found.
We have the .vbp, .vbw, and .exe files, but not the .frm.
Does anyone know any way to recover the .frm file, or perhaps create a dummy .frm file?
I can rebuild the project if I can just gain access to the code.
I have a source code listing but would sure like to find a way to rebuild this without having to type it all in from scratch.
So far I have been unable to even determine where the source code is stored.
Thank you.

Where is the problem ??? format string

$
0
0
I will not that the code below
shall count up or down
Code:

For lngIndex2 = 1 To ListView1.ListItems.Count
        lngTot2 = lngTot2 + ListView1.ListItems(lngIndex2).SubItems(5)
  Next
      Text10.Text = Format(lngTot2, "###0.00")

if I have say 83.67 in a listview
then in the text10.text shall
be the same amount no differens
text10.text = 83.67

Bonzo2008

Help Needed with conversion to .Net

$
0
0
I wrote an mp3 player in VB6. I used to be a professional OS writer. No one has been successful with a conversion effort yet. The last time a vb6 image was successfully built was 2005. I do not remember what the version of Windows was. I do have the vb6 sources. Somehow mscomctl.ocx seems to be involved in the conversion errors.

It would mean much to me to convert the mp3 player to .Net. But when I went to install VB6 it never stopped running from disc 1 on the Windows 64 bit preview and I know the trick with java.

I need help with conversion which is both complex and straight forward. I've been a pedestrian hit by a car since then.

Renee

Something is holding my process

$
0
0
My VB6 program uses some ActiveX, timers...
If I try terminate my program, something is holding my process.
How could I find which ActiveX or timer is holding?
Is there any tool to find it in the Visual Studio6?

Thanks in advance.

How to display a dialog printer before displaying a datareport

$
0
0
i am trying to display a datareport but before that i want to choose a printer to do that
is this the right way?
Code:

FrmMainMenu.dlgCommonDialog.ShowPrinter
Set DAdvancedSmsSend.DataSource = CN.Execute("SELECT * FROM SmsLogs Where SmsLoginName = '" & RplS(Cz.Text) & "' order by SmsDate")
      DAdvancedSmsSend.Show 1 > ' DataReport'

need some help please
salsa31

VB6 Call a COM DLL 64 bits

$
0
0
Hi

I have a big issue.
In the VB6 App (32 bits), I need to make a call to a 64 COM DLL.

I know this is impossible, but I am certain that a workaround should exists.

Like a small app in .NET that could call to this COM DLL, and that could communicate with the VB6 App.
Or something like this.

Does someone had such problem in the past?
I am also searching on my own.

Thanks in advance

[RESOLVED] Where is the problem ??? format string

$
0
0
I will not that the code below
shall count up or down
Code:

For lngIndex2 = 1 To ListView1.ListItems.Count
        lngTot2 = lngTot2 + ListView1.ListItems(lngIndex2).SubItems(5)
  Next
      Text10.Text = Format(lngTot2, "###0.00")

if I have say 83.67 in a listview
then in the text10.text shall
be the same amount no differens
text10.text = 83.67

Bonzo2008

[RESOLVED] How to display a dialog printer before displaying a datareport

$
0
0
i am trying to display a datareport but before that i want to choose a printer to do that
is this the right way?
Code:

FrmMainMenu.dlgCommonDialog.ShowPrinter
Set DAdvancedSmsSend.DataSource = CN.Execute("SELECT * FROM SmsLogs Where SmsLoginName = '" & RplS(Cz.Text) & "' order by SmsDate")
      DAdvancedSmsSend.Show 1 > ' DataReport'

need some help please
salsa31

parsing data from textfile to vb ( i pay money for anyone who can do this)

$
0
0
so im trying to avoid sites like freelancer where u find indian noobs cause i meet some pro programmers here
i have this project, i need to parse data from text file into vb
i would like to discuss about project in private..
i am ready to pay $100 for anyone who can write the code for me
send me your skype id or any mean of online chat so we can discuss about project :)
my skype: pblastz

Need Help to Make Download Manager

$
0
0
Hello all,


i want to make a download manager(copying software) to copy files from a vpn network.
i belong from aeronautical department and i don't have any academic knowledge in VB.


Problem: we have a destination directory (in remote).where required files are maintained(files added daily) by their name in folder format. in those folders one .zip file is present. we need to download those required zip files.
we have an existing download manager where we type the name of the cases(name format: DQJL0****, first two stars numeric and second two alphabet ) one by one at a time and hit ENTER, after that download starts. but the tool doesn't show progress bar or download speed. and also we can not pause or resume.


i need to make such an application manager that shows progress bar and download speed and if possible resume and pause facility.


Please help me out.


Thanks and Regards
Sachin

C# vs VB6: How to get IME Unicode Char associated with an ANSI Window (UC or Form)

$
0
0
In VB6,UserControl or Form or PictureBox is ANSI window in locale English 1033 (configurable in Region and Language settings). I see wParam is always 63 (Char '?') in WM_IME_CHAR or WM_UNICHAR or WM_CHAR when I am typing Unicode via MS IME or Baidu input.

For Comparison, I creates a SDK TextBox, used by CreateWindowExW API, IsWindowUnicode API shows it is Unicode window, Since it is Unicode Window, I can see wParam is Unicode Keycode When I subclass WM_IME_CHAR and WM_UNICHAR and WM_CHAR. So I can get Unicode Char easily.

The same code in C# works with whatever locale either 1033 (English USA) or 2052 (Chinese PRC), since C# window is always Unicode.

I guess OS deal with ANSI window and Unicode Window is different. What is the work-around to get IME Unicode Char?

Code:


//C# Code
protected override void WndProc(ref Message m)
  {
    int msg = m.Msg;
    if (msg == WM_IME_SETCONTEXT) //associated IME with our UserControl
      {
        if (!m.WParam.Equals(IntPtr.Zero))
          {
          bool flag = ImmAssociateContextEx(m.HWnd, IntPtr.Zero, 16);
          IntPtr hIMC = ImmGetContext(m.HWnd);
          flag = ImmSetOpenStatus(hIMC, true);
          flag = ImmReleaseContext(m.HWnd, hIMC);
          }
        }
    }
    else
    if (msg == WM_IME_CHAR) //Intercept Message to get Unicode Char
      {
        KeyPress(this, new KeyPressEventArgs(Strings.ChrW(m.WParam.ToInt32())));
        return;
      }
    }
  base.WndProc(ref m);
}

'In  Subclass Procedure for VB6 UserControl:
Private Function WindowProcUserControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  Select Case wMsg
    Case WM_IME_SETCONTEXT '//associated IME with our UserControl
        If Not wParam = 0 Then
            Dim flag As Boolean
            flag = ImmAssociateContextEx(hWnd, 0, 16)
            If flag Then
              Dim hIMC As Long
              hIMC = ImmGetContext(hWnd)
              flag = ImmSetOpenStatus(hIMC, True)
              flag = ImmReleaseContext(hWnd, hIMC)
            End If
        End If
    Case WM_IME_CHAR '//Intercept Message to get Unicode Char
        Call KeyPress(ChW$(wParam And &HFFFF&))
        Exit Function
  End Select
End Function

Rotate Textbox

$
0
0
I am working in vb6...windows 8

This code works good under a button click but i need it to save where I stop it and then move again when i do another button click.
Can anyone help?? Thank you.


Private Sub Command1_Click()
Dim LB As Integer, UB As Integer
Dim i As Integer, sText As String

With txtbox
LB = .LBound
UB = .UBound
sText = .Item(UB).Text

For i = UB To LB + 1 Step -1
.Item(i).Text = .Item(i - 1).Text
Next

.Item(LB).Text = sText
End With


End Sub
Viewing all 21256 articles
Browse latest View live


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