• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1513
  • Last Modified:

vb6 combobox and ssubtmr6.dll

I need to either find a memory leak in my program, or switch to a new control.  I'm using VB6 and I downloaded a autocomplete combobox control.  The control work perfect for what I want, but my program is crashing quite frequently.  Also, on a fresh reboot, the program is very fast.  After using it for a few minutes, it slows down a lot.  When it crashes, I get that memory referenced error.  The control uses the ssubtmr6.dll.  When it crashes, and I can see that it just accessed this.  I feel my problem has something to do with this, but I have no clue how to actually fix the problem.

Does anyone know if there are known issues with this dll?  I'm using version 1.1.0.3.

I would be willing to try a different combobox control if someone could reccomend one.  I cannot get the vb combobox to work for me.  It will not dropdown and do autocomplete.  I cannot get the onchange event to work properly either, which I also need.

Thanks in advance!!
0
Fraser_Admin
Asked:
Fraser_Admin
  • 16
  • 9
  • 8
2 Solutions
 
gecko_au2003Commented:
What about going to that website from where you got the control and see if they have any FAQ's or a support section ( ie emailing them and letting them know of the issue(s) you are having as I am sure they can update it to solve this and then you could use that control )

Other then that I would reccomend a search on www.pscode.com as I am sure there will be something on there you may find of use :) with regards to an auto complete combo box or something to that extent :)

I hope this is of some use to you, just I have not got much time so will wait and see if there are any other replys, other then that I will post back later and have a look around :)
0
 
Fraser_AdminAuthor Commented:
I will look on that site.  I did email the author sometime ago, and he said that there was not a problem with the control.  So now I'm looking for something that I can run that can help me steer towards the problem.  I'm not sure if there is anything out there or not that can do this.  My memory usage is not increasing.  It looks to me like it is just trying to reference memory that doesn't exist.  
0
 
danaseamanCommented:
Try this code with the Vb ComboBox:

Option Explicit

Private Sub Combo1_Change()
   Debug.Print "Combo1_Change", Combo1.Text
End Sub

Private Sub Combo1_KeyPress(KeyAscii As Integer)
   Dim i                As Long
   Dim iNewStart        As Integer
   Dim strTemp          As String

   'Figure out the string prefix to search for
   If Combo1.SelStart = 0 Then
      strTemp = Combo1.Text & Chr(KeyAscii)
   Else
      strTemp = Left(Combo1.Text, Combo1.SelStart) & Chr(KeyAscii)
   End If

   i = cboFindString(strTemp)

   If i <> -1 Then
      Combo1.Text = Combo1.List(i)
      'Set the text selection appropriately
      'for the suggested match
      Combo1.SelStart = Len(strTemp)
      Combo1.SelLength = Len(Combo1.List(i)) - Len(strTemp)
      KeyAscii = 0
   End If
End Sub

Private Function cboFindString(sFind As String) As Long
   Dim i                As Long
   cboFindString = -1 'default(no match)
   For i = 0 To Combo1.ListCount - 1
      If InStr(1, Combo1.List(i), sFind, vbTextCompare) = 1 Then
         cboFindString = i
         Exit Function
      End If
   Next
End Function

'-------------------------

I use the VbAccelerator ComboBoxEx with SSubTmr6.Dll and I don't have any memory leaks although I did have a problem with Font Picker style crashing. In the version I use here I have removed all the Font/Color/Drive Picker styles. There are bugs or should I say unexpected behaviour in the AutoComplete code so that needed some tweaking. Other than that I have been using the control for 2 years.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Fraser_AdminAuthor Commented:
I am also using the vbaccelerator combobox.  This is so bizare.  What version of the dll are you using?  I'm sure it has something to do with this because I have no problems in other aps that do not use this control.

Do you have any idea how I can find where it is trying to reference this memory (the area of code)
0
 
danaseamanCommented:
SSubTmr.Dll/SSubTmr6.Dll. I use the latest version download from here: http://www.vbaccelerator.com/home/VB/Code/Libraries/Subclassing/SSubTimer/VB6_SSubTmr_Source_Code.asp
I use this subclassing in a Suite of over 40 commercial controls and it works great. This DLL is used by many programmers and I doubt there is a problem here. It would more likely be something in the control.
Are you sure thre isn't something else in your project that could be causing this. Try creating a new project with just the ComboEx and SSubTmr6.DLL, populate it with a few items and see if it still has a problem.

0
 
danaseamanCommented:
By the way are using DrawStyle = eccxDrawDefault? I'm not sure if the other styles work correctly.
0
 
