Click here to Skip to main content
       

C#

 
QuestionC# Console.ReadLine runns out of memory Pinmemberdcof1-Mar-13 8:45 
AnswerRe: C# Console.ReadLine runns out of memory PinmemberJibesh1-Mar-13 9:13 
AnswerRe: C# Console.ReadLine runns out of memory PinmvpOriginalGriff1-Mar-13 21:59 
GeneralRe: C# Console.ReadLine runns out of memory Pinmemberdcof2-Mar-13 8:07 
GeneralRe: C# Console.ReadLine runns out of memory Pinmemberjschell2-Mar-13 10:26 
GeneralRe: C# Console.ReadLine runns out of memory Pinmemberdcof2-Mar-13 11:26 
GeneralRe: C# Console.ReadLine runns out of memory Pinmemberjschell3-Mar-13 5:54 
QuestionTrying to use child class method by overriding parent PinmemberMichCl1-Mar-13 8:26 
AnswerRe: Trying to use child class method by overriding parent PinmvpOriginalGriff1-Mar-13 8:41 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc [modified] PinmemberMichCl1-Mar-13 9:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pinmemberjschell2-Mar-13 10:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc PinmemberMichCl5-Mar-13 2:23 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc PinmemberMichCl5-Mar-13 9:40 
QuestionPassing parameters from unmanaged code to managed code by reference PinmemberJimmyRopes1-Mar-13 5:42 
Is it possible to pass parameters from unmanaged code to managed code by reference?
 
I am programming agents for the Metta Trader 4 (MT4) platform using MetaQuotes Language 4 (MQL4); a C like language.
 
Normally one would use C++ to generate DLLs but I would like to use C# if I could because when you release something in C++ it is frozen in time as opposed to when you release something in C#. With C# if problems are detected in the underlieing classes they are corrected by normal updates of the .NET platform. This is an advantage I would like to take advantage of to simplify maintenance of products I hope to sell.
 
I will need to pass large arrays of market data to these DLLs for analysis and would like to do this by reference.
 
Here is an example of how to pass an array by value:
 
 [DllExport(EntryPoint = "SumIntegerArray")]
        public static int Sum([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)]int[] values, int count)
        {
            int result = 0;
 
            for (int i = 0; i < count; i++)
                result += values[i];
 
            return result;
        }
How would I pass the array by reference to the DLL?

The report of my death was an exaggeration - Mark Twain

Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems

I'm on-line therefore I am.
JimmyRopes


GeneralRe: Passing parameters from unmanaged code to managed code by reference Pinmemberharold aptroot1-Mar-13 7:13 
GeneralRe: Passing parameters from unmanaged code to managed code by reference PinmemberJimmyRopes1-Mar-13 7:39 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pinmemberharold aptroot1-Mar-13 7:50 
GeneralRe: Passing parameters from unmanaged code to managed code by reference PinmemberJimmyRopes1-Mar-13 12:50 
AnswerRe: Passing parameters from unmanaged code to managed code by reference PinmvpEddy Vluggen1-Mar-13 8:31 
GeneralRe: Passing parameters from unmanaged code to managed code by reference PinmemberJimmyRopes1-Mar-13 14:15 
Questionrecord mouse coordinates when mouse is clicked on inkcanvas PinmemberNaman20071-Mar-13 4:59 
AnswerRe: record mouse coordinates when mouse is clicked on inkcanvas PinmemberSimon_Whale1-Mar-13 5:30 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas PinmemberNaman20071-Mar-13 5:35 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas PinmemberSimon_Whale1-Mar-13 5:38 
QuestionDotSpatial.Positioning.NmeaInterpreter Pinmemberloctrice1-Mar-13 3:01 
AnswerRe: DotSpatial.Positioning.NmeaInterpreter PinmvpEddy Vluggen1-Mar-13 4:57 
GeneralRe: DotSpatial.Positioning.NmeaInterpreter Pinmemberloctrice1-Mar-13 5:04 
GeneralRe: DotSpatial.Positioning.NmeaInterpreter PinmvpEddy Vluggen1-Mar-13 5:10 
Questionsdk PinmemberRAJESHSELVARAJ28-Feb-13 23:04 
AnswerRe: sdk PinprotectorPete O'Hanlon28-Feb-13 23:24 
AnswerRe: sdk PinmvpDave Kreskowiak1-Mar-13 2:21 
QuestionIssue using the StreamWritter Class PinmemberTwiztedFreek28-Feb-13 13:16 
AnswerRe: Issue using the StreamWritter Class PinmemberTwiztedFreek28-Feb-13 13:18 
AnswerRe: Issue using the StreamWritter Class PinmemberGarth J Lancaster28-Feb-13 14:08 
AnswerRe: Issue using the StreamWritter Class PinmemberJegan Thiyagesan28-Feb-13 23:33 
AnswerRe: Issue using the StreamWritter Class PinmentorKeith Barrow1-Mar-13 1:06 
AnswerRe: Issue using the StreamWritter Class PinmemberDefens931-Mar-13 9:35 
QuestionCopy username from text file to website PinmemberMuhammad Sayyam28-Feb-13 2:17 
AnswerRe: Copy username from text file to website PinmentorDaveyM6928-Feb-13 3:07 
GeneralRe: Copy username from text file to website PinmvpRichard MacCutchan28-Feb-13 3:23 
GeneralRe: Copy username from text file to website PinmentorDaveyM6928-Feb-13 10:30 
GeneralRe: Copy username from text file to website PinmemberMuhammad Sayyam2-Mar-13 20:19 
GeneralRe: Copy username from text file to website PinmentorDaveyM695-Mar-13 3:08 
GeneralRe: Copy username from text file to website PinmentorDaveyM697-Mar-13 21:51 
Questiontooth numbers PinmemberJassim Rahma28-Feb-13 0:35 
AnswerRe: tooth numbers PinprotectorPete O'Hanlon28-Feb-13 1:11 
AnswerRe: tooth numbers PinmemberGuyThiebaut28-Feb-13 2:03 
QuestionVS2012, C# Office 2007 problem PinmemberDaytona67527-Feb-13 9:34 
AnswerRe: VS2012, C# Office 2007 problem PinmvpRichard MacCutchan27-Feb-13 21:58 
AnswerRe: VS2012, C# Office 2007 problem PinmvpOriginalGriff27-Feb-13 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 23 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid