FILE结构 - 将C DLL移植到其他语言中 [英] FILE structure - porting C DLL into other languages

查看:69
本文介绍了FILE结构 - 将C DLL移植到其他语言中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

任何人都可以向我解释如何将FILE结构移植到其他语言中。

我有一个DLL库,这个库中的函数将FILE *作为

参数。我想创建一个Delphi接口,因此我必须

export功能名称和功能参数。通常的数据类型和结构很容易,但我不知道如何移植文件

结构。


Tahnks。


Jindra

Hello,
can anybody explain me how to port FILE structure into other languages.
I have an DLL library and functions in this library take FILE* as a
parameter. I want to make an interface into Delp thus I must
"export" function names and parameters of the function. It is easy for
usual data types and structures but I don''t know how to port FILE
structure.

Tahnks.

Jindra

推荐答案

jp **** @ gmail.com 写道:
您好,
任何人都可以解释我如何将FILE结构移植到其他语言中。
我有一个DLL库,这个库中的函数将FILE *作为
参数。我想在Delphi中建立一个接口,因此我必须导出。功能名称和功能参数。通常的数据类型和结构很容易,但我不知道如何移植FILE
结构。

Tahnks。

Jindra
Hello,
can anybody explain me how to port FILE structure into other languages.
I have an DLL library and functions in this library take FILE* as a
parameter. I want to make an interface into Delp thus I must
"export" function names and parameters of the function. It is easy for
usual data types and structures but I don''t know how to port FILE
structure.

Tahnks.

Jindra




查看IDE帮助系统中的流


Xavier



look at stream in your IDE help system

Xavier


2006年3月16日星期四08:41, jp****@gmail.com 认为(

< 11 ********************* @ i40g2000cwc.googlegroups.com>):
On Thursday 16 March 2006 08:41, jp****@gmail.com opined (in
<11*********************@i40g2000cwc.googlegroups. com>):
你好,<任何人都可以解释我如何将FILE结构移植到其他语言中。我有一个DLL库,这个库中的函数以
FILE *作为参数。我想在Delphi中建立一个接口,因此我必须导出。功能名称和功能参数。对于通常的数据类型和结构来说很容易,但我不知道如何移植
FILE结构。
Hello,
can anybody explain me how to port FILE structure into other
languages. I have an DLL library and functions in this library take
FILE* as a parameter. I want to make an interface into Delp thus I
must "export" function names and parameters of the function. It is
easy for usual data types and structures but I don''t know how to port
FILE structure.




你应该看一下用于创建库的C实现,

并查看FILE在那里声明的确切程度。然后,您将有足够的信息来将字段映射到Delphi所需的任何内容。你很可能需要一个接口层。


-

BR,弗拉基米尔


最近的研究倾向于表明,令人憎恶的无人

正被Prohibitive拖延者取代。

- CN帕金森



You should look into the C implementation used to create the library,
and see how exactly is FILE declared there. You''ll then hopefully have
enough information to map the fields to whatever Delphi requires. You
will most likely need an interface layer for this.

--
BR, Vladimir

Recent research has tended to show that the Abominable No-Man
is being replaced by the Prohibitive Procrastinator.
-- C.N. Parkinson


" Vladimir S. Oka" <无**** @ btopenworld.com>写道:
"Vladimir S. Oka" <no****@btopenworld.com> writes:
2006年3月16日星期四08:41, jp****@gmail.com opined(在
< 11 ********************* @ i40g2000cwc.googlegroups.com>):
On Thursday 16 March 2006 08:41, jp****@gmail.com opined (in
<11*********************@i40g2000cwc.googlegroups. com>):
可以任何人解释如何将FILE结构移植到其他语言中。我有一个DLL库,这个库中的函数以
FILE *作为参数。我想在Delphi中建立一个接口,因此我必须导出。功能名称和功能参数。对于通常的数据类型和结构来说很容易,但我不知道如何移植文件结构。
can anybody explain me how to port FILE structure into other
languages. I have an DLL library and functions in this library take
FILE* as a parameter. I want to make an interface into Delp thus I
must "export" function names and parameters of the function. It is
easy for usual data types and structures but I don''t know how to port
FILE structure.



你应该查看使用的C实现创建库,
并查看FILE在那里的确切内容。然后,您将有足够的信息将字段映射到德尔福需要的任何字段。你很可能需要一个接口层。



You should look into the C implementation used to create the library,
and see how exactly is FILE declared there. You''ll then hopefully have
enough information to map the fields to whatever Delphi requires. You
will most likely need an interface layer for this.




我不知道这是否是最好的方法(部分是因为我知道

很少关于Delphi)。


C程序一般不使用FILE结构本身。他们只使用指向FILE结构的指针(类型为FILE *)。可以将FILE *视为一个/或
opaque类型,恰好可以作为指针实现。唯一的类型为FILE *的
有效值为NULL,函数返回的值为

,如fopen()。与FILE *值唯一有效的关系是

将它们与NULL或彼此进行比较,或将它们传递给函数。


内部FILE结构本身完全是系统特定的
。除非你绝对需要,否则不要做任何取决于那些内部的东西




-

Keith Thompson( The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



I don''t know whether that''s the best approach (partly because I know
very little about Delphi).

C programs in general don''t use the FILE structure itself. They only
use pointers to FILE structures (type FILE*). Think of a FILE* as an
opaque type that happens to be implemented as a pointer. The only
valid values of type FILE* are NULL and values returned by functions
such as fopen(). The only valid things to do with FILE* values are to
compare them to NULL or to each other, or to pass them to functions.

The internals of the FILE structure itself are entirely
system-specific. Don''t do anything that depends on those internals
unless you absolutely have to.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于FILE结构 - 将C DLL移植到其他语言中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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