Click here to Skip to main content
15,888,020 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to fetch the user filled fields in PDF form Pin
Wonde Tadesse6-Dec-11 13:09
professionalWonde Tadesse6-Dec-11 13:09 
GeneralRe: How to fetch the user filled fields in PDF form Pin
Ravi k rao6-Dec-11 21:25
Ravi k rao6-Dec-11 21:25 
QuestionHow to pass null ref type. Pin
__John_6-Dec-11 3:18
__John_6-Dec-11 3:18 
AnswerRe: How to pass null ref type. Pin
Luc Pattyn6-Dec-11 4:17
sitebuilderLuc Pattyn6-Dec-11 4:17 
AnswerRe: How to pass null ref type. Pin
BobJanova6-Dec-11 4:21
BobJanova6-Dec-11 4:21 
GeneralRe: How to pass null ref type. Pin
__John_6-Dec-11 4:36
__John_6-Dec-11 4:36 
GeneralRe: How to pass null ref type. Pin
BobJanova6-Dec-11 5:34
BobJanova6-Dec-11 5:34 
GeneralRe: How to pass null ref type. Pin
DaveyM696-Dec-11 7:07
professionalDaveyM696-Dec-11 7:07 
Just change the DllImport decorated function to use IntPtr instead of double:
C#
// GetMinMaxVals(double* pdMinX, double* pdMaxX, double* pdMinY, double* pdMaxY);
// "I only need a value for pdMaxX"
// No return type in your example was shown so using void here! Change as required.
[DllImport("thedll.dll", SetLastError = true)]
public static extern void GetMinMaxVals(IntPtr pdMinX, ref double pdMaxX, IntPtr pdMinY, IntPtr pdMaxY);

You can then call this like:
C#
double pdMaxX = 0;
GetMinMaxVals(IntPtr.Zero, ref pdMaxX, IntPtr.Zero, IntPtr.Zero);

Change the value of pdMaxX to whatever is suitable for the call. If it only passes a value out and doesn't require one in, then use out instead of ref.
C#
[DllImport("thedll.dll", SetLastError = true)]
public static extern void GetMinMaxVals(IntPtr pdMinX, out double pdMaxX, IntPtr pdMinY, IntPtr pdMaxY);

C#
double pdMaxX;
GetMinMaxVals(IntPtr.Zero, out pdMaxX, IntPtr.Zero, IntPtr.Zero);

If the function returns a value then amend as required.
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



AnswerRe: How to pass null ref type. Pin
Richard MacCutchan6-Dec-11 5:01
mveRichard MacCutchan6-Dec-11 5:01 
GeneralRe: How to pass null ref type. Pin
DaveyM696-Dec-11 12:27
professionalDaveyM696-Dec-11 12:27 
GeneralRe: How to pass null ref type. Pin
Richard MacCutchan6-Dec-11 13:13
mveRichard MacCutchan6-Dec-11 13:13 
AnswerRe: How to pass null ref type. Pin
Peter_in_27806-Dec-11 13:04
professionalPeter_in_27806-Dec-11 13:04 
GeneralRe: How to pass null ref type. Pin
__John_7-Dec-11 4:36
__John_7-Dec-11 4:36 
QuestionMultilingual keyboard support for C# touchscreen application Pin
PetersCodeProject6-Dec-11 3:06
PetersCodeProject6-Dec-11 3:06 
QuestionRun code if event log entry is older than 12 hours - could you help Pin
CCodeNewbie6-Dec-11 0:15
CCodeNewbie6-Dec-11 0:15 
AnswerRe: Run code if event log entry is older than 12 hours - could you help Pin
Eddy Vluggen6-Dec-11 8:07
professionalEddy Vluggen6-Dec-11 8:07 
QuestionLinq operation [Grouping and Sum] Pin
nitin_ion5-Dec-11 23:16
nitin_ion5-Dec-11 23:16 
AnswerRe: Linq operation [Grouping and Sum] Pin
OriginalGriff6-Dec-11 1:20
mveOriginalGriff6-Dec-11 1:20 
QuestionOpenDialogFile Issue Pin
PDTUM5-Dec-11 7:42
PDTUM5-Dec-11 7:42 
AnswerRe: OpenDialogFile Issue Pin
fjdiewornncalwe5-Dec-11 8:30
professionalfjdiewornncalwe5-Dec-11 8:30 
GeneralRe: OpenDialogFile Issue Pin
PDTUM5-Dec-11 12:29
PDTUM5-Dec-11 12:29 
AnswerRe: OpenDialogFile Issue Pin
OriginalGriff5-Dec-11 8:37
mveOriginalGriff5-Dec-11 8:37 
GeneralRe: OpenDialogFile Issue Pin
Luc Pattyn5-Dec-11 10:11
sitebuilderLuc Pattyn5-Dec-11 10:11 
GeneralRe: OpenDialogFile Issue Pin
OriginalGriff5-Dec-11 20:47
mveOriginalGriff5-Dec-11 20:47 
GeneralRe: OpenDialogFile Issue Pin
BillWoodruff6-Dec-11 9:54
professionalBillWoodruff6-Dec-11 9:54 

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.