|
-
Sep 12th, 2007, 08:41 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Code works in VB, but not when compiled
I already posted this in API (sorry to double post).. I am not sure if its an API issue tho.. and I am in desperate need of answers 
http://vbforums.com/showthread.php?t=488348 is my thread, it has all the info in it...
Last edited by penagate; Sep 24th, 2007 at 04:09 AM.
Reason: removed offer of payment
-
Sep 12th, 2007, 10:12 PM
#2
Re: [RESOLVED] Code works in VB, but not when compiled
i downloaded your code and click test button. but the cursor does not move. you sad your code is working in the IDE ?
-
Sep 12th, 2007, 10:16 PM
#3
Re: [RESOLVED] Code works in VB, but not when compiled
-
Sep 12th, 2007, 10:29 PM
#4
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
Did you see my pcode / native code post? know anything about that ?
After reading up on pcode and native code, i really want to continue to compile it in native code
-
Sep 12th, 2007, 10:34 PM
#5
Re: Code works in VB, but not when compiled
You need to use the LVNI_SELECTED and Not LVIS_FOCUSED
-
Sep 12th, 2007, 10:36 PM
#6
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
Hold up well I test this on my external application
-
Sep 12th, 2007, 10:36 PM
#7
Re: Code works in VB, but not when compiled
SO change it like this
Code:
For i = 0 To numofItems - 1
If SendMessage(listhwnd, LVM_GETITEMSTATE, i, LVNI_SELECTED) = 2 Then
curPosition = i
Exit For
End If
Next i
Reply me with the results
-
Sep 12th, 2007, 10:42 PM
#8
Thread Starter
Hyperactive Member
LVNI_SELECTED doesnt even work for me in the example i made, if i just switch lvis_focused with it, and declare LVNI_SELECTED, it does the same thing.. works in VB, but not when compiled
also i am not sure if selected will work the same as focus for what i am doing.. i am trying to test it on the external app i want to use it on, but their servers are down! lol
It does work on 1 program , once this server comes up, I will test it on where i actually need it to work, and see if selected does the same job as focus.. do you knwo what the difference is?
Last edited by penagate; Sep 24th, 2007 at 04:09 AM.
Reason: merged
-
Sep 12th, 2007, 10:49 PM
#9
Re: Code works in VB, but not when compiled
ok ok, i checked it with my own application and was working. i check it with your application in the IDE working. ok. i found it seems not woking out side. let me check the problem.
-
Sep 12th, 2007, 10:52 PM
#10
Re: Code works in VB, but not when compiled
LVIS_SELECTED means that the item is selected. The appearance of a selected item depends on whether it has the focus and also on the system colors used for selection.
LVIS_FOCUSED means that the item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus.
LVIS_FOCUSED state is used for keyboard navigation in the list view control. In a single-selection control the selection follows the keyboard focus. In your situation the second item has the selection, but does not have the focus.
-
Sep 12th, 2007, 10:53 PM
#11
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
I think the problem is because when you click the button, the listview loses its selection, this is my concern, because it doesnt lose its focus, so the focus thing would work better then selected. However focus doesnt seem to work when compiled in native code haha
-
Sep 12th, 2007, 11:51 PM
#12
Re: Code works in VB, but not when compiled
i manage to track the problem. it worked in your project in the IDE and in the OUt side of IDE. you need to put a ByVal key word infront of the lparam.
Code:
If SendMessage(listhwnd, LVM_GETITEMSTATE, i, ByVal LVIS_FOCUSED) > 0 Then
-
Sep 13th, 2007, 03:58 AM
#13
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
dude if that works fazi, you are the man!!!!, i am half asleep right now, i will test int he morning
Last edited by bail3yz; Sep 13th, 2007 at 04:03 AM.
-
Sep 13th, 2007, 04:33 AM
#14
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
Fazi, that worked great on ListView20WndClass but not SysListView32 , which one did you test yours on?
Anyways, I am testing the selected option you suggested, so far it seems to work great, ive only seen one downside
-
Sep 13th, 2007, 05:10 AM
#15
Thread Starter
Hyperactive Member
Re: Code works in VB, but not when compiled
Also, i am a bit confused about the ByVal thing, any idea when for Focus it changes from returning 2 when it has focus to returning one when byval is used?
Last edited by penagate; Sep 24th, 2007 at 04:10 AM.
Reason: removed offer of payment
-
Sep 13th, 2007, 06:08 AM
#16
Re: Code works in VB, but not when compiled
Hai bail3yz, focosing is not a matter here. ByVal / ByRef is the thing. There are tons of tutorials on ByVal & ByRef. It is a very important concept in API Programming. Please searh google for 'Passing ByVal and Passing ByRef'.
actually i am working here as a volanteer. i never expect anything but Sharing knowledge. Thank you for the offer. but a rating to my post would be well enough 
Cheers !
-
Sep 13th, 2007, 06:18 AM
#17
Thread Starter
Hyperactive Member
-
Sep 13th, 2007, 07:46 AM
#18
Re: [RESOLVED] Code works in VB, but not when compiled
Your Wellcome Bail3yz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|