Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create Right Click Event on Listview 's Column Header?

Posted on 2001-08-06
11
368 Views
Last Modified: 2007-12-19
Hi experts,

Can i Create Right Click Event on Listview Column Header?

How do i know if my Listview Column Header are Clicked using mouse's right click?

'Thanks.
0
Comment
Question by:Ryan Chong
  • 5
  • 5
11 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 80 total points
ID: 6358275
0
 
LVL 50

Author Comment

by:Ryan Chong
ID: 6358399
Hi Ark,

I tried the code on link provided, but i crash my VB. It got error on Kernel.dll as:

_______________________________________________________

VB6 caused an exception c0000026H in module KERNEL32.DLL at 017f:bff88539.
Registers:
EAX=ffffffff CS=017f EIP=bff88539 EFLGS=00000213
EBX=ffffffff SS=0187 ESP=007ff948 EBP=007ffacc
ECX=ffffffff DS=0187 ESI=007ffa20 FS=0e77
EDX=bff7687a ES=0187 EDI=817c8680 GS=0000
Bytes at CS:EIP:
5f 5e 5b 8b e5 5d c2 10 00 8b 4c 24 04 56 0f b7
Stack dump:
0fc0d000 00000000 0541d864 0001001f 00000000 00000000 00000000 00000000 00000000 00000000 ffff137f ffff0000 ffffffff 00000000 00000000 00000000

______________________________________________________

So how can i overcome the problems?

Or any alternative links or codes? Comments?

Thanks.
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6358414
did you close the App via the Stop button in the VB IDE? When subclassing a window, you have to close it via the "X" button, or some other coded way... Otherwise, the Unload() code never executes, leaving windows unsure of where to send messages etc (I think, lemme know if im wrong)...
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 50

Author Comment

by:Ryan Chong
ID: 6379066
Hi JonFish85,

Sorry i'm not quite understand on what is your comment.

> did you close the App via the Stop button in the VB IDE?
So what method should i use to "Close" the window?

But before that my VB crashed before the code is successfully executed.

Any comments? Any useful links/ articles?

Thanks A Lot to ALL. : )
0
 
LVL 28

Expert Comment

by:Ark
ID: 6379177
Hi
When using subclassing, you should close program in IDE ONLY with main form [x] button. There won't be a prb when compiled.

Cheers
0
 
LVL 50

Author Comment

by:Ryan Chong
ID: 6760125
Hi Ark,

This question has been opened for a long time now (sorry about that), as got some free time to research recently i go back to this question.

As testing the code form the link you provided (VBNet) i still get the error. This time is:

"Invalid use of AddressOf" in HookWindow. I think this is a typical error. How can i figure it out?

Win2k, VB6 development environment.

Thanks a lot.
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760205
"Invalid use of AddressOf" - this often occure when you place CallBack function at form/class module.
Function which you use in AddressOf operator MUST BE IN A BAS MODULE ONLY and be Public

Cheers
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760207
"Invalid use of AddressOf" - this often occure when you place CallBack function at form/class module.
Function which you use in AddressOf operator MUST BE IN A BAS MODULE ONLY and be Public

Cheers
0
 
LVL 50

Author Comment

by:Ryan Chong
ID: 6760242
Hi Ark,

Although "Invalid use of AddressOf" error had been removed, but the whole running project disappear (corrupted?) from my desktop within seconds. So ..?? What may cause this happen?

Thanks
0
 
LVL 28

Expert Comment

by:Ark
ID: 6760275
Seems it's corrupted. This is subclassing behavior - when you subclass window/control, all messages come to your callback function first. But if you have an error inside function, VB try to interrupt process, while messages continue redirecting to missing(interrupting) function. This cause GPF. Check all code. Follow all instructions from VBNet (i.e. place everything they say "bas module" in bas module, "form code" - into form, name all controls same as in their code).

Cheers
0
 
LVL 50

Author Comment

by:Ryan Chong
ID: 6762904
Find the error, fixed it and finally it works!

Thanks a lot Ark :)
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 78
VBA: Select SQL query based on a config Sheet v2 11 49
RUNRMTCMD from AS/400 12 68
VB6 common control 6 sp6 object library not registerd 3 19
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question