Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

korrea80

@korrea80
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MarshalDirectiveException
    K korrea80

    Hi! Thanks for the info Richard. The solution was write for Hans Passans in StackOverflow:

        \[DllImport("RBRPlugin.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "GetDataArray")\]
        public static extern GetPluginData GetDataArray(int number);
        
        \[StructLayoutAttribute(LayoutKind.Sequential)\]
        public struct GetPluginData
        {
            public unsafe fixed int data\[22\];
        }
    
        public GetPluginData temp1 = new GetPluginData();
    
        private void button1\_Click(object sender, EventArgs e)
        {
            GetPluginData test = GetDataArray(1);
            temp1 = test;
            unsafe
            {
                fixed (GetPluginData\* p = &temp1)
                {
                    p->data\[0\] = 1;
                }
            }
        }
    

    Like you read, the principal problem was the array in GetPluginData struct, it must be fixed. Thaks!

    C# csharp help

  • MarshalDirectiveException
    K korrea80

    Hi all!. I would like use unmanaged code from C in C#. I built a DLL with C code with this functions:

    struct GetPluginData
    {
    int data[22];
    };

    DLLEXPORT extern "C" __declspec (dllexport) GetPluginData GetDataArray(int number);

    In C# I've got this code:

    [StructLayoutAttribute(LayoutKind.Sequential, Pack=1)]
    public unsafe struct GetPluginData
    {
    /// int[22]
    [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 22, ArraySubType = UnmanagedType.I4)]
    public int[] data;
    }

    [DllImport("RBRPlugin.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetDataArray")]
    [return: MarshalAs(UnmanagedType.Struct)]
    public static extern GetPluginData GetDataArray(int number);

    In button event or othe place code, I wrote this:

    GetPluginData tes = GetDataArray(1);

    And I'm getting the error: The type signature of this method is not PInvoke compatible. I'm looking for information throught google, but no result found... Thanks in advance!

    C# csharp help

  • Problem whit Internet and .NET
    K korrea80

    Hi all!. I have detected one problem with Agilent Vee 7.52 and .NET Framework 2.0. This morning my network did not work, and if I wanted to open a .vee file with some .NET objects, it taked a long time to open. Later, when the network worked, the file could be opened correctly. Does anybody have this problem?? Thanks and regards.

    .NET (Core and Framework) csharp dotnet sysadmin help question

  • Blocks Aplicattion
    K korrea80

    Hi. This is the problem. Agilent Vee crash with .NET Threading... :( The other question is, only GUI stop or all program stop??? If only stop the gui, no problem, the most important its a second work... Thank your for your ideas ;). Best Regards.

    .NET (Core and Framework) csharp dotnet help question

  • Blocks Aplicattion
    K korrea80

    Hi all!. Im using Agilent Vee and .NET Framework 2.0. Agilent Vee its a visual language and I can use all libs of .NET Framework 2.0. I want to create some forms who capture some instrument status, I create a form, show, etc ... ok all perfect. But if I move the window, the aplication stop the adquisition. And restart adquisition when I dont move the window. Anyone can help me???? Thanks and regards. P.D. Sorry for my english...

    .NET (Core and Framework) csharp dotnet help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups