HDC to IntPtr

  • Thread starter Thread starter --== Alain ==--
  • Start date Start date
how to convert a HDC to IntPtr ?

I'm not sure that I understand. There is no HDC type in C#, so most programmers
just use an IntPtr in place of it. Could you describe the context of the
problem that you're trying to solve. Perhaps, a little code sample would
illuminate the issue.

Best Regards,
Dustin Campbell
Developer Express Inc.
 
in fact i take HDC from Win32 namespace

Dustin said:
I'm not sure that I understand. There is no HDC type in C#, so most
programmers just use an IntPtr in place of it. Could you describe the
context of the problem that you're trying to solve. Perhaps, a little
code sample would illuminate the issue.

Best Regards,
Dustin Campbell
Developer Express Inc.
 
in fact i take HDC from Win32 namespace

What Win32 namespace? The only Win32 namespace that I am aware of in the
..NET Framework is the Microsoft.Win32 namespace but that doesn't contain
an HDC type. Is this from a third-party library?

Best Regards,
Dustin Campbell
Developer Express Inc.
 
That means that you are using PInvoke interop to call into unmanaged code,
right?
Your function declaration should specify the HDC as IntPtr, the interop
layer will marshal the HDC (a void*) to IntPtr on return.


Willy.

| in fact i take HDC from Win32 namespace
|
| Dustin Campbell wrote:
| >> how to convert a HDC to IntPtr ?
| >
| > I'm not sure that I understand. There is no HDC type in C#, so most
| > programmers just use an IntPtr in place of it. Could you describe the
| > context of the problem that you're trying to solve. Perhaps, a little
| > code sample would illuminate the issue.
| >
| > Best Regards,
| > Dustin Campbell
| > Developer Express Inc.
| >
| >
 
i did like you wrote before and it's ok.
thx.

Dustin said:
What Win32 namespace? The only Win32 namespace that I am aware of in the
.NET Framework is the Microsoft.Win32 namespace but that doesn't contain
an HDC type. Is this from a third-party library?

Best Regards,
Dustin Campbell
Developer Express Inc.
 
Seems like you don't even use C#, so I would suggest you to post C++ related
questions to the vc NG.

Willy.

|i did like you wrote before and it's ok.
| thx.
|
| Dustin Campbell wrote:
| >> in fact i take HDC from Win32 namespace
| >
| > What Win32 namespace? The only Win32 namespace that I am aware of in the
| > .NET Framework is the Microsoft.Win32 namespace but that doesn't contain
| > an HDC type. Is this from a third-party library?
| >
| > Best Regards,
| > Dustin Campbell
| > Developer Express Inc.
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top