Results 1 to 2 of 2

Thread: Win32 API bug

  1. #1

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Arrow Win32 API bug

    Code:
    		[DllImport("user32")]
    		public static extern int GetClassName(
    			int hWnd,
    			string lpClassName,
    			int nMaxCount
    			);
    I am just messing around trying to refresh my memory on some stuff I haven't done lately. Right ow I am making a simple Window Info Spy to get some practice using the Win32 API. The problem is that I can't this to pass out a value. If I add ref or out to string lpClassName I get a fatal crash. With out the out/ref mark I get nothing.

    Anyone know what might be doing this xor how to fix it?
    Magiaus

    If I helped give me some points.

  2. #2

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Win32 API bug

    Code:
    		[DllImport("user32")]
    		public static extern int GetClassName(
    			int hWnd,
    			[MarshalAs(UnmanagedType.LPTStr)]
    			string lpClassName,
    			int nMaxCount
    			);
    Now I have a string that is in an unreadable format.....
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width