Click here to Skip to main content
15,921,548 members
Home / Discussions / C#
   

C#

 
QuestionWhat's the difference ? Pin
PShweta13-Jul-04 19:45
PShweta13-Jul-04 19:45 
AnswerRe: What's the difference ? Pin
Roman Rodov13-Jul-04 20:00
Roman Rodov13-Jul-04 20:00 
GeneralRe: What's the difference ? Pin
PShweta14-Jul-04 0:17
PShweta14-Jul-04 0:17 
QuestionReplicate CancelEventArgs behaviour? Pin
misterbear13-Jul-04 19:34
misterbear13-Jul-04 19:34 
AnswerRe: Replicate CancelEventArgs behaviour? Pin
mav.northwind14-Jul-04 0:04
mav.northwind14-Jul-04 0:04 
GeneralRe: Replicate CancelEventArgs behaviour? Pin
Heath Stewart14-Jul-04 4:52
protectorHeath Stewart14-Jul-04 4:52 
GeneralRe: Replicate CancelEventArgs behaviour? Pin
mav.northwind14-Jul-04 5:36
mav.northwind14-Jul-04 5:36 
QuestionHow to make Make and IDE??? Pin
ilmian13-Jul-04 19:25
ilmian13-Jul-04 19:25 
Generalworking with https Pin
niko.13-Jul-04 17:51
sussniko.13-Jul-04 17:51 
GeneralRe: working with https Pin
Heath Stewart14-Jul-04 4:37
protectorHeath Stewart14-Jul-04 4:37 
GeneralRe: working with https Pin
Anonymous14-Jul-04 6:31
Anonymous14-Jul-04 6:31 
QuestionHow to use UdpClient class? Pin
skywen13-Jul-04 17:00
skywen13-Jul-04 17:00 
AnswerRe: How to use UdpClient class? Pin
Heath Stewart14-Jul-04 4:24
protectorHeath Stewart14-Jul-04 4:24 
GeneralChild Control Painting problem(For the last time) Pin
Jon_Slaughter13-Jul-04 13:54
Jon_Slaughter13-Jul-04 13:54 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 4:12
protectorHeath Stewart14-Jul-04 4:12 
GeneralRe: Child Control Painting problem(For the last time) Pin
Jon_Slaughter14-Jul-04 5:28
Jon_Slaughter14-Jul-04 5:28 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 6:01
protectorHeath Stewart14-Jul-04 6:01 
GeneralBigger ImageList Pin
blankg13-Jul-04 11:50
blankg13-Jul-04 11:50 
GeneralRe: Bigger ImageList Pin
Heath Stewart14-Jul-04 4:01
protectorHeath Stewart14-Jul-04 4:01 
Generaldisable network card throw c# Pin
vipervip13-Jul-04 11:06
vipervip13-Jul-04 11:06 
Generalconfig file in console app to store connection string help Pin
mtbjr13-Jul-04 10:25
mtbjr13-Jul-04 10:25 
GeneralRe: config file in console app to store connection string help Pin
Heath Stewart14-Jul-04 3:56
protectorHeath Stewart14-Jul-04 3:56 
GeneralPointers and dereferencing Pin
frank29713-Jul-04 8:01
frank29713-Jul-04 8:01 
I am wrapping a Dll function with managed code and am confused about the equivalent of pointers and the & symbol in C. I am working with two C functions wrapped in a Dllimport:

[DllImport("msg.dll",CharSet=CharSet.Ansi)]
public static extern int MsgConnect (int lAPIVersion, string lpcszTopic, ref OPERATOR lpOperator, ref IntPtr lphContext);

Where the C functional prorotype was:
MSGAPIFUNCTION MsgConnect(long lMsgAPIVersion, const char *lpcszTopic, LPOPERATOR lpOperator, MSGHANDLE *lphContext);

The lphContext is a handle, specified in C as:
typedef void *MSGHANDLE

I am trying to import this function:
MSGAPIFUNCTION MsgStartMessage(MSGHANDLE hContext, const char *lpcszActivityName, const char *lpcszMsgName, int bOriginatorVerified)

I have defined it as:
[DllImport("msg.dll",CharSet=CharSet.Ansi)]
public static extern int MsgStartMessage (ref IntPtr hContext, ref string lpcszActivityName, ref string lpcszMsgName, int bOriginatorVerified);

Note it is using the variable itself, not a pointer to it like the previous prototype. I implemented the pointer as IntPtr, not sure how to implement this - do I need to convert it to an Int?

Thanks in advance.

GeneralRe: Pointers and dereferencing Pin
Heath Stewart13-Jul-04 8:34
protectorHeath Stewart13-Jul-04 8:34 
Generalcapturing events when application closes Pin
vista2713-Jul-04 7:59
vista2713-Jul-04 7:59 

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.