Click here to Skip to main content
15,889,867 members
Home / Discussions / C#
   

C#

 
GeneralItembackground Color in ListBox Pin
Snowjim13-Feb-04 8:01
Snowjim13-Feb-04 8:01 
GeneralRe: Itembackground Color in ListBox Pin
Heath Stewart13-Feb-04 12:32
protectorHeath Stewart13-Feb-04 12:32 
GeneralRe: Itembackground Color in ListBox Pin
Snowjim13-Feb-04 14:27
Snowjim13-Feb-04 14:27 
GeneralRe: Itembackground Color in ListBox Pin
Heath Stewart13-Feb-04 16:48
protectorHeath Stewart13-Feb-04 16:48 
GeneralInterfaces Pin
MrJJKoolJ13-Feb-04 7:21
MrJJKoolJ13-Feb-04 7:21 
GeneralRe: Interfaces Pin
Heath Stewart13-Feb-04 12:29
protectorHeath Stewart13-Feb-04 12:29 
GeneralRe: Interfaces Pin
MrJJKoolJ13-Feb-04 12:34
MrJJKoolJ13-Feb-04 12:34 
GeneralImplementing IDropTargetInterFace in C# Pin
vnutheti13-Feb-04 6:35
vnutheti13-Feb-04 6:35 
Hi all,
I would like to implement this interface for my C# Class,The IDropTarget interface has been created, as shown below.
[ComImport,
Guid("00000122-0000-0000-C000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown) ]
public interface IDropTarget
{
[PreserveSig()]
int DragEnter(IDataObject pDataObj, uint grfKeyState, object pt, ref uint pdwEffect);
[PreserveSig()]
int DragOver(uint grfKeyState, object pt, ref uint pdwEffect);
[PreserveSig()]
int DragLeave();
[PreserveSig()]
int Drop(IDataObject pDataObj, uint grfKeyState, object pt, ref uint pdwEffect);}

Compiles without any problem.
However when I try to register:
[DllImport("ole32.dll")]
static extern int RegisterDragDrop(IntPtr hwnd, ref IDropTarget DropTarget); gives an error saying Expected (ret code is highlighted as error) Expected class ,Delegate ,enum,Interface or struct.
However, changing the int enum gives the same Error.

The function is actually defined as
WINOLEAPI RegisterDragDrop(
HWND hwnd, //Handle to a window that can accept drops
IDropTarget * pDropTarget
//Pointer to object that is to be target of drop);
WINOLEAPI on further examination turns out to be HRESULT with 3 values 0,1,2

What am I doing wrong ?
Could any one please help ? thanks in advance.

Thanks
Ven
GeneralRe: Implementing IDropTargetInterFace in C# Pin
Heath Stewart13-Feb-04 12:20
protectorHeath Stewart13-Feb-04 12:20 
GeneralRe: Implementing IDropTargetInterFace in C# Pin
vnutheti13-Feb-04 13:44
vnutheti13-Feb-04 13:44 
GeneralRe: Implementing IDropTargetInterFace in C# Pin
Heath Stewart13-Feb-04 16:46
protectorHeath Stewart13-Feb-04 16:46 
GeneralRe: Implementing IDropTargetInterFace in C# Pin
vnutheti14-Feb-04 8:06
vnutheti14-Feb-04 8:06 
GeneralUsing and intercepting command line programs Pin
noahfields13-Feb-04 6:00
noahfields13-Feb-04 6:00 
GeneralRe: Using and intercepting command line programs Pin
Kentamanos13-Feb-04 7:12
Kentamanos13-Feb-04 7:12 
GeneralRe: Using and intercepting command line programs Pin
noahfields14-Feb-04 4:05
noahfields14-Feb-04 4:05 
GeneralDataset and Recordset Pin
ASGill13-Feb-04 5:11
ASGill13-Feb-04 5:11 
GeneralRe: Dataset and Recordset Pin
Heath Stewart13-Feb-04 5:28
protectorHeath Stewart13-Feb-04 5:28 
GeneralControlling Panels via RadioButtons Pin
srt713-Feb-04 4:47
srt713-Feb-04 4:47 
GeneralRe: Controlling Panels via RadioButtons Pin
Heath Stewart13-Feb-04 5:32
protectorHeath Stewart13-Feb-04 5:32 
Generaldocked controls snapping to grid in compiled app Pin
Nathan Ridley13-Feb-04 4:16
Nathan Ridley13-Feb-04 4:16 
GeneralRe: docked controls snapping to grid in compiled app Pin
leppie13-Feb-04 19:14
leppie13-Feb-04 19:14 
GeneralRe: docked controls snapping to grid in compiled app Pin
Nathan Ridley14-Feb-04 0:06
Nathan Ridley14-Feb-04 0:06 
AnswerRe: listView - is there a bug? Pin
thomasa13-Feb-04 1:54
thomasa13-Feb-04 1:54 
GeneralRe: listView - is there a bug? Pin
Andy H13-Feb-04 3:16
Andy H13-Feb-04 3:16 
GeneralRe: listView - is there a bug? Pin
Heath Stewart13-Feb-04 3:50
protectorHeath Stewart13-Feb-04 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.