我用下面的方法可以动态返回ReadInt的值了,但不能将值写到WriteArray并得到返回值,请问我应该如何写程序,我C++是这样写的:#include "stdafx.h"class ArrayUnit
{
public :
ArrayUnit()
{
a = 0;
memset (b,0,20);
c =9;
};
int a;
char b[20];
long c;
};bool WriteArray(char * arraytest,long arraytestLen);
int ReadInt();我试写如下:
Type
Tperson=record
a:integer;
b:array[1..20]of string;
c:integer;
end;
TOpenConnection = Function(dwPort: Tperson;xx:integer): Tperson; stdcall;
//不知这里的dwPort: Tperson是否设置正确
var
DLLInstance:THandle;
PFunc: TFarProc;
test: Tperson;
xx:integer;
begin
DLLInstance := LoadLibrary('DllArrayTest.dll');
PFunc := GetProcAddress(DLLInstance,'WriteArray');
test.a := 1;
test.b[1] := '1321';
test.c := 4;
if @PFunc <> Nil then
begin
// pFunc(test,100);//请问这里怎么调用
end;
end;请问如果不这样写应该怎么写
{
public :
ArrayUnit()
{
a = 0;
memset (b,0,20);
c =9;
};
int a;
char b[20];
long c;
};bool WriteArray(char * arraytest,long arraytestLen);
int ReadInt();我试写如下:
Type
Tperson=record
a:integer;
b:array[1..20]of string;
c:integer;
end;
TOpenConnection = Function(dwPort: Tperson;xx:integer): Tperson; stdcall;
//不知这里的dwPort: Tperson是否设置正确
var
DLLInstance:THandle;
PFunc: TFarProc;
test: Tperson;
xx:integer;
begin
DLLInstance := LoadLibrary('DllArrayTest.dll');
PFunc := GetProcAddress(DLLInstance,'WriteArray');
test.a := 1;
test.b[1] := '1321';
test.c := 4;
if @PFunc <> Nil then
begin
// pFunc(test,100);//请问这里怎么调用
end;
end;请问如果不这样写应该怎么写
解决方案 »
- 怎样把我的积分赠送给朋友?
- 流或者内存缓冲区的操作问题
- DELPHI退出程序是出现储存的报错
- 我下载了一个dxDBGrid控件,但是在使用其分组显示时那行英文'drag a column header ...'如何改成中文啊?
- 如何调用动态库中的创建的组件对象(比如TSocketConnection实例)
- 代码解释
- SQL语法问题:SQL组合查询的语法问题
- 刚开始学delphi,请问哪里有初级delphi7教程下载.
- 又一个关于ADOConnection连接的问题(new)?
- 关于多层(C/S)网络数据库DCOM求助??????????
- 如何动态增减字段
- 如果把"网站名"和"网址"添加ie收藏夹里去了?例子如下
public
a; integer;
b: array [0..19] of char;
c: LongInt;
procedure ArrayUnit();
end;
PArrayUnit = TArrayUnit;TOpenConnection = Function(dwPort: PArrayUnit;xx:LongInt): integer; stdcall;你的聲明好象都是錯的, 我修改一點點, 你接下去再...