473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

HDC to IntPtr

Hi,

how to convert a HDC to IntPtr ?
thx.

Al.
Nov 1 '06 #1
6 2809
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.
Nov 1 '06 #2
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.

Nov 1 '06 #3
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.

"--== Alain ==--" <no****@noemail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
| 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.
| >
| >
Nov 1 '06 #4
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.

Nov 1 '06 #5
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.
Nov 1 '06 #6
Seems like you don't even use C#, so I would suggest you to post C++ related
questions to the vc NG.

Willy.

"--== Alain ==--" <no****@noemail.comwrote in message
news:en**************@TK2MSFTNGP03.phx.gbl...
|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.
| >
| >
| >
Nov 1 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nuno Esculcas | last post by:
Hello, I come from C++ and i now have to work with C#, and someone tell me that bye bye pointers but i think this is not true, i must convert a DIB image in something that i can use in C# (like...
13
by: Christian Westerlund | last post by:
Hi! I'm trying to use P/Invoke and a Method which takes an IntPtr where I am supposed to put an address to a method which the native method will use to communicate back to me. How do I convert a...
10
by: Tamir Khason | last post by:
I have a pointer to array and I want to apply indexing to this Array so I have function (name it IntPrt Func) to go to certain member I can use (as C++) Func, but in C# I recieve an error "Cannot...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
6
by: active | last post by:
I downloaded the Win32 Library which saved me MUCH work. Some (All?) of the returned handles are typed int. As I used them I often changed them in my copy of win32 to IntPtr because an...
0
by: Jørn Jensen | last post by:
Hey! I have an issue with creating bitmap from an IntPtr. The IntPtr is created from a Twain scanner, which seem to work perfectly in it's original state (the app is originally written by somebody...
7
by: justin.kruger | last post by:
I am having a problem with exchanging handles with c# and the "CP210xManufacturing.dll" in a device wrapper that i am working on. I have created a wrapper class to address some of the functions...
9
by: pigeonrandle | last post by:
Hi, I'm trying to convert the following line to c# from VB6 If hrRapiInit >= 0 Then 'SUCCEEDED where hrRapiInit is declared as a Long. In c#, hrRapiInit must be declared as an IntPtr to fit...
1
by: dcurington | last post by:
I have to call a function. This is from the SDK: INT is_GetActSeqBuf (HIDS hf, INT* pnNum, char** ppcMem, char** ppcMemLast); I have demo C# code that works. Here is the prototype: private...
0
by: Charming12 | last post by:
Hi All, I have a strange problem and due to my inefficiency with IntPtr i am unable to figure it out. I have an structure something like: public struct Detail { public int age; public...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.