Click here to Skip to main content
15,911,360 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Framework Version Pin
Vasudevan Deepak Kumar20-Aug-07 20:36
Vasudevan Deepak Kumar20-Aug-07 20:36 
Question64-bit Interop Pin
Leslie Sanford17-Aug-07 6:42
Leslie Sanford17-Aug-07 6:42 
AnswerRe: 64-bit Interop Pin
Abisodun17-Aug-07 6:49
Abisodun17-Aug-07 6:49 
GeneralRe: 64-bit Interop [modified] Pin
Leslie Sanford17-Aug-07 7:23
Leslie Sanford17-Aug-07 7:23 
GeneralRe: 64-bit Interop Pin
Dave Kreskowiak17-Aug-07 7:35
mveDave Kreskowiak17-Aug-07 7:35 
GeneralRe: 64-bit Interop Pin
Leslie Sanford17-Aug-07 7:38
Leslie Sanford17-Aug-07 7:38 
GeneralRe: 64-bit Interop Pin
Luc Pattyn17-Aug-07 7:38
sitebuilderLuc Pattyn17-Aug-07 7:38 
GeneralRe: 64-bit Interop Pin
Leslie Sanford17-Aug-07 7:42
Leslie Sanford17-Aug-07 7:42 
Luc Pattyn wrote:
here is my theory (still theory since I have not run any of this on Win64):
- for native pointers you really should use IntPtr, and it is not hard to do so.
- Win32 uses 4B pointers, Win64 needs 8B pointers
- you must build for either 32-bit or 64-bit
- on Win64 everything must be consistent (all modules 64-bit is fine, and
all modules 32-bit runs in some compatibility mode, not sure tho)
- IntPtr is a value type that holds either 4B or 8B pointer value
- IntPtr must be initialized, normally you give its value at construction
- a lot of P/Invoke examples are wrong, and use int/uint where it should have
been IntPtr. Most notably SendMessage: lParam, wParam and return value should
be regarded as IntPtr, and cast to int or whatever if and when appropriate.
- correct prototypes would have IntPtr for anything that is or could be a handle
(such as lParam).


Thanks for this explanation.

I've got a lot of code revision to do. I have older "toolkits" whose P/Invoke methods are apparently wrong, or will at least break on a 64-bit system.

Luc Pattyn wrote:
Your problem seems to be you did not initialize handle.


Actually, I don't think I'm suppose to initialize the handle, rather I should use the out modifier on the IntPtr parameters rather than ref, as I had initially tried.
GeneralRe: 64-bit Interop Pin
Luc Pattyn17-Aug-07 7:47
sitebuilderLuc Pattyn17-Aug-07 7:47 
GeneralRe: 64-bit Interop Pin
Leslie Sanford17-Aug-07 8:04
Leslie Sanford17-Aug-07 8:04 
GeneralRe: 64-bit Interop Pin
Luc Pattyn17-Aug-07 8:14
sitebuilderLuc Pattyn17-Aug-07 8:14 
GeneralRe: 64-bit Interop Pin
Leslie Sanford17-Aug-07 11:30
Leslie Sanford17-Aug-07 11:30 
GeneralRe: 64-bit Interop Pin
Luc Pattyn17-Aug-07 12:39
sitebuilderLuc Pattyn17-Aug-07 12:39 
QuestionIs any Record Set Concept is there in OLEDB Pin
Praveen 12317-Aug-07 1:29
Praveen 12317-Aug-07 1:29 
AnswerRe: Is any Record Set Concept is there in OLEDB Pin
Scott Dorman17-Aug-07 10:26
professionalScott Dorman17-Aug-07 10:26 
Questionflash button Pin
michael_jhons16-Aug-07 21:42
michael_jhons16-Aug-07 21:42 
AnswerRe: flash button Pin
pmarfleet16-Aug-07 23:33
pmarfleet16-Aug-07 23:33 
QuestionSource C# for Chinese Chess Pin
Quoc Trang16-Aug-07 17:54
Quoc Trang16-Aug-07 17:54 
QuestionHow To install msi file along with my app setup Pin
Mayur16-Aug-07 4:52
professionalMayur16-Aug-07 4:52 
QuestionHow to raise events while clicking a datalist item or a particular Row?? Pin
bijeshputhalath15-Aug-07 21:42
bijeshputhalath15-Aug-07 21:42 
AnswerRe: How to raise events while clicking a datalist item or a particular Row?? Pin
- Pascal -17-Aug-07 9:11
- Pascal -17-Aug-07 9:11 
QuestionWhy Value types.. Pin
Sendilkumar.M15-Aug-07 21:15
Sendilkumar.M15-Aug-07 21:15 
AnswerRe: Why Value types.. Pin
Urs Enzler15-Aug-07 23:02
Urs Enzler15-Aug-07 23:02 
QuestionOpening a DB Pin
zchwllms14-Aug-07 12:20
zchwllms14-Aug-07 12:20 
AnswerRe: Opening a DB Pin
Dave Kreskowiak14-Aug-07 12:25
mveDave Kreskowiak14-Aug-07 12:25 

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.