Fraser_AdminAuthor Commented:
I'm using the same drawstyle.

It is probably something else.  I just can't imagine what would be causing this.  I've checked to make sure every instance of objects I create are closed and set to nothing when I'm done with them.  Is there anything else you can think of that would be causing this?
0
 
Fraser_AdminAuthor Commented:
What normally causes these memory referenced errors?
0
 
Fraser_AdminAuthor Commented:
What style are you using.  Are there any properties that you are changing from the default?

I'm using the onchange event a lot.  Have you used that any.  I'm really grasping at straws here.  I'm sure it is something just small, but I really don't even know where to look.

Thanks for you help so far.
0
 
danaseamanCommented:
My best suggestion is still the previous one creating a new project with just the Combo/SSUbTmr6 and see if it crashes. This would at least tell you if perhaps there is something else in your project causing this.
0
 
gecko_au2003Commented:
0
 
gecko_au2003Commented:
Just a couple more :

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=41733&lngWId=1

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=15080&lngWId=1

If you are not looking specifically for code and you still really want to use a control / component to do this for you with regards to the combo box then please let me know !
0
 
Fraser_AdminAuthor Commented:
comctl32.dll is the dll giving me the problem.  I thought it was the ssubtmr dll.  But I just got it to crash for me again, and that is what is showing in the call stack.  I'm hitting cancel when the message comes up, so it will bring me to a debugger of assembler type code, but it does show what is being called.  Does this shed any light?
0
 
Fraser_AdminAuthor Commented:
I would prefer to find my problem, but I know this will be tricky.  I will try the test with just a combobox in the project, and see if I can get it to crash out.
0
 
danaseamanCommented:
ComboEx is built using CreateWindowEx and the Combo class in comctl32.dll. It could still be something happening in your project that in turn is doing something nasty in ComboEx that in turn ripples down to comctl32.dll and crash.
0
 
Fraser_AdminAuthor Commented:
So how would I go about trying to find the initial culprit of the ripple?
0
 
danaseamanCommented:
These type of problems are hard to find. Have you tried a new project without any additional code? You could also try disabling whatever you are doing in OnChange event. Just put in an exit sub and the beginning of Change Event to bypass your code and see if that helps.
0
 
gecko_au2003Commented:
Not sure if this will help any but what service pack or updates have you got with regards to visual basic 6, because I know you can get updated version ie service pack 6 for vb 6 :

http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp6/default.aspx

Not sure if doing the udpate will help you at all with regards to the problem you are experiencing with the comctl32.dll and it crashing.

Just a thought though :)

Other then that I will sit back and see what other suggestions are made to try and help you out with your problem. Sorry I cant be of more help / use to you !

However I must admit danaseman's suggestion with regards to trying out a new project and just adding the combobox with minimal coding ie only having the code you require to test to see if it works without anything else that is not required is a good idea !!

Kind regards

Gecko
0
 
danaseamanCommented:
Although ComboEx is cretated with CreateWindowEx it is still hosted in a Vb UserControl so you should be using at least Vb6-SP5.
0
 
Fraser_AdminAuthor Commented:
The problem still occurs once it is compiled into an exe.  Would a vb service pack help this?
0
 
gecko_au2003Commented:
One way to find out ;)
0
 
gecko_au2003Commented:
I read this :

Before you begin
 This control is binary compatible and requires that you have comctl32.dll version 4.70 or higher to work. This is usually installed with Internet Explorer 3.x. Control also requires OleGuids.tlb (Only required when editing in VB). Make sure you have these installed before using the control. You can download the required files from the Runtimes section in Resources. Source code is saved in Visual Basic 6.0 and Control is compiled with Visual Basic 6.0 with Service Pack 3 installed.

From this site :

http://www.vbcodemagician.dk/resources/vcdtp.htm

So maybe that will help you with regards to your problem ;)
0
 
danaseamanCommented:
Absolutely. Anything less that ServicePack 5 with Visual Basic is asking for trouble. Even compiled your program accesses virtual machine MSVBVM60.DLL so unless you are up to date with your service packs it will affect your exe also..
0
 
gecko_au2003Commented:
What I posted was from that site and that was very min requirements but I do agree with what you just said with regards to at least having SP 5 with visual basic !
0
 
Fraser_AdminAuthor Commented:
I don't think I have any service packs installed.  So I'm downloading SP6.  I'm also going to check to see which version of comctl32 I have.
0
 
