dll 的问题(50分)

H

hzhxxx

Unregistered / Unconfirmed
GUEST, unregistred user!
win2000 server + CBC 5 + PB 7
特别关注,我是学 PB,正在学 CBC ,学习的目的既是弥补 pb 的不足,大量使用 Win32 API .

eg
file->new ->dll wiazrd-> c + multi threaded(C 格式,多线程)

那位大虾能举一个简单的例子(要测试在PB)中,尽量详细,
比如使用 winscck32.h 得到 IP ,能实现,我立马给分,失言是猪!

我写了一个,我也 compile 一个 dll,very very easy,but error in PB
eg
file->new ->dll wiazrd-> c + multi threaded
新建 一个cpp,在下面有
#pragma hdrstop
#include "string.h"
#include "unitsoc2.h"
在 unitsoc2.h中申明:
extern "C" __declspec(dllexport) int __stdcall Hunc1(
const char* DataType, char* Data,void *Buffer, long BufferSize);
//---------------------------------------------------------------------------
#pragma package(smart_init)
//注意,是 Hunc1
int _stdcall Hunc1( const char* DataType,char* Data,void *Buffer,long BufferSize)
{
int i = 0;
strcpy(Data,DataType);
i = 99;
return i;
}
compile success,make dll sucess,all sucess
在 PB 中申明,我把唯一的一个 dll.dll copy 到另外一个目录下(C:/new2/query1):
//FUNCTION long Hunc2(ref string DataType,ref string Data, string Buffer,long BufferSize) Library "C:/new2/query1/dll.dll"
string s1,s2,s3
s1 = 'ee'
s2 = '33dd'
s3 = '3'
long l = 1
Hunc2(s1,s2,s3,l)
出错,提示 calling external function hunc1() in clicked evnet in 16 line .....
应单是找不到函数的入口..
能有帮助的,也可以,我的e_mail : hzh62@163.com,qq : 84075167
欢迎在线回答,谢谢!!!
 
顶部