Click here to Skip to main content
15,890,741 members
Home / Discussions / C#
   

C#

 
AnswerRe: who can tell me how to not to use WMI to change Ip address? Pin
Abhinav S18-Oct-13 21:46
Abhinav S18-Oct-13 21:46 
GeneralRe: who can tell me how to not to use WMI to change Ip address? Pin
tdcmystere20-Oct-13 6:48
tdcmystere20-Oct-13 6:48 
AnswerRe: who can tell me how to not to use WMI to change Ip address? Pin
tdcmystere20-Oct-13 6:47
tdcmystere20-Oct-13 6:47 
QuestionHow to read DTD file and generate xml tags in c# Pin
Member 1034427018-Oct-13 1:27
Member 1034427018-Oct-13 1:27 
AnswerRe: How to read DTD file and generate xml tags in c# Pin
Richard MacCutchan18-Oct-13 1:54
mveRichard MacCutchan18-Oct-13 1:54 
Questionfunction call from an c++ dll in c# Pin
Willow200817-Oct-13 20:17
Willow200817-Oct-13 20:17 
SuggestionRe: function call from an c++ dll in c# Pin
Richard MacCutchan17-Oct-13 21:36
mveRichard MacCutchan17-Oct-13 21:36 
GeneralRe: function call from an c++ dll in c# Pin
Willow200817-Oct-13 23:47
Willow200817-Oct-13 23:47 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Data;


namespace ConsoleApplication1
{
    class Program
    {
        [DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
        extern static int Fct1();

        [DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
        extern static int Fct2();

        [DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
        extern static int Fct3(IntPtr Size, byte[] data, int timeout);

        [DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
        extern static int Fct4(int size, byte[] data);

        static void Main(string[] args)
        {
            byte[] data = new byte[5] {0x01,0x02,0x03,0x04,0x05};


            int result = Fct1();
            Console.WriteLine(result);

            result = Fct2((IntPtr)2, data, 3);
            Console.WriteLine(result);

            result = Fct3(3, data);
            Console.WriteLine(result);

            result = Fct4();
            Console.WriteLine(result);


        }
    }
}


ErrorMessage:
AccessViolation at Fct2
GeneralRe: function call from an c++ dll in c# Pin
Richard MacCutchan18-Oct-13 0:38
mveRichard MacCutchan18-Oct-13 0:38 
GeneralRe: function call from an c++ dll in c# Pin
Willow200818-Oct-13 0:54
Willow200818-Oct-13 0:54 
GeneralRe: function call from an c++ dll in c# Pin
OriginalGriff18-Oct-13 1:02
mveOriginalGriff18-Oct-13 1:02 
GeneralRe: function call from an c++ dll in c# Pin
Richard MacCutchan18-Oct-13 1:51
mveRichard MacCutchan18-Oct-13 1:51 
GeneralRe: function call from an c++ dll in c# Pin
_Erik_18-Oct-13 5:35
_Erik_18-Oct-13 5:35 
GeneralRe: function call from an c++ dll in c# Pin
Willow200822-Oct-13 4:02
Willow200822-Oct-13 4:02 
AnswerRe: function call from an c++ dll in c# Pin
Bernhard Hiller17-Oct-13 21:42
Bernhard Hiller17-Oct-13 21:42 
AnswerRe: function call from an c++ dll in c# Pin
OriginalGriff17-Oct-13 21:44
mveOriginalGriff17-Oct-13 21:44 
AnswerRe: function call from an c++ dll in c# Pin
Freak3017-Oct-13 21:58
Freak3017-Oct-13 21:58 
QuestionTreeview in menu + asp.net Pin
jojoba2017-Oct-13 5:41
jojoba2017-Oct-13 5:41 
AnswerRe: Treeview in menu + asp.net Pin
Eddy Vluggen17-Oct-13 6:50
professionalEddy Vluggen17-Oct-13 6:50 
AnswerRe: Treeview in menu + asp.net Pin
Abhinav S17-Oct-13 17:08
Abhinav S17-Oct-13 17:08 
GeneralRe: Treeview in menu + asp.net Pin
jojoba2018-Oct-13 19:04
jojoba2018-Oct-13 19:04 
Questioncursor Pin
litao517-Oct-13 4:29
litao517-Oct-13 4:29 
AnswerRe: cursor Pin
Eddy Vluggen17-Oct-13 5:12
professionalEddy Vluggen17-Oct-13 5:12 
GeneralRe: cursor Pin
litao517-Oct-13 18:10
litao517-Oct-13 18:10 
AnswerRe: cursor Pin
BillWoodruff17-Oct-13 16:19
professionalBillWoodruff17-Oct-13 16:19 

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.