DllImport /非托管代码 [英] DllImport / unmanaged code

查看:89
本文介绍了DllImport /非托管代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常沮丧。我正在为呼叫中心构建c#应用程序

,并使用第三方API访问某些硬件的
。当使用

windows控制台开发和测试我的课程时,应用程序运行完美,但是一旦

我从ac #windows应用程序内部调用该类

程序冻结,崩溃等...


必须有一种方法可以在Windows应用程序内完成这项工作

因为它运行良好的命令line app。


请在这个艰难的时刻欢迎任何想法

我的生活


Jim

解决方案

您使用的是win98吗?


它是否在Win98上使用System.Timers.Timer?我发现在win98中似乎有一个线程池问题(我的猜测在这里),导致

计时器(所有这些)冻结。主ui仍然响应,但计时器

事件停止。我用

System.Windows.Forms.Timer替换了System.Timers.Timer,应用程序开始工作。这是

with .NET 1.1。


-Larry


" Jim" < JE ****** @ nationsfirstcorp.com>在留言中写道

news:07 **************************** @ phx.gbl ... < blockquote class =post_quotes>我非常沮丧。我正在为呼叫中心构建c#应用程序
并使用第三方API访问某些硬件。当使用
Windows控制台开发和测试我的课程时,应用程序运行完美,但是一旦我从ac #windows应用程序内部调用该类,
程序会冻结,崩溃等...

必须有办法让这个工作在Windows应用程序中运行
因为它作为一个命令行应用程序运行良好。

请在这个尝试欢迎任何想法生活中的时间

Jim



我在所有机器,客户端和开发上使用XP专业版。


我正在使用计时器,我将使用计时器测试这个结果,并将结果发布。我正在使用的计时器是

System.Windows.Forms.Timer。

-----原始消息---- -
你在使用win98吗?

它是否在Win98上使用System.Timers.Timer?我发现
似乎在win98中存在线程池问题(我在这里猜测),这些
会导致thetimers(所有这些)冻结。主要的ui仍然是
响应,但是时间停止了。我用System.Windows.Forms.Timer替换了System.Timers.Timer,应用程序启动了
工作。这与.NET 1.1有关。

-Larry

Jim < JE ****** @ nationsfirstcorp.com>在消息中写道
新闻:07 **************************** @ phx.gbl ...

我非常沮丧。我正在为呼叫中心构建c#
应用程序,并使用第三方API来
访问某些硬件。当使用
Windows控制台开发和测试我的课程时,应用程序运行完美,但是一旦我从ac #windows应用程序内部调用该类,

程序冻结,崩溃等...

必须有一种方法可以在Windows
应用程序中运行这项工作,因为它可以作为命令行应用程序运行。

请在此尝试时欢迎任何想法我生命中的时间


Jim





已删除所有计时器仍然崩溃。


非常令人沮丧,因为这是我用作

命令行应用的同一类。

-----原始消息-----
您使用的是win98吗?

它是否在Win98上使用System.Timers.Timer?我发现
似乎在win98中存在线程池问题(我在这里猜测),这些
会导致thetimers(所有这些)冻结。主要的ui仍然是
响应,但是时间停止了。我用System.Windows.Forms.Timer替换了System.Timers.Timer,应用程序启动了
工作。这与.NET 1.1有关。

-Larry

Jim < JE ****** @ nationsfirstcorp.com>在消息中写道
新闻:07 **************************** @ phx.gbl ...

我非常沮丧。我正在为呼叫中心构建c#
应用程序,并使用第三方API来
访问某些硬件。当使用
Windows控制台开发和测试我的课程时,应用程序运行完美,但是一旦我从ac #windows应用程序内部调用该类,

程序冻结,崩溃等...

必须有一种方法可以在Windows
应用程序中运行这项工作,因为它可以作为命令行应用程序运行。

请在此尝试时欢迎任何想法我生命中的时间


Jim





I am extremely frustrated. I am building c# application
for a call center and am using a third party API to access
some hardware. When develop and test my class using the
windows console the application runs flawlessly, but once
I call the class from inside a c# windows application the
program freezes, crashes etc...

there must be a way to make this work inside a windows app
as it run great as a command line app.

Please any ideas would be welcomed at this trying time in
my life

Jim

解决方案

Are you using win98?

Does it use System.Timers.Timer on Win98? I found that there appears to be
a threadpool problem(my guess here) in win98 with these that causes the
timers (all of them) to freeze. The main ui still responds, but the timer
events stop. I replaced the System.Timers.Timer with
System.Windows.Forms.Timer and the application started working. This was
with .NET 1.1.

-Larry

"Jim" <je******@nationsfirstcorp.com> wrote in message
news:07****************************@phx.gbl...

I am extremely frustrated. I am building c# application
for a call center and am using a third party API to access
some hardware. When develop and test my class using the
windows console the application runs flawlessly, but once
I call the class from inside a c# windows application the
program freezes, crashes etc...

there must be a way to make this work inside a windows app
as it run great as a command line app.

Please any ideas would be welcomed at this trying time in
my life

Jim



I am using XP Pro on all machines, client and development.

I am using a Timer, and I will test this with the timers
off and post the findings. The timer I am using is the
System.Windows.Forms.Timer.

-----Original Message-----
Are you using win98?

Does it use System.Timers.Timer on Win98? I found that there appears to bea threadpool problem(my guess here) in win98 with these that causes thetimers (all of them) to freeze. The main ui still responds, but the timerevents stop. I replaced the System.Timers.Timer with
System.Windows.Forms.Timer and the application started working. This waswith .NET 1.1.

-Larry

"Jim" <je******@nationsfirstcorp.com> wrote in message
news:07****************************@phx.gbl...

I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the
windows console the application runs flawlessly, but once I call the class from inside a c# windows application the program freezes, crashes etc...

there must be a way to make this work inside a windows app as it run great as a command line app.

Please any ideas would be welcomed at this trying time in my life

Jim


.



removed all timers and still crashing.

extremely frustrating as this is the same class I use as a
command line appliation.

-----Original Message-----
Are you using win98?

Does it use System.Timers.Timer on Win98? I found that there appears to bea threadpool problem(my guess here) in win98 with these that causes thetimers (all of them) to freeze. The main ui still responds, but the timerevents stop. I replaced the System.Timers.Timer with
System.Windows.Forms.Timer and the application started working. This waswith .NET 1.1.

-Larry

"Jim" <je******@nationsfirstcorp.com> wrote in message
news:07****************************@phx.gbl...

I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the
windows console the application runs flawlessly, but once I call the class from inside a c# windows application the program freezes, crashes etc...

there must be a way to make this work inside a windows app as it run great as a command line app.

Please any ideas would be welcomed at this trying time in my life

Jim


.



这篇关于DllImport /非托管代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