Click here to Skip to main content
15,898,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: ServicedComponent: How to tell you are in a transaction? Pin
Le centriste1-Mar-04 9:24
Le centriste1-Mar-04 9:24 
GeneralCalling a third party DLL Pin
Andy *M*1-Mar-04 8:28
Andy *M*1-Mar-04 8:28 
GeneralRe: Calling a third party DLL Pin
Nick Parker1-Mar-04 8:53
protectorNick Parker1-Mar-04 8:53 
GeneralRe: Calling a third party DLL Pin
Heath Stewart1-Mar-04 9:15
protectorHeath Stewart1-Mar-04 9:15 
GeneralRe: Calling a third party DLL Pin
Andy *M*1-Mar-04 9:52
Andy *M*1-Mar-04 9:52 
GeneralRe: Calling a third party DLL Pin
Heath Stewart1-Mar-04 9:57
protectorHeath Stewart1-Mar-04 9:57 
GeneralRe: Calling a third party DLL Pin
Andy *M*1-Mar-04 10:09
Andy *M*1-Mar-04 10:09 
GeneralRe: Calling a third party DLL Pin
Heath Stewart1-Mar-04 10:46
protectorHeath Stewart1-Mar-04 10:46 
Andy MacAngus wrote:
They return a HANDLE (which is just a C-macro definition for void*)

Thanks, I know! Smile | :) I started programming on C many, many years ago. Still use it sometimes.

What you're doing isn't at all different from what MANY classes in the .NET base class library, do. Take controls in Windows Forms, for example - they all use window handles (HWNDs), as well as many other types of handles (all typedefs of the same thing, of course).

You mentioned that you're checking the return of IsOpen against a boolean expression. Are you comparing against true or false? Or are you equating the return against 0, 1, some negative number, etc? In the former case, you should declare your method return value as a bool, so long as the concept of a boolean in your unmanaged code uses 0 for false and anything else for true (like the BOOL typedef). You'd probably get compiler errors otherwise, but I honestly can't see the problem.

You're right to use an IntPtr for void*. Despite your return value, do you get a valid memory address? If you share these two projects in a simple solution (you'll have to upgrade the old VC++ 6 project, of course), you could actually debug projects and see what is happening in both managed and unmanaged code.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Calling a third party DLL Pin
Andy *M*1-Mar-04 10:55
Andy *M*1-Mar-04 10:55 
GeneralRe: Calling a third party DLL Pin
Heath Stewart1-Mar-04 11:07
protectorHeath Stewart1-Mar-04 11:07 
Questionhow to get the window coordinates Pin
SherKar1-Mar-04 8:00
SherKar1-Mar-04 8:00 
AnswerRe: how to get the window coordinates Pin
Heath Stewart1-Mar-04 9:12
protectorHeath Stewart1-Mar-04 9:12 
GeneralRe: how to get the window coordinates Pin
SherKar2-Mar-04 7:43
SherKar2-Mar-04 7:43 
GeneralRe: how to get the window coordinates Pin
Heath Stewart2-Mar-04 8:52
protectorHeath Stewart2-Mar-04 8:52 
GeneralSnagging in memory assemblies Pin
RB@Emphasys1-Mar-04 7:27
RB@Emphasys1-Mar-04 7:27 
GeneralRe: Snagging in memory assemblies Pin
Heath Stewart1-Mar-04 9:10
protectorHeath Stewart1-Mar-04 9:10 
GeneralRe: Snagging in memory assemblies Pin
RB@Emphasys1-Mar-04 10:33
RB@Emphasys1-Mar-04 10:33 
QuestionAPI Viewer for C#? Pin
Alexsander Antunes1-Mar-04 7:24
professionalAlexsander Antunes1-Mar-04 7:24 
AnswerRe: API Viewer for C#? Pin
Nick Parker1-Mar-04 8:24
protectorNick Parker1-Mar-04 8:24 
GeneralPrincipal Permissions Pin
Mauricio Ritter1-Mar-04 2:45
Mauricio Ritter1-Mar-04 2:45 
GeneralRe: Principal Permissions Pin
Heath Stewart1-Mar-04 4:05
protectorHeath Stewart1-Mar-04 4:05 
GeneralDocking panel pushes another... Pin
Weiye Chen1-Mar-04 2:28
Weiye Chen1-Mar-04 2:28 
GeneralRe: Docking panel pushes another... Pin
Heath Stewart1-Mar-04 3:57
protectorHeath Stewart1-Mar-04 3:57 
GeneralRe: Docking panel pushes another... Pin
Weiye Chen1-Mar-04 4:12
Weiye Chen1-Mar-04 4:12 
GeneralRe: Docking panel pushes another... Pin
Heath Stewart1-Mar-04 4:18
protectorHeath Stewart1-Mar-04 4:18 

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.