Российский производитель и разработчик сертифицированного измерительного оборудования с 1987 года


wlcomp, E14-440 ,С#

Вы не вошли.

 Поиск | Регистрация | Вход 

Иванн
26.03.2016 15:09:58
#1

Гость

wlcomp, E14-440 ,С#

class Program
    {
        static void Main(string[] args)
        {
            uint hDll;
            uint hObj;
            uint Err = 0;
            string s = "lcomp.dll";
            Console.WriteLine("Hello World!!!");
            hDll = wlcomp.LoadAPIDLL(s);
            Console.WriteLine(hDll.ToString());
            hObj = wlcomp.CallCreateInstance(ref hDll, 1, ref Err);
            Console.WriteLine(hObj.ToString());
            Console.WriteLine(Err.ToString());
            wlcomp.OpenLDevice(ref hObj);
      }
    static class wlcomp
    {
        public static uint L_STREAM_ADC = 1;
        [DllImport("wlcomp.dll", CallingConvention=CallingConvention.Cdecl)]
        public static extern uint LoadAPIDLL(string dllname);
        [DllImport("wlcomp.dll")]
        public static extern uint FreeAPIDLL(ref uint hDll);
        [DllImport("wlcomp.dll", CallingConvention=CallingConvention.Cdecl)]
        public static extern uint CallCreateInstance(ref uint hDll, uint slot, ref uint Err); // return handle for new iface
        [DllImport("wlcomp.dll")]
        public static extern uint PlataTest(ref uint hIfc);
        [DllImport("wlcomp.dll")]
        public static extern uint GetSlotParam(ref uint hIfc, ref SLOT_PARAM slPar);
        [DllImport("wlcomp.dll", CallingConvention = CallingConvention.Winapi)]
        public static extern uint OpenLDevice(ref uint hIfc);
}

в OpenLDevice вылетает ошибка "Попытка чтения или записи в защищенную память".
Подскажите пожалуйста в чем ошибка, сей пример нашел у вас на форуме..
Заранее благодарен!!!

Контакты

Адрес: 117105, Москва, Варшавское шоссе, д. 5, корп. 4

Многоканальный телефон:+7 (495) 785-95-25

Письма и запросы: lcard@lcard.ru
Отдел продаж: sale@lcard.ru
Техническая поддержка: support@lcard.ru

Время работы: с 9-00 до 19-00 мск