Print Page | Close Window

CRASH using Sendmessage API to Combobox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=11196
Printed Date: 10 May 2024 at 3:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CRASH using Sendmessage API to Combobox
Posted By: Stilki
Subject: CRASH using Sendmessage API to Combobox
Date Posted: 24 June 2008 at 11:47pm

Sendmessage API crashes the combox when accessing the ItemData property after filling in the itemdata property using Sendmessage method.

'Add a string to the combox
ItemIndex = SendMessage(Hwnd, CB_ADDSTRING, 0, ByVal Item)
'Add a value to the ItemData property
ret = SendMessage(Hwnd, CB_SETITEMDATA, ItemIndex, ByVal ItemData)
 
When I fill in the ITEMS combox using Sendmessage it works ok.
When I fill in the ITEMDATA using Sendmessage it works ok.
When I try to access the ItemData property,
eg. Debug.Print Combox.ItemData(0)
it crashes with a message 'Object has disconnected from client...'
 
If I fill in the ItemData without the Sendmessage API there is no crash.
(Even if I have filled the Items using Sendmessage)
 
The reason for using the Sendmessage API method is to speed up the loading of large lists.



Replies:
Posted By: Oleg
Date Posted: 25 June 2008 at 12:38am

Hi,

Don't use API. Combo use own structures in ItemData.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net