BaldrickThe4th Posted February 2, 2005 Posted February 2, 2005 Hi there I guess I'm trying to be too clever, but I wonder if someone can shed some light on what is happening. I'm loading a combobox with a number of thousands of items. To speed the process up I've tried to use: SendMessage(ComboBox1.Handle, CB_ADDSTRING, -1, "Some Text") However things don't appear well. The list gets populated, but when clicking on an item in the list I get a subscript error. The dropdown box also only appears to be one line rather than 8. I can go back to useing the combobox.add method, but I'm curious as to what is going on. Any thoughts anyone. Thanks. Quote
Leaders dynamic_sysop Posted February 2, 2005 Leaders Posted February 2, 2005 well , the 3rd parameter should be a zero , not -1 so try ... SendMessage(ComboBox1.Handle, CB_ADDSTRING, [color=Red][b]0[/b][/color], "Some Text") '/// note i've replaced the [b]-1[/b] with [b]0[/b] Quote
BaldrickThe4th Posted February 2, 2005 Author Posted February 2, 2005 well , the 3rd parameter should be a zero , not -1 so try ... SendMessage(ComboBox1.Handle, CB_ADDSTRING, [color=Red][b]0[/b][/color], "Some Text") '/// note i've replaced the [b]-1[/b] with [b]0[/b] Thanks I did try that in an earlier attempt but it gave the same results. The error I get is "Specified arguement was out of range of valid values. Parameter name '48' is not a valid value for 'index'. Quote
BaldrickThe4th Posted February 2, 2005 Author Posted February 2, 2005 Digging around a little more I found the comment that Sendmessage deals with "objects" whereas the framework expects "strings". I guess this is the problem. I'm back to the slower but more orthodox add function. Thanks for your help. Quote
Leaders dynamic_sysop Posted February 2, 2005 Leaders Posted February 2, 2005 how are you specifying your SendMessage Function? because you can customize it pretty much to suit your needs, thus making it do it's job of working fast. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.