Fraser_AdminAuthor Commented:
I'm running version 5.81.4704.1100 for comctl32.

0
 
gecko_au2003Commented:
Let us know if updating it helps you out any :D
0
 
Fraser_AdminAuthor Commented:
Nope.  Still memory referencing errors.  This is driving me nuts.
0
 
Fraser_AdminAuthor Commented:
OK what I'm doing is opening one form.  Putting in a couple of values, and then opening a new form.  What events should I be working with.

When the button is clicked to open the form, I am doing:
form2.field1 = field1.text
form2.field2 = field2.text
form1.show 1

When the form is activating, I am doing nothing!!  I've commented out all my code.

When the form is unloaded, I am doing:
unload form2
set form2 = nothing

If I go between form1 and form2 like 5 times, it will crash
0
 
Fraser_AdminAuthor Commented:
When the exeception comes up I can click on cancel to allow it to debug.  This is the message when it debugs:

Unhandled exception at 0x7178460f in VB6.EXE: 0xC0000005: Access violation reading location 0xffff0435.

This is the value in the call stack that it goes to: >      comctl32.dll!7178460f()       

This is my entire call stack
>      comctl32.dll!7178460f()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e152e6()       
       USER32.DLL!77e15362()       
       SSubTmr6.dll!2e8c4ca7()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e14398()       
       USER32.DLL!77e14925()       
       comctl32.dll!71798328()       
       comctl32.dll!7179839c()       
       comctl32.dll!717987a9()       
       comctl32.dll!71796b29()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e152e6()       
       USER32.DLL!77e15362()       
       SSubTmr6.dll!2e8c4ca7()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e14764()       
       USER32.DLL!77e15a40()       
       NTDLL.DLL!77fa15ef()       
       MSVBVM60.DLL!66102f01()       
       MSVBVM60.DLL!66051fb3()       
       vbalCbEx6.ocx!25a42880()       
       MSVBVM60.DLL!660522b4()       
       MSVBVM60.DLL!6605271b()       
       MSVBVM60.DLL!66052931()       
       MSVBVM60.DLL!6608ae91()       
       VB6.EXE!004135c8()       
       VB6.EXE!0041352e()       
       VB6.EXE!004132b2()       
       VB6.EXE!0041b177()       
       VB6.EXE!0041a805()       
       VB6.EXE!0041a573()       
       VB6.EXE!0041a5f8()       
       VB6.EXE!0041a3c9()       
       VB6.EXE!00410a98()       
       VB6.EXE!004108cf()       
       VB6.EXE!0041151a()       
       VB6.EXE!0041850c()       
       VB6.EXE!00444d24()       
       03260694()      
       VB6.EXE!00444cfd()       
       VB6.EXE!00406301()       
       VB6.EXE!00406173()       
       VB6.EXE!0042edc8()       
       VB6.EXE!00403a60()       
       VB6.EXE!0040588d()       
       VB6.EXE!00419e34()       
       VB6.EXE!004052ab()       
       VB6.EXE!00406eed()       
       VB6.EXE!00403a60()       
       VB6.EXE!0040588d()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e14398()       
       USER32.DLL!77e14925()       
       USER32.DLL!77e1ce0f()       
       USER32.DLL!77e26321()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e152e6()       
       USER32.DLL!77e15362()       
       VB6.EXE!00404abd()       
       VB6.EXE!0042e5f4()       
       VB6.EXE!00403a60()       
       VB6.EXE!0040588d()       
       USER32.DLL!77e12ca8()       
       USER32.DLL!77e12dc5()       
       USER32.DLL!77e1577d()       
       VB6.EXE!0042f5c9()       
       MSO97RT.DLL!3078d224()       
       MSO97RT.DLL!306c3498()       
       0824448b()      

Not sure if this will mean any more to you than it does to me.
0
 
gecko_au2003Commented:
I'm at a loss here, only suggestion I can make is use or try out the suggestions I made with regards to www.pscode.com sites I suggested earlier :) Other then that im stumped as I have never used the one you are trying to use now :)

I'm sorry ! Hopefully another expert can help you out :)
0
 
Fraser_AdminAuthor Commented:
I have about 50 comboboxes on the form that is giving me the problem.  If I do the same test with a form that has one, I don't have the same problem.
I think it is something in this control.  I will check out the pscode site to see if I can find something there.
Thanks
0
 
Fraser_AdminAuthor Commented:
I was unable to find a solution to this question.  I changed it to use the combo box control that comes with vb, no more problems.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 16
  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now