Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to find the Position of an element (Html Tag) on an HTML page using c#? Pin
dan!sh 29-Jul-09 19:04
professional dan!sh 29-Jul-09 19:04 
QuestionWebBrowser Pin
nelsonpaixao29-Jul-09 18:09
nelsonpaixao29-Jul-09 18:09 
QuestionHow to make repeated calls to a DLL from C#? Pin
J.G.W29-Jul-09 17:09
J.G.W29-Jul-09 17:09 
AnswerRe: How to make repeated calls to a DLL from C#? Pin
Richard Andrew x6429-Jul-09 17:12
professionalRichard Andrew x6429-Jul-09 17:12 
AnswerRe: How to make repeated calls to a DLL from C#? Pin
Vimalsoft(Pty) Ltd29-Jul-09 21:06
professionalVimalsoft(Pty) Ltd29-Jul-09 21:06 
GeneralRe: How to make repeated calls to a DLL from C#? Pin
J.G.W29-Jul-09 23:23
J.G.W29-Jul-09 23:23 
GeneralRe: How to make repeated calls to a DLL from C#? Pin
Vimalsoft(Pty) Ltd29-Jul-09 23:38
professionalVimalsoft(Pty) Ltd29-Jul-09 23:38 
GeneralRe: How to make repeated calls to a DLL from C#? Pin
J.G.W30-Jul-09 17:27
J.G.W30-Jul-09 17:27 
Hi
I read the articles trying to understand them in relation to my problem. I tried the various methods again and I still get garbage returned from the Matlab DLL. Below is the simplified codes of my latest try:

class DllWrapper
{
       ...

       [DllImport(@"libtest.dll")]
       private static extern void mlfTest(int num, ref IntPtr theOutput, [In]IntPtr theInput);
       ...

       public static double CallDLL(string input)
       {
           ...
           double[] ans = new double[1];
          
           GCHandle gch = GCHandle.Alloc(ans);

           //initialize libraries
           ...          

           //initialize arguments
           IntPtr inVal = mxCreateString(input);
           IntPtr outVal = IntPtr.Zero;
           outVal = Marshal.UnsafeAddrOfPinnedArrayElement(ans, 0);
                        
           //call library function
           mlfTest(1, ref outVal, inVal);
            
           //get return value        
           Marshal.Copy(mxGetPr(outVal), ans, 0, 1);
                        
           //terminate libraries
           ...
                        
           gch.Free();
           return ans[0];
       }
}


static void Main(string[] args)
{
    string path = "input";

    ....

    for (int i = 0; i < 3;  i++)
    {
        double retDouble = DllWrapper.CallDLL(path);

        Console.WriteLine("the return value is : " + retDouble);
	i++;
    }
}

GeneralRe: How to make repeated calls to a DLL from C#? Pin
J.G.W10-Aug-09 16:31
J.G.W10-Aug-09 16:31 
GeneralRe: How to make repeated calls to a DLL from C#? Pin
Blikkies30-Jul-09 1:04
professionalBlikkies30-Jul-09 1:04 
QuestionWordlist.txt file hide? Pin
alrsds29-Jul-09 16:29
alrsds29-Jul-09 16:29 
AnswerRe: Wordlist.txt file hide? Pin
Mycroft Holmes29-Jul-09 17:39
professionalMycroft Holmes29-Jul-09 17:39 
GeneralRe: Wordlist.txt file hide? Pin
harold aptroot29-Jul-09 19:56
harold aptroot29-Jul-09 19:56 
GeneralRe: Wordlist.txt file hide? Pin
Mycroft Holmes29-Jul-09 20:03
professionalMycroft Holmes29-Jul-09 20:03 
GeneralRe: Wordlist.txt file hide? Pin
harold aptroot29-Jul-09 20:28
harold aptroot29-Jul-09 20:28 
AnswerRe: Wordlist.txt file hide? Pin
mustang8629-Jul-09 19:42
mustang8629-Jul-09 19:42 
QuestionC# version Pin
onlinegurl29-Jul-09 15:27
onlinegurl29-Jul-09 15:27 
QuestionI need HELP Pin
3.3..329-Jul-09 12:51
3.3..329-Jul-09 12:51 
AnswerRe: I need HELP Pin
Blue_Boy29-Jul-09 13:31
Blue_Boy29-Jul-09 13:31 
AnswerRe: I need HELP Pin
Christian Graus29-Jul-09 13:33
protectorChristian Graus29-Jul-09 13:33 
AnswerRe: I need HELP Pin
nelsonpaixao29-Jul-09 13:46
nelsonpaixao29-Jul-09 13:46 
AnswerMust...follow...Chris'...guidelines... Pin
leckey29-Jul-09 14:28
leckey29-Jul-09 14:28 
GeneralRe: Must...follow...Chris'...guidelines... Pin
Christian Graus29-Jul-09 14:56
protectorChristian Graus29-Jul-09 14:56 
QuestionHelp with sendkeys. Pin
xobx29-Jul-09 7:38
xobx29-Jul-09 7:38 
AnswerRe: Help with sendkeys. Pin
Adam Maras29-Jul-09 8:36
Adam Maras29-Jul-09 8:36 

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.