vb 调用GetObject显示加载dll出错 [问题点数:20分]

Bbs1
本版专家分:0
结帖率 0%
VB动态加载纯DLL资源
一、纯DLL资源的制作 打开VC6.0 创建一个基于win32的动态链接库 下一步中,要选择A sinmple Dll project 然后<em>加载</em>资源(注意对于超过256色的位图,VC不能编辑,不过这没关系) 可以<em>加载</em>位图、图标、字符串等,这是<em>加载</em>后的情况 资源添加完毕后,编译。(最好设为发布模式) 这样,一个纯资...
Delphi调用vbdll出错!!!
<em>vb</em><em>调用</em>该<em>dll</em>的演示代码如下:rnPrivate Declare Function Dacsp_init Lib "dacsplib.<em>dll</em>" () As LongrnPrivate Declare Function Dacsp_login Lib "dacsplib.<em>dll</em>" (ByVal Context As Long) As IntegerrnPrivate Declare Function Dacsp_final Lib "dacsplib.<em>dll</em>" (ByVal Context As Long) As IntegerrnrnPrivate Declare Function Dacsp_FileEnc Lib "dacsplib.<em>dll</em>" (ByVal Context As Long, ByVal infil As String, ByVal outfile As String, ByVal pubkey As String) As IntegerrnPrivate Declare Function Dacsp_FileDec Lib "dacsplib.<em>dll</em>" (ByVal Context As Long, ByVal infil As String, ByVal outfile As String, ByVal keyNo As Integer) As IntegerrnrnrnPrivate Declare Function Dacsp_StrEnc Lib "dacsplib.<em>dll</em>" (ByVal Context As Long, ByVal indata As String, ByVal indatalen As Integer, ByVal outdata As String, ByVal pubkey As String) As IntegerrnPrivate Declare Function Dacsp_StrDec Lib "dacsplib.<em>dll</em>" (ByVal Context As Long, ByVal indata As String, ByVal indatalen As Integer, ByVal outdata As String, ByVal keyNo As Integer) As IntegerrnrnDim Context As LongrnDim ret As IntegerrnDim pubkey As ByternrnPrivate Sub Command1_Click()rnDim str As StringrnDim str2 As String * 2048rnDim str3 As String * 2048rnDim pubkey As StringrnrnrnContext = Dacsp_init() rnret = Dacsp_login(Context)rnIf ret < 0 ThenrnMsgBox ("登陆失败!")rnExit SubrnEnd Ifrnrn以上代码能成功运行无错!!rn--------------------------------------------------------------------------------------rn我改写成Delphi版的代码如下:rnInterfacernFunction Dacsp_init():Longint;rnFunction Dacsp_login(Context:Longint):Integer;rnFunction Dacsp_final(Context:Longint):Integer;rnFunction Dacsp_FileEnc(Context:Longint;infil,outfile,pubkey:String):Integer;rnFunction Dacsp_FileDec(Context:Longint;infil,outfile:String;keyno:Integer):Integer;rnFunction Dacsp_StrEnc(Context:Longint;indata:String;indatalen:Integer;outdata,pubkey:String):Integer;rnFunction Dacsp_StrDec(Context:Longint;indata:String;indatalen:Integer;outdata:String;keyno:Integer):Integer;rnrnimplementationrnFunction Dacsp_init:Longint;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_login(Context:Longint):Integer;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_final(Context:Longint):Integer;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_FileEnc(Context:Longint;infil,outfile,pubkey:String):Integer;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_FileDec(Context:Longint;infil,outfile:String;keyno:Integer):Integer;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_StrEnc(Context:Longint;indata:String;indatalen:Integer;outdata,pubkey:String):Integer;external 'dacsplib.<em>dll</em>';rnFunction Dacsp_StrDec(Context:Longint;indata:String;indatalen:Integer;outdata:String;keyno:Integer):Integer;external 'dacsplib.<em>dll</em>';rnrnprocedure TFrm_Main.Button2Click(Sender: TObject);rnvar rn ret:Integer;rn Context:Longint;rn rn Context := Dacsp_init();rn ret := Dacsp_login(Context);rn if ret < 0 Thenrn Messagedlg('操作失败!',mtError,[mbok],0); rnrn程序一执行就报错,翻译后大概内容为:"内存访问错误,在模块dacsplib中"rnrn请问为什么同样一个<em>dll</em>在<em>vb</em>中能被成功<em>调用</em>,而在delphi中却会报错呢?是不是变量类型的问题?rn还是什么传值和传地址之间的转换??rn求高手指点~~~
加载vb写的DLL,运行时候出错
<em>vb</em>写的一个DLL,用VB.net添加引用rn在实例化的时候rnDim testDLL As New TestDll <em>出错</em>rnrnRetrieving the COM class factory for component with CLSID EE91635F-94F2-11D2-89F9-00E029078590 failed due to the following error: 80040154.rnrn怎么回事?rn谢谢!
VC调用 vb DLL出错vb DLL访问了数据库)
这是VC代码rn#import "C:\WINDOWS\system32\RSDLL.<em>dll</em>"no_namespacern#import "C:\WINDOWS\system32\msado15.<em>dll</em>"no_namespace rnrnrnrnint _stdcall KMT_start(int devType, char uid[], char fw[], char chip[], int tune, char kmtINI[], long len[])rnrn BSTR bstrDesc,str;rn // SysFreeString(str); rn str=_com_util::ConvertStringToBSTR(str1);rnrntryrnrn CoInitialize(NULL);rn _Class1Ptr ptr=NULL;rnrnrn ptr.CreateInstance(__uuidof(Class1));rn rn if(ptr==0)rn rn rn AfxMessageBox("无效的指针"); rn return 0;rn rn ptr->KMT_app_start(&str);rn rnrnrncatch(_com_error &e)rnrn bstrDesc = e.Description();rnrnrnCoUninitialize();rnreturn 0;rnrnrnrnrnrnrn报错:rnrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tlh(45) : error C2146: syntax error : missing ';' before identifier 'Cn'rne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tlh(45) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiersrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tlh(45) : error C2501: 'Cn' : missing storage-class or type specifiersrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tlh(51) : error C2146: syntax error : missing ';' before identifier 'GetCn'rne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tlh(51) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiersrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tli(14) : error C2143: syntax error : missing ';' before 'tag::id'rne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tli(14) : error C2433: '_ConnectionPtr' : 'inline' not permitted on data declarationsrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tli(14) : error C2501: '_ConnectionPtr' : missing storage-class or type specifiersrne:\program files\microsoft visual studio\myprojects\call<em>vb</em>\debug\rs<em>dll</em>.tli(14) : fatal error C1004: unexpected end of file foundrnError executing cl.exe.rnrnCALLVB.<em>dll</em> - 9 error(s), 0 warning(s)
加载 DLL 时出错
我编写一个ActiveX控件,在Aspx页面中使用javascript<em>调用</em>,出现错误信息:<em>加载</em> DLL 时<em>出错</em>rn。rn编写方法:rnaspx 页面rnrnrnrn...rn<em>调用</em>jsrnrnrnjs 代码:rnfunction readrfidAll()rn alert("xxxxxxxxxxxxxxxxx");rn var rfid = new ActiveXObject("senziRfiddev.RFID");rn //var rfid = id_rfid_dev_com;rn rn alert("rfid---------"+rfid);rn var strid;rn if( rfid == null )rn rn alert("创建RFID设备读写设备失败");rn return;rn rn rn alert("dd"); rn rn var b = rfid.open(1, 9600); // rfid.open(1, 9600); rn if( !b )rn rn var str = "打开设备失败-";rn str += rfid.ErrMsg;rn alert(str);rn return ;rn rn rn alert("22");rnrnrnrn
dll加载出错的问题
<em>加载</em>时提示使用LoadLibrary<em>加载</em><em>出错</em>,请问各位怎么解决,非常感谢!
加载dll出错
[Linker Error] Unresolved external '_MinusNum' referenced from E:\SOURCE\TEST\UNIT1.OBJrnimport type library 选中生成的.<em>dll</em>文件,确定,说是不能正确<em>加载</em>。
dll加载出错
typedef long (*FunNoParamSockOut)();rn FunNoParamSockOut FunNoParam_SockOut=NULL;rn HMODULE hDllSockOut = ::GetModuleHandle(_T("SockOut.<em>dll</em>"));rn if(!hDllSockOut)rn// hDllSockOut = AfxLoadLibrary(_T("F:\\local\\SockOut\\Debug\\SockOut.<em>dll</em>"));rn hDllSockOut = AfxLoadLibrary(_T("F:\\TestCenter\\SockOut.<em>dll</em>"));//ysm091008rn if (hDllSockOut) rn rn FunNoParam_SockOut = (FunNoParamSockOut)::GetProcAddress(hDllSockOut,_T("InitOutCtrlThreads"));rn if(FunNoParam_SockOut)rn FunNoParam_SockOut(); //启动对应主控卡的输出数据线程rn rnrn代码如上;rn我在SockOut是一个<em>dll</em>程序,生成的<em>dll</em>在F:\\local\\SockOut\\Debug\\SockOut.<em>dll</em>;我用hDllSockOut = AfxLoadLibrary(_T("F:\\local\\SockOut\\Debug\\SockOut.<em>dll</em>"));没有错。但我把SockOut.<em>dll</em>放到F:\\TestCenter里面再改成hDllSockOut = AfxLoadLibrary(_T("F:\\TestCenter\\SockOut.<em>dll</em>"));就会<em>出错</em>,Debug Assertion Failed。调试了一下是在FunNoParam_SockOut();这一行<em>出错</em>。请教高手原因及改正!
vb调用WORD出现加载DLL错误
小弟想用VB6<em>调用</em>WORD进行一些自动化操作,在工程中加入了引用“Microsoft Word 11.0 Object Library”(C:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB)。rn可是在WIN7+OFFICE2003中调试老是提示“<em>加载</em>DLL错误”。rn一开始错误出现在以下语句:rnDim Wrd As Word.ApplicationrnSet Wrd = New Word.Application(<em>出错</em>!)rn后来我在网上搜索换成了动态绑定:rnSet Wrd = CreateObject("Word.Application")rn这次这一句没有<em>出错</em>了。rnrn但是接下来我希望通过这个Wrd 对象打开一个DOC文件时又提示“<em>加载</em>DLL错误”:rn Dim Doc As DocumentrnSet Doc = Wrd.Documents.Open("c:\test.doc")(<em>出错</em>!)rnrn我曾经用完全相同的程序和完全相同版本的OFFICE2003,分别在XP 和 WIN7 环境中调试。rn结果在XP中完全无错误,在WIN7中就老是“<em>加载</em>DLL错误”!rnrn各位大神,这个到底怎么破?rn小弟我实在是黔驴技穷了……rn
Getobject 出错,为啥?
在编写VBscript中,Getobject为什么报错?提示是Active控件不能创建对象.rnrn
VB dll加载错误
编译程序时提示xxxxx。<em>dll</em>编译错误,xxxxx。<em>dll</em>是程序自己生成的文件。程序生成xxxxx。<em>dll</em>的时候没有问题,打包的时候就提示这个xxxxx。<em>dll</em>编译错误。(属于outlook Add in,原来是2000的版本现在升级到2007了)。rnrn还有就是程序刚打开按F5的时候提示“<em>加载</em>DLL错误”,但打开form后在按F5就没有提示了。也能顺利生成xxxxx。<em>dll</em>文件,就是打包的时候提示xxxxx。<em>dll</em>编译错误。rnrn请问如何解决啊?
vb getobject的原理是什么
<em>vb</em> <em>getobject</em>的原理是什么,现在我同时打开了两个版本的CAD软件,它们在进程中的名字是一样的,这样每次用GetObject得到的对象都不是我要的那个版本的,这该怎么办?
VC做的DLL为何VB调用出错
我是VC新手,以下的代码为何编译成功,便使用VB<em>调用</em>总是提示“找不到入口点 function in ditectory&filename...”rn[color=#FF0000]C++的源代码StdAfx.h[/color]rn[code=C/C++]#if !defined(AFX_STDAFX_H__572CA89B_5187_4DD8_B8AD_95750473D389__INCLUDED_)rn#define AFX_STDAFX_H__572CA89B_5187_4DD8_B8AD_95750473D389__INCLUDED_rn#if _MSC_VER > 1000rn#pragma oncern#endif // _MSC_VER > 1000rn#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headersrn#include rn#endif // !defined(AFX_STDAFX_H__572CA89B_5187_4DD8_B8AD_95750473D389__INCLUDED_)rnrn rn #ifdef __cplusplus rn extern "C" rn #endif rnrn _declspec(<em>dll</em>export) _stdcall test(int , char[10] ,char[10] ); rn rn #ifdef __cplusplus rn // extern "C" rn #endif [/code]rn rn[color=#FF0000]C++的源代码*.cpp[/color]rn[code=C/C++]#include "stdafx.h"rnextern "C" __declspec(<em>dll</em>export)rnBOOL APIENTRY DllMain( HANDLE hModule, rn DWORD ul_reason_for_call, rn LPVOID lpReservedrn )rnrn return TRUE;rnrnextern "C" __declspec(<em>dll</em>export)rnint __stdcall test(int ico , char Information[10] ,char Tit[10] )rnrn MessageBox(NULL,Information, Tit ,MB_YESNO+ico);rn return 0;rn[/code]rnrn[color=#FF0000]VB的<em>调用</em>[/color]rnDeclare Function test Lib "bbb.<em>dll</em>" (ByVal ico As Integer, ByVal infor As String, ByVal Tit As String) As Integerrncall test(32,“information”,"Title")rn
调用VB所写的DLL时出错......求助!!!!!
定义:Function Integer setuserstate (Integer iState) Library "fingersyn.<em>dll</em>"rnrn<em>调用</em>:rn Integer li_irn li_i = setuserstate(111)rn messagebox('',string(li_i))rnrn<em>出错</em>信息:rn Error calling external function setuserstaternrnDLL已经注册在 C:\windows\system 下,但还是<em>出错</em>,请各位高手指点。
vb调用DLL出错请帮忙
<em>vb</em>中我<em>调用</em>一个DLL中的函数,此函数需要一个参数rn参数类型是 BYTE *_bStringMode ,我用String型rn<em>调用</em>时出现错误:ByRef参数类型不符。rn请问如何解决rnrn
VB的Dll在Dephi中调用出错,求助
用VB写了一个Dll,代码如下:rnPublic Sub A(AA() As Date)rn For inti = 0 To UBound(AA)rn MsgBox AA(inti)rn NextrnEnd Subrnrn在DelPhi<em>调用</em>如下(1):rnvarrn d:variant;rn dd:array[1..3] of variant;rnbeginrn dd[1] := Now - 1;rn dd[2] := Now - 2;rn dd[3] := Now - 3;rn d := CreateoleObject('Test.Cls_Test');rn d.A(dd);rnrn编译<em>出错</em>:在d.A(dd)<em>出错</em>:Type not allowed in OLE Automation callrnrn在DelPhi<em>调用</em>如下(2):rn通过Import Type Library...生成Test_TLB.dcu,Test_TLB.pas等文件rnvarrn d:Tcls_test;rn dd:array[1..3] of variant;rnbeginrn dd[1] := Now - 1;rn dd[2] := Now - 2;rn dd[3] := Now - 3;rn d.A(dd);rn编译<em>出错</em>:在d.A(dd)<em>出错</em>:Types of actual and formal var rnrnparameters must be identicalrn为什么呢?如何解决?
VB调用DLL报内存出错问题!
各位大虾,我这里碰到一个<em>调用</em>DLL<em>出错</em>的情况,烦请一看。rnrnVC++编写一个DLL负责处理一个大小为Long以下的字符串,并要将结果返回VB。rn现在,我首先在VB中开辟一个比结果要大的String空间,并将其地址传给VC++。rn但是,在程序运行后,首次<em>调用</em>时候并不<em>出错</em>。首次运行后,退出时报“内存某地址不能为written”。如果不退出,继续<em>调用</em>DLL,会在不确定的某一次报同样错误。rnrn敬请赐教。rn谢谢!
VB调用VC写的DLL文件出错
用VC写了个DLL,供VB来<em>调用</em>,命名为LL.<em>dll</em>,在本机器运行不<em>出错</em>rn做成安装包后,到另外的机器上运行,总是提示无法找到该DLL文件,错误码是53rn请帮助
VB调用DLL出错,求高手帮忙
我用VB6.0创建了一个activexDLL,名称为SH.DLL,在其中定义了MIS1,MIS2,MIS33个类文件,rn其中MIS1定义了一个函数Public Function Trans(Request As MIS2, Response As MIS3) As Long,rnMIS2中定义了输入的数据类型:Public PNumber As String Public SNumber As String等一些数据rnMIS3中定义了一些要输出的数据类型:Public PNumber As String Public SNumber As String rn我另外用VB6.0做了一个EXE测试程序,代码如下:rnPrivate Sub Command1_Click()rn Dim a As Objectrn Dim b As Objectrn Dim c As Objectrn Set a = CreateObject("SH.MIS1")rn Set b = CreateObject("SH.MIS2")rn Set c = CreateObject("SH.MIS3")rn Dim ret As Longrn With brn .PNumber = 1rn .SNumber = 2rn End With rn ret = a.Trans(b, c) rnEnd Subrn在执行到ret = a.Trans(b, c) 会返回“运行时错误13:类型不匹配”的错误rn如果我把代码修改成如下:rnPrivate Sub Command1_Click()rn Dim a As New SH.MIS1rn Dim b As New SH.MIS2rn Dim c As New SH.MIS3rn With brn .PNumber = 1rn .SNumber = 2rn End With rn ret = a.Trans(b, c)rnEnd Subrn并在工程--引用里增加SH.DLL的引用,就可以正常运行,没有报错rn谁可以告诉我这两个<em>调用</em>方法的区别是什么吗?rn如果我需要使用第一种<em>调用</em>方法,我应该怎么去修改程序,才能不报错?
vb连续调用dll函数出错
如题rn连续<em>调用</em>同一个c编写的<em>dll</em>函数,在第三次时<em>出错</em>rn“Visual Basic 遇到问题需要关闭。我们对此引起的不便表示抱歉。”rnrn错误签名rnAppName: <em>vb</em>6.exe AppVer: 6.0.97.82 ModName: nt<em>dll</em>.<em>dll</em>rnModVer: 5.1.2600.2180 Offset: 0003426d
【求助】VB调用MATLAB生成的dll出错
提示 input arguments must contain positive integersrnrnMATLAB代码:rnfunction kk( n , n2)rn% calculate the sum of 1..nrn[Y,F,b]=wavread([n,'.wav']);rnY2=Y(((F*0+1):F*[0,n2]),:);rnwavwrite(Y2,F,b,[[n,['0',num2str(n2)]],'.wav']) ;rnrnendrnrn<em>vb</em>代码:rnPrivate n As StringrnPrivate n2 As DoublernPrivate kkd As kkCOM.kkCOMclassrnPrivate Sub Command1_Click()rnn = "test"rnn2 = 0.5rnCall kkd.kk(n, n2) <=这句出现问题
调用DLL加载窗体
<em>调用</em>DLL,New一个DLL里面的窗体怎么弄?rnrn首先选择DLL文件,然后再把DLL文件里面的主窗体<em>显示</em>出来。rn因为我要传参数,所以想New。rnrn
DLL文件加载调用
别人给的一个DLL文件,需要<em>调用</em>里面的函数做用户名的认证,怎么<em>调用</em>函数。rn经理说需要用import导入,然后在<em>调用</em>,具体该怎么做啊。在线等大神指教
Vb 调用 VC DLL(VC DLL调用VB 访问数据库DLL)运行出错
VC代码如下:rn“CALLVB.cpp”rn#define CALLVB_API extern "C" _declspec(<em>dll</em>export)rn#includern#include "stdafx.h" rn#include "CALLVB.h"rn#include rn#includern#include "atlbase.h"rn//#include"adoid.h"rn//#include"adoint.h."rnint __stdcall KMT_start(short devType, char uid[], char fw[])rnrn BSTR bstrDesc;rn short dev; rn dev=devType;rn // SysFreeString(str); rn // str=_com_util::ConvertStringToBSTR(uid); //类型转换rn_bstr_t str(uid); //类型转换rntryrnrn CoInitialize(NULL);rn _Class1Ptr ptr=NULL;rnrnrn ptr.CreateInstance(__uuidof(Class1));rn rn if(ptr==0)rn rn rn AfxMessageBox("无效的指针"); rn return 0;rn rn ptr->ado_Init();rnptr->DT_start(dev,str,str);rnptr->ado_UnInit(); rnrnrncatch(_com_error &e)rnrn bstrDesc = e.Description();rnrnrnCoUninitialize();rnreturn 0;rnrnrnrnrn“CALLVB.H”rnrn#ifdef CALLVB_APIrn#elsern#define CALLVB_API estern "C" _declspec(<em>dll</em>export) rn#endifrn_declspec(<em>dll</em>export) int __stdcall KMT_start(short devType, char uid[], char fw[]);rnrnrn"StdAfx.H"rnrn#if !defined(AFX_STDAFX_H__340A6E84_477A_41D9_8E1D_67C58EA8FCDF__INCLUDED_)rn#define AFX_STDAFX_H__340A6E84_477A_41D9_8E1D_67C58EA8FCDF__INCLUDED_rnrn#if _MSC_VER > 1000rn#pragma oncern#endif // _MSC_VER > 1000rnrn#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headersTrn//#include "atlbase.h" rn#include // MFC core and standard componentsrn#include // MFC extensionsrn#include // MFC Automation classesrn#include // MFC support for Internet Explorer 4 Common Controlsrn#ifndef _AFX_NO_AFXCMN_SUPPORTrn#include // MFC support for Windows Common Controlsrn#endif // _AFX_NO_AFXCMN_SUPPORTrnrnrn//AFX_INSERT_LOCATIONrn// Microsoft Visual C++ will insert additional declarations immediately before the previous line.rnrn#import "C:\WINDOWS\system32\PrjADO.<em>dll</em>"no_namespacernrn#endif // !defined(AFX_STDAFX_H__340A6E84_477A_41D9_8E1D_67C58EA8FCDF__INCLUDED_)rnrnrn[color=#FF0000]CALLVB DLL工程编译没有错误,但是VB<em>调用</em>时就<em>出错</em>,提示““0x7c809dea”指令参考的“0x00000001”内存,该内存不能为“Read””[/color]rnrnrn
98下显示调用dll出错,2000下好好的。
如题,同样的<em>dll</em>源码,在98下编译后,就调不起来了。错误码31,“与系统连接的设备不能正常运转” rn<em>调用</em>系统库好好的。
DLL调用出错?(DLL新手)
DLL中rnextern _declspec(<em>dll</em>export) int test(CString str)rnrn rn //AfxMessageBox(str);rn CPdfMenuDlg pdf;rn pdf.DoModal();rn return 1;rnrnEXE中rn_declspec(<em>dll</em>import) int test(CString str);rntypedef int ( *_TEST)(CString str);rnvoid CUse<em>dll</em>Dlg::OnOK() rnrn CString str="test <em>dll</em>";rn HINSTANCE hLibrary;rn _TEST test<em>dll</em>;rn hLibrary=LoadLibrary("c:\\<em>dll</em>test.<em>dll</em>");rn test<em>dll</em>=(_TEST)GetProcAddress(hLibrary,"test");rn //DWORD dwError = GetLastError();rn int aa=(*test<em>dll</em>)(str);rn //FreeLibrary(hLibrary);rn //CDialog::OnOK();rnrnrn<em>出错</em>,为什么?
显示加载DLL的小问题
最近看<em>dll</em>时遇到几个GetProcAddress的问题rnrn1、导出函数时,定义了rn [code=C/C++]typedef int(*MYFUN)(int,int);rn fun = (MYFUN)::GetProcAddress(hinstDll,"<em>dll</em>Fun");[/code]rn 然后忽然想到,如果想要这个fun有默认参数,就像int <em>dll</em>Fun(int=1,int=2)一样的话该怎么做?rnrn2、导出变量除了强制转换还有没有什么好方法?
显示加载dll(导出类)
rnrn需要导出一个类。。。。。。将整个类导出。。。。rnrn一般而言, 导出类后,只能 隐世<em>加载</em>,很难做到 显式<em>加载</em>。。。。rnrnrn谁有法子,可以做到 显式<em>加载</em>???rnrn有人 说,借鉴com来搞定。。。rnrn不知道是怎么做到的??rnrn能否说说具体点嘛rnrn谢谢了额啊rnrn
显示加载dll
<em>显示</em><em>加载</em><em>dll</em> HMODULE LoadLibrary(LPCTSTR lpFileName); lpLibFileName 指定要载入的动态链接库的名称 返回HMODULE,成功则返回库(即<em>dll</em>)模块的句柄,零表示失败,HMODULE和 HINSTANCE一样 注:这个函数也可以<em>加载</em>可执行模块exe文件,用以访问对话框、位图、图标资源 FARPROC GetProcAddress(HM
C#调用dll出错
[img=https://img-bbs.csdn.net/upload/201403/25/1395710821_504667.jpg][/img][img=https://img-bbs.csdn.net/upload/201403/25/1395710841_765726.jpg][/img]
dll调用出错
在VB里<em>调用</em>一个BCB写的DLL,在窗体里定义做如下定义rnrnPublic Declare Function ABC_login Lib ".\Dll.<em>dll</em>" (ByVal date1 As String, ByVal time1 As String, ByVal ErrCode As String, ByVal ErrMsg As String) As Integerrnrn运行时出现下面的错误rnConstants,fixed-length strings,array,user-defined types and Declare statements not allowed as Public members of object modules rnrn如果把public改成private就不<em>出错</em>,但是<em>调用</em>其它的<em>dll</em>就不<em>出错</em>,不知道写<em>dll</em>是不是用什么特别注意的地方,请高手指点
dll调用出错!!!!!!!
我在Delphi中写了一个DLL,其中使用OLE<em>调用</em>Word,但是确出现了rnProject test.exe raised exception class EOleSysError with message '尚未<em>调用</em> CoInitalize。'.Process stopped. Use Step or Run to continue.rn不知这是为什么。应如何解决。
调用dll 链接出错
rnrnrn1>正在链接...rn1> 正在创建库 F:\发卡机\ut6000\IssueMachineDLL\Debug\IssueMachineDLL.lib 和对象 F:\发卡机\ut6000\IssueMachineDLL\Debug\IssueMachineDLL.exprn1>IssueMachin.obj : error LNK2019: 无法解析的外部符号 "int __stdcall ReadRecordFile_N5(void *,unsigned char,unsigned char,unsigned char *,unsigned char *)" (?ReadRecordFile_N5@@YGHPAXEEPAE1@Z),该符号在函数 "public: static int __cdecl CIssueMachine::ReadRecordFile(int,unsigned char,unsigned char,unsigned char *,unsigned char *)" (?ReadRecordFile@CIssueMachine@@SAHHEEPAE0@Z) 中被引用rn1>IssueMachin.obj : error LNK2019: 无法解析的外部符号 "int __stdcall ReadRecordFile_N4(void *,unsigned char,unsigned char,unsigned char *,unsigned char *)" (?ReadRecordFile_N4@@YGHPAXEEPAE1@Z),该符号在函数 "public: static int __cdecl CIssueMachine::ReadRecordFile(int,unsigned char,unsigned char,unsigned char *,unsigned char *)" (?ReadRecordFile@CIssueMachine@@SAHHEEPAE0@Z) 中被引用rn
静态调用DLL出错.........
DLL工程的代码:(dgull.<em>dll</em>)rn(usesrn ShareMem,rn SysUtils,rn Classes,rn Windows;)rnFunction GetSystemDirectory: String;Stdcall; //得到系统目录rnVarrn pcSystemDirectory: PChar;rn dwSDSize: DWORD;rnBeginrn dwSDSize:=MAX_PATH+1;rn GetMem(pcSystemDirectory, dwSDSize);rn Tryrn If Windows.GetSystemDirectory(pcSystemDirectory, dwSDSize)<>0 Thenrn Result:=pcSystemDirectory;rn Finallyrn FreeMem(pcSystemDirectory);rn End;rnEnd;rnrn<em>调用</em>的代码:rnFunction GetSystemDirectory: String;Stdcall; external 'dgull.<em>dll</em>';rnrnrnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrnshowmessage(GetSystemDirectory);rnend;rn*****rn问题是,第一次点击Button一切正常,结果也对,可是第二次点击Button是出现错误:rn存取地址***违例发生在模块"nt<em>dll</em>.<em>dll</em>"中**********rn怎么解决?是不是GetSystemDirectory函数的事?rn
dll调用全局变量 出错
我用的是 vs2005rnrn<em>dll</em>test工程:rnrnlib.hrnrn#ifndef LIB_Hrn#define LIB_Hrnextern int <em>dll</em>GlobalVar;rnextern "C" int GetGlobalVar();rn#endif rnrnlib.cpprnrn#include "lib.h"rn#include rnrnint <em>dll</em>GlobalVar;rnrnBOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)rnrn switch(ul_reason_for_call)rn rn case DLL_PROCESS_ATTACH:rn <em>dll</em>GlobalVar=100;rn break;rn case DLL_THREAD_DETACH:rn case DLL_THREAD_ATTACH:rn case DLL_PROCESS_DETACH:rn break;rn rn rn rn rn return TRUE;rnrnrnrnint GetGlobalVar()rnrn return <em>dll</em>GlobalVar;rnrnrnrnlib.defrnLIBRARY "Dlltest"rnrnEXPORTSrn ;或<em>dll</em>GlobalVar CONSTANT rn <em>dll</em>GlobalVar DATArn GetGlobalVarrnrnCallDll工程:rn#include rn#include rn#pragma comment(lib,"<em>dll</em>Test.lib")rnextern "C" _declspec(<em>dll</em>import)int GetGlobalVar();rnextern int <em>dll</em>GlobalVar;rnrnint main(int argc, char* argv[])rnrn printf("%d ",GetGlobalVar());rnrn *(int *)<em>dll</em>GlobalVar = 1;rn //特别要注意的是这种方法导出的并不是变量本身,而是DLL中导出变量的指针,应用程序必rn //须通过强制指针转换来使用 rn rn printf("%d ",GetGlobalVar());rnrn scanf("rr");rn return 0;rnrnrnrn<em>出错</em>:rnrn错误 1 error LNK2001: 无法解析的外部符号 "int <em>dll</em>GlobalVar" (?<em>dll</em>GlobalVar@@3HA) <em>dll</em>call.obj rn错误 2 fatal error LNK1120: 1 个无法解析的外部命令 E:\Ebook\学习笔记\C++APIWIN32MFC\029_DLL动态链接库导出全局变量\Debug\DllCall.exe 1 rnrnrn
调用DLL文件出错
我的DLL文件如下:rnlibrary ToolLib;rn SysUtils,rn Classes;rnrn$R *.resrnfunction Three(SourceResult:Integer):String;stdCall;rnbeginrn if SourceResult>0 thenrn Result:=IntToStr(SourceResult*3) //结果存放于Resultrn elsern Result:=IntToStr(SourceResult);rnend;rnMain文件如下:rnrnfunction Three(SourceResult:Integer):String;rn StdCall external 'ToolLib.DLL';rn...rnbeginrn Showmessage(Three(3));rnend;rn...rn当<em>显示</em>'9'之后就会<em>出错</em>:"invalid pointer operation"
pb调用dll出错
VC++创建DLL rn---- 在VC++5.0中可以用MFC AppWizard自动生成Win32 DLL和MFC AppWizard DLL,启动VC之后,从File | New菜单项,选择New对话框中的Projects标签,选择新项目为MFC AppWizard(<em>dll</em>),输入工程名pb<em>dll</em>,点击OK按钮,弹出图1-1所示对话框,选择DLL类型为:Regular DLL using shared MFC DLL,然后点击Finish按钮。这样,AppWizard将自动创建一个包含基本要素的DLL框架,接着手工添加代码。 rn图1-1 (略)自动生成的MFC AppWizard DLLrn打开pb<em>dll</em>.cpp文件,添加如下函数:rnextern "C" _declspec ( <em>dll</em>export )rnint PASCAL out_num(int x)rnrn int y;rn char msg[30];rn y=x ;rn sprintf(msg, "计算结果:%o ! ", y);rn ::MessageBox(NULL, msg, "信息", MB_OK);rn return 0;rnrn以上声明了函数out_num(),输入参数为一个整型数,rn作移位运算后,用对话框将计算结果<em>显示</em>出来。rn接着打开pb<em>dll</em>.def文件,在EXPORTS下输入函数说明rnout_num,文件内容如下:rnLIBRARY "pb<em>dll</em>"rnDESCRIPTION 'pb<em>dll</em> Windows Dynamic Link Library'rnrnEXPORTSrn; Explicit exports can go herern out_num @1rn最后编译生成动态链接库pb<em>dll</em>.<em>dll</em>。rnrn三、 在PowerBuilder中<em>调用</em>VC++创建的DLL函数 rn---- 为了在PowerBuilder应用程序中<em>调用</em>存放在动态链接库pb<em>dll</em>.<em>dll</em>中的函数out_num(),需要事先声明。在声明时要明确:rn(1)函数的作用范围是全局的还是局部的。全局声明可使该函数用于整个应用,局部声明仅使该函数在对象的脚本中有效。rn(2)必须指明函数返回的数据类型、传递参数的个数和类型,并将存放该函数的动态链接库的名字告诉PowerBuilder。 rn---- 声明完成后,应用程序可以<em>调用</em>函数out_num() ,<em>调用</em>该函数的代码与<em>调用</em>任何标准的PowerScript函数一样,区别在于:该函数存放在动态链接库中,<em>调用</em>它时,动态链接库装入内存,函数执行。 rnrn---- 下面是PowerBuilder中被<em>调用</em>函数的使用声明: rnrnFunction int out_num ( int irow ) LIBRARY "pb<em>dll</em>.<em>dll</em>"rn在PowerBuilder中<em>调用</em>函数out_num()代码如下:rn在w_main open中:rnint li_numrnli_num=out_num(5)rn然后,作了一个W_main中有sle_1.text=li_numrn然后编译成exe文件,运行,<em>出错</em>,请看error:bad runtime function reference at line 2 in open event of object w_main.rn这是怎么回事???请指教|!
DLL调用出错。。。。。。。。。。。。。。。
这是一个用于网络传输的DLLrn只要代码如下:rn//DLL部分 rn//*.hrnextern "C" WINAPI void TableSend(void);rnextern "C" WINAPI void TableRecv(void);rn????????? 这样定义会有什么问题吗rnrn//<em>调用</em>部分主要代码如下:(显式<em>调用</em>)rntypedef void(*TABLESEND)(void);rnTABLESEND TableSend;rnHINSTANCE hInst;rnhInst=LoadLibrary("SokAPI.DLL");rnif(hInst!=NULL) rnrn MessageBox("The SokAPI.DLL has already been load."); rnrnelsernrn MessageBox("load error");rn rnrnTableSend=(TABLESEND)GetProcAddress(hInst,"TableSend");rnif (TableSend!=NULL)rnrn TableSend();rnrnFreeLibrary(hInst);rnrn通过编译以后<em>显示</em>连接错误如下:rnMainFrm.obj : error LNK2005: "void (__cdecl* TableSend)(void)" (?TableSend@@3P6AXXZA) already defined in DialogTable.objrnMainFrm.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in DialogTable.objrnMRI.obj : error LNK2005: "void (__cdecl* TableSend)(void)" (?TableSend@@3P6AXXZA) already defined in DialogTable.objrnMRI.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in DialogTable.objrnMRIDoc.obj : error LNK2005: "void (__cdecl* TableSend)(void)" (?TableSend@@3P6AXXZA) already defined in DialogTable.objrnMRIDoc.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in DialogTable.objrnMRIView.obj : error LNK2005: "void (__cdecl* TableSend)(void)" (?TableSend@@3P6AXXZA) already defined in DialogTable.objrnMRIView.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in DialogTable.objrnOutputView.obj : error LNK2005: "void (__cdecl* TableSend)(void)" (?TableSend@@3P6AXXZA) already defined in DialogTable.objrnOutputView.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in DialogTable.objrnDebug/MRI.exe : fatal error LNK1169: one or more multiply defined symbols foundrnrn请问为什么会出现这种现象,该如何解决。
调用DLL出错
typedef void (*MYPROC)(void);rnMYPROC <em>dll</em>proc;rnHINSTANCE h<em>dll</em>=LoadLibrary("Dllsam.<em>dll</em>");rnif (h<em>dll</em>!=NULL)rn <em>dll</em>proc=(MYPROC)GetProcAddress(h<em>dll</em>,"?ShowMsg@CDllsamApp@@QAEXXZ");rn <em>dll</em>proc();rnelsern MessageBox("Fail to load <em>dll</em>");rnrn上面<em>调用</em>没错,但换成下面的语句就报错rn<em>dll</em>proc=(MYPROC)GetProcAddress(h<em>dll</em>,"ShowMsg");rn
swing调用dll出错
rnpublic class Driver rn public native void driverInit();rn public native void driverShort();rn public native double driverRead();rn public native void driverClose();rn static rn System.loadLibrary("Driver");rn rnrn 我用上面的Driver写了个Driver.<em>dll</em><em>调用</em>我们学校的一卡通的读卡器<em>dll</em>,rn我下控制台下测试成功了,可是在Swing下<em>调用</em>的时候就rnException in thread "main " java.lang.UnsatisfiedLinkError:C:\Porgram Files\Java\rnjre1.5.0_06\bin\nio: ?????????? ""???????rn at java.lang.ClassLoader$NativeLibrary.load(Native Method)rn at java.lang.ClassLoader.loadLibrary0(Unkown Source)rn....................................................rn 小弟时间很紧,万分火急,希望得到您的帮助,我这里先谢谢了。。。。
dll调用lib出错
<em>dll</em>是自己写的,<em>调用</em>一个系统提供的lib时<em>出错</em>,编译不下去,去掉这个lib(ws2_32.lib)就可以了.rn写成exe<em>调用</em>这个lib就可以rnrn我觉得可能是lib文件里 _declspec(<em>dll</em>import) 造成的,但是这个是编程工具提供的库,又改不了。rnrn这个问题有点急,望不吝赐教。
dll调用为什么出错
用atl写的<em>dll</em>,注册已经成功,可是<em>调用</em>时却说<em>dll</em>文件未找到rn为什么?
调用dll出错
ASP文件中代码仅一句:rnrnset a = server.CreateObject ("INCEUALIB.UA")rnrn"INCEUALIB.UA"应该没问题,在VB得测试文件中已经通过rn这个<em>dll</em>文件也用regsvr32注册过,在运行ASP时报错如下:rnrn错误类型:rn服务器对象, ASP 0177 (0x800401F3)rn无效的 ProgID。 若要获取关于此消息的更多的信息,请访问 Microsoft 联机支持站点: http://www.microsoft.com/contentredirect.asp 。 rn/testexe/exe.asp, 第 10 行rnrn请哪位帮忙看看好吗?谢谢
调用dll出错
我在<em>调用</em>一个外部<em>dll</em>后 运行到此过程末的时候,发生错误。rn跳出对话框提示:“Project ****.exe faulted with message:'access violation at 0x2b260a02: read of address 0x2b260a02'. prosess Stopped. Use Step or run to continue.”rn我可以提供源代码和<em>dll</em>。我一个朋友说<em>出错</em>是因为delphi在编译的时候自己加了一些代码,要清空一个什么类什么的。我不懂。不知道有没有谁碰到过这个问题。
vb.net调用dll出错
我用Matlab编好了一个程序,并通过com组件的方式生成了相应的<em>dll</em>文件,并且将<em>dll</em>文件成功的进行了注册。rn注册后我想<em>调用</em>这个<em>dll</em>,于是现在<em>vb</em>.net中添加引用,然后选择com中的我注册过的<em>dll</em>文件。rn之后在<em>vb</em>.net里写程序 dim myfunc as new static.addrn当执行到这句话的时候弹<em>出错</em>误提示“检索com类工厂中CLSID为3D027A96-5CD9-4B7F-9E5E-2965CD1271E2的组件时失败,原因是出现一下错误:80040154”,排错提示中写的是:检查异常的ErrorCode属性以确定com对象返回的HRESULT。rn请问出现这个错误是什么原因呢,我要怎么改正呢。
调用.dll出错
在工程中使用.<em>dll</em>中的函数,编译时<em>显示</em>错误信息.\wdcrwv.lib : fatal error LNK1136: invalid or corrupt file。什么原因,如何解决呀?
调用DLL传值出错
Public Class authpktrn Public dqcode As Byte '//区域码为6,可作为常数rn Public idcommand As Byte '//写卡命令值为1rn Public mjqcode() As Bytern Public sjqcode() As Bytern Public datayear1() As Bytern Public datayear2() As Bytern Public datamonth1() As Bytern Public datamonth2() As Bytern Public dataday1() As Bytern Public dataday2() As Bytern Public authinfo() As Bytern Public Sub Initialize()rn ReDim mjqcode(7)rn ReDim sjqcode(7)rn ReDim datayear1(55)rn ReDim datayear2(55)rn ReDim datamonth1(55)rn ReDim datamonth2(55)rn ReDim dataday1(55)rn ReDim dataday2(55)rn ReDim authinfo(7)rn End Subrn End ClassrnrnPublic Class Win32rn Declare Auto Function writecard Lib "umcard.<em>dll</em>" (ByVal znp As authpkt)rn Declare Auto Function initcom Lib "umcard.<em>dll</em>" (ByVal ii As Byte)rn End Classrnrn Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Clickrn real_authpkt.Initialize()rnrn real_authpkt.dqcode = 6rn real_authpkt.idcommand = 1rnrn Dim code1 As String = "12345678"rn Dim code2 As String = "12345678"rnrn real_authpkt.mjqcode(0) = CInt(code1.Substring(1, 1))rn real_authpkt.mjqcode(1) = CInt(code1.Substring(2, 1))rn real_authpkt.mjqcode(2) = CInt(code1.Substring(3, 1))rn real_authpkt.mjqcode(3) = CInt(code1.Substring(4, 1))rn real_authpkt.mjqcode(4) = CInt(code1.Substring(5, 1))rn real_authpkt.mjqcode(5) = CInt(code1.Substring(6, 1))rn real_authpkt.mjqcode(6) = CInt(code1.Substring(7, 1))rn real_authpkt.mjqcode(7) = 0rnrn real_authpkt.sjqcode(0) = CInt(code2.Substring(1, 1))rn real_authpkt.sjqcode(1) = CInt(code2.Substring(2, 1))rn real_authpkt.sjqcode(2) = CInt(code2.Substring(3, 1))rn real_authpkt.sjqcode(3) = CInt(code2.Substring(4, 1))rn real_authpkt.sjqcode(4) = CInt(code2.Substring(5, 1))rn real_authpkt.sjqcode(5) = CInt(code2.Substring(6, 1))rn real_authpkt.sjqcode(6) = CInt(code2.Substring(7, 1))rn real_authpkt.sjqcode(7) = 0rnrn Dim i, j As Integerrn Dim authtemp(8) As Stringrnrn authtemp(0) = "1010101"rn For i = 1 To 5rn authtemp(i) = "0000000"rn Nextrnrn Dim jj As Integerrn For jj = 0 To 5rn real_authpkt.authinfo(jj) = 0rn If authtemp(jj).Substring(0, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 64rn End Ifrn If authtemp(jj).Substring(1, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 32rn End Ifrn If authtemp(jj).Substring(2, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 16rn End Ifrn If authtemp(jj).Substring(3, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 8rn End Ifrn If authtemp(jj).Substring(4, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 4rn End Ifrn If authtemp(jj).Substring(5, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 2rn End Ifrn If authtemp(jj).Substring(6, 1) = "1" Thenrn real_authpkt.authinfo(jj) = real_authpkt.authinfo(jj) + 1rn End Ifrn MsgBox(real_authpkt.authinfo(jj))rn Nextrnrnrn real_authpkt.datayear1(0) = CInt(Me.DateTimePicker1.Value.Year.ToString.Substring(2, 1))rn real_authpkt.datayear2(0) = CInt(Me.DateTimePicker1.Value.Year.ToString.Substring(3, 1))rnrn real_authpkt.datamonth1(0) = CInt(Format("00", Me.DateTimePicker1.Value.Month).ToString.Substring(0, 1))rn real_authpkt.datamonth2(0) = CInt(Format("00", Me.DateTimePicker1.Value.Month).ToString.Substring(1, 1))rnrn real_authpkt.dataday1(0) = CInt(Format("00", Me.DateTimePicker1.Value.Day).ToString.Substring(0, 1))rn real_authpkt.dataday2(0) = CInt(Format("00", Me.DateTimePicker1.Value.Day).ToString.Substring(1, 1))rnrn Win32.writecard(real_authpkt)rn End Subrnrn跟踪DLL文件,发现传进去的数值为:rnrn+ tempnp dqcode=6 '␆' commandcode=1 '␁' mjqcode=0x0012e5b6 "" ... zauthPacketrnrn- mjqcode 0x0012e5b6 "" unsigned char [8]       (原来数值该为)rn [0] 0 unsigned char                 2rn [1] 0 unsigned char                 2rn [2] 96 '`' unsigned char                 3 rn [3] 128 '€' unsigned char                 4rn [4] 28 '␜' unsigned char                 5rn [5] 0 unsigned char                 6rn [6] 8 '␈' unsigned char                 7rn [7] 130 unsigned char                 8rnrnrn
加载类型库/DLL出错
在开发三层系统时遇到一下问题:rn我在本机电脑上编写Client和APPServer程序,一切运行正常,但当我把应用服务器放到另外一台机器上运行时,用客户端程序可以连上应用服务器,可<em>调用</em>接口程序时就会提示:<em>加载</em>类型库/DLL<em>出错</em>。不知这是为什么请大家们指教。rn注:连接方式使用TStockConnection
PB调用DLL出错
动态库函数 BOOL USTSendFile_Login(char* pszHost,WORD wPort,char* pszName,char* pszPwd,char szzDirList[MAX_PKT_LEN]);rn我在PB7中申明Function BOOLean USTSendFile_Login(ref string pszHost,ulong wPort,ref string pszName,ref string pszPwd,ref string szzDirList) LIBRARY "ufpDLL.<em>dll</em>"rn运行函数时报错:Specified argument type differs from required argument type at runtime in DLL function ustsendfile_login.rn (invalid stack pointer on return from function call)rn求教是哪里错了???rnrn
.net调用dll出错
rn ePass1000 Full ActiveX Control Reference Manual Version 2.0 rnOpenDevicernThe OpenDevice method finds and opens an ePass1000 for exclusive access, and create a session between application and device for further operation. rnrnHRESULTrnOpenDevice(rn [in]long lFlags, rn [in]unsigned char* pAppIDrn);rnRequirementrnepas_CreateContextrnrnParametersrnlFlags rn[in]This parameter defines a bit mask of options for opening a device. You may use bit-wise OR operation to select more than one option. This parameter can be a combination of one or more of the following flags: Flag Meaning rnEPAS_OPEN_FIRST Open the first found device. This flag can be combined with EPAS_OPEN_BY_NAME, EPAS_OPEN_BY_GUID or EPAS_OPEN_BY_GUID_STR. rnEPAS_OPEN_NEXT Open the next device. This flag can be combined with EPAS_OPEN_BY_NAME, EPAS_OPEN_BY_GUID or EPAS_OPEN_BY_GUID_STR. rnEPAS_OPEN_CURRENT Open the currently opened device. This flag can NOT be combined with other flags. rnEPAS_OPEN_SPECIFIC Open the device, that has same serial number value as which specified by pAppID parameter. This flag can NOT be combined with other flags. rnEPAS_OPEN_BY_NAME Open the device containing a directory name pointed to by pAppID. This parameter may be combined with EPAS_OPEN_FIRST or EPAS_OPEN_NEXT. rnEPAS_OPEN_BY_GUID Open the device containing a directory GUID as specified by pAppID. This flag must combined with EPAS_OPEN_FIRST or EPAS_OPEN_NEXT. rnEPAS_OPEN_BY_GUID_STR Open the device containing a directory GUID as specified by pAppID. This flag must combined with EPAS_OPEN_FIRST or EPAS_OPEN_NEXT. rnrnpAppID rn[in]This optional parameter provide additional information for the open. This parameter is only used if one of the following flags is assigned. If none of the flags below are assigned, pAppID should be set to NULL. Flag Meaning rnEPAS_OPEN_SPECIFIC pAppID point to an array of two unsigned longs which specified serial number of the device to be opened. Use GetProperty function to obtain a device's serial number. rnEPAS_OPEN_BY_NAME pAppID point to a NULL terminated string that specifies the Application Directory Name to open. If a device is opened, the current directory will be set to the directory ID defined by the Application Directory Name. rnEPAS_OPEN_BY_GUID pAppID point to an array of 16 bytes that specified the Application Directory GUID to open. If a device is opened, the current directory will be set to the directory ID defined by the Application Directory GUID. rnEPAS_OPEN_BY_GUID_STR pAppID point to a NULL terminated string that specifies the Application Directory GUID to open. If a device is opened, the current directory will be set to the directory ID defined by the Application Directory GUID. The string format is "xxxxxxxx - xxxx - xxxx - xxxx - xxxxxxxxxxxx". Dashes and braces are optional. rnrn rnRemarksrnThe order of devices opened (first and next) is based on the order they were detected by the system. To enumerate all devices connected to the system, use EPAS_OPEN_FIRST and EPAS_OPEN_NEXT until FT_UNIT_NOT_FOUND is returned. rnrnApplication access to ePass1000 is exclusive. Only one application can open an ePass1000 at one time. If any other application attempt to open this ePass1000, will get return code FT_DEVICE_IN_USE. rnrnYou can open specific ePass1000 by combining EPAS_OPEN_FIRST, EPAS_OPEN_NEXT flags with EPAS_OPEN_BY_NAME , EPAS_OPEN_BY_GUID, or EPAS_OPEN_BY_GUID_STR. rnrnIf you known serial number of the ePass1000 you intend to open, use EPAS_OPEN_SPECIFIC. rnrnReturn ValuesrnIf the function succeeds, FT_SUCCESS returned. rnrnIf the library failed to open the device driver, FT_CANNOT_OPEN_DRIVER is returned. rnrnIf the library do not support version of the driver, FT_INVALID_DRVR_VERSION is returned. rnrnIf there is no device connected to the system currently, FT_UNIT_NOT_FOUND is returned. rnrnIf the device is already opened by another application, FT_DEVICE_IN_USE is returned. rnrnFor a list of all return codes, see Error Code Values. rnrnrnrnrn参数的定义private Byte[] epsAppName = new Byte[EPAS_APP_NAME_SIZE];rnrnpublic const int EPAS_OPEN_FIRST = 0x1; rnrn<em>调用</em>ePass.OpenDevice(EPAS_OPEN_FIRST, ref epsAppName[0]);对象浏览器里的函数rnrn但是<em>调用</em><em>出错</em>,<em>调用</em>没有参数传递的就没有问题!rn我知道是参数的问题但是不知道怎么改???rn大家帮帮忙a!rn
急 .DLL调用出错
写了一个函数 char *fnComstr(char *str)rn 它返回 一个字符串 rn 放入单独文件编译运行可以得到正确的结果.rn 把它编译到DLL文件中(first.<em>dll</em>)中 也正常 .rn 在测试<em>dll</em>的文件中<em>调用</em>first.<em>dll</em> 引用上面那个函数就<em>出错</em>.rn 说某个内存地址不能读.rnrn其它函数<em>调用</em>都正常. rn 那位高人指点一下 是哪里<em>出错</em>.rn
调用DLL出错,求救!
我<em>调用</em>一个自己写的DLL,但总出"非法操作",请问一般会是什么问题?
DLL调用出错的问题
DLL<em>调用</em>约定<em>出错</em>的问题:rn我在<em>调用</em>对方公司提供的DLL时,出现DLL<em>调用</em>约定<em>出错</em>的问题,而编译成exe后,却没有错,在本站主题为"DLL<em>调用</em>约定<em>出错</em>的问题(在线等候)"(http://community.csdn.net/Expert/topic/4988/4988731.xml?temp=6.075686E-02)中提到是:<em>vb</em>a6.<em>dll</em>的bug,现在是我想用源程序调试相关的数据交换的问题,不知哪位高手能帮忙提供一个什么好的办法,谢谢了rn
对DLL调用出错
在VC中把DLL用LOADLIBARAY<em>加载</em>后,再用FARPROC指针获得其中一个函数的地址后,rn按道理应该就可以<em>调用</em>这个函数了,但当我<em>调用</em>这个函数时,怎么编译器总是认为“太多的实际参数”而不能编译通过????rn在DLL中,这个函数的确是有4个参数啊,我在<em>调用</em>的时候也的确是用了4个实参数啊!
dll 动态库调用出错
动态库定义的地方rnfunction Dou(i,j:integer):integer;stdcallrnbeginrn result:=i*j;rnend;rnexportsrnDou;rnrnrn <em>调用</em><em>dll</em>的地方rnprocedure TForm1.Button1Click(Sender: TObject);rnvarrnh:Thandle;rnbeginrnh:=SafeLoadLibrary('my<em>dll</em>.<em>dll</em>');rn@Dou:=getprocaddress(h,'Dou'); ------<em>出错</em>的地方rnend;rnrn到底动态<em>调用</em><em>dll</em>应该怎么写呢?谢谢
DLL调用出错
我在<em>调用</em>一个DLL文件时,发现当delphi打开时,调试一切正常,但编译完成后再执行,发现报错,说是kernel32.<em>dll</em><em>调用</em>错,好象是内存地址冲突。rn请教这是怎么一会事?rn应该说调试时能通过,那执行时也应该能通过呀
调用dll出错啦?????????!!!!!!!!!!!
我在C++builder中写了个<em>dll</em>rn在C++builder中的代码:rnextern "C" void __declspec(<em>dll</em>export) __stdcall Printbmp(char bmpfile[]);rnrnvoid Printbmp(char bmpfile[])rn rn //函数体rnrnrn下面的代码是在VC中<em>调用</em>该<em>dll</em>:rn UpdateData(TRUE);rn rn HINSTANCE handle; //DLL 模块的句柄rn FARPROC lpFarProc; //rn void(__stdcall *print)(char*);rnrn rn handle = LoadLibrary("qaz.<em>dll</em>"); //rn int code =GetLastError(); //code=2rn rn rn lpFarProc = GetProcAddress(handle,"Printbmp"); rn code =GetLastError(); //code=2rnrn rn print = (void(__stdcall*)(char*))lpFarProc; //指针类型转换rnrn char ch[500]="f:\\facebmp\\2100.bmp";rn rn rn print(ch);//<em>调用</em>函数rn code =GetLastError(); //code=0rn FreeLibrary(handle); rn code =GetLastError(); //code=0rnrnrnrn在vc中 当 FreeLibrary(handle); 后退出时<em>出错</em> 报告内存不能为读程序退出。rn但是在print(ch)<em>调用</em>函数没有报错rnrn什么原因 ??怎样解决???各位帮忙!
MFC调用DLL出错
在写一个DLL,想通过其他程序通过<em>调用</em>Show函数将这个DLL调出,Show函数如下:rnrn[code=C/C++]rnextern "C" __declspec(<em>dll</em>export) void Show()rnrn HINSTANCE save_hInstance = AfxGetResourceHandle();rn AfxSetResourceHandle(theApp.m_hInstance);rn AFX_MANAGE_STATE(AfxGetAppModuleState());rn CSheet sheet("name");rn sheet.DoModal();rn AfxSetResourceHandle(save_hInstance);rn[/code]rnrn问题是:在Debug模式下运行到第一句就出现终止、重试、忽略那个东西rnrn但是在Release下没错,可以直接运行,请问问题出在哪呢?
简单DLL调用出错
VC动态连接库的输出函数为: rnextern "C" _declspec(<em>dll</em>export) int GetLen(char * cCommandLine)rn rn     MessageBox(NULL,cCommandLine,"Hello",MB_OK);rn rn  return strlen(cCommandLine);rn}rn在VB中<em>调用</em>时,可以弹出窗口,但会出现以下错误,不知为何:rn Run-time error '49'rn Bad DLL calling conventionrn rn高手指点
dll调用出错
我有个程序,在一台机器上运行是发生错误,debug后发现的引用“libjsybheap.<em>dll</em>”<em>出错</em>!(反汇编代码是 002a3581 mov exc,dword,ptr [eax])rn可是在另外一台机器上确有没有问题!rn 这是为什么?有什么办法解决!!!!!!!
调用 DLL 出错
同样的代码,同样的命令,同样的DLL,在 Delphi 6.0 下可以<em>调用</em>正常使用,但在Delphi 7.0 中<em>调用</em>时却 提示 指针错误,请帮忙!
DLL调用出错的问题...
DLL是用VC写的,里面函数原型是rnDWORD _stdcall ReadPort(BYTE *PData,size_t iLen)rnrn给我的VB<em>调用</em>示例是rnDeclare Function ReadPort Lib“***.<em>dll</em>"(ByRef pData As Byte,ByVal iLen As Integer) As intergerrnrn我用Delphi如下<em>调用</em>,却<em>出错</em>,请高手看看,是不是我<em>调用</em>的方式不对阿rnfunction ReadPort( pData:array of byte;iLen:integer):integer;external'***.<em>dll</em>';rnrn使用的时候我是写 st:=ReadPort(ComBuf, 2);
dll调用出错?!
在windows3.1下用delphi1.0开发的程序,其中用到了几个模拟屏厂家提供的窜口通信<em>dll</em>,现在老程序可在新环境下(win200,delphi6.0)吊出修改,但编译运行时提示指定位置找不到动态连接库,老程序中用到的<em>dll</em>我是一并与源程序拷在同一个目录下的,请问是哪出了问题?<em>dll</em>在新的环境下要注册吗?怎么注册?谢谢大家~
调用dll出错
源程序:rnpublic class Testrnrnpublic native int Add(int X,int Y); rnstaticrn System.loadLibrary("ExMath");rnrnrn public static void main(String[] args)rn Test t=new Test();rn int k=t.Add(4,5);rn System.out.println(k); rn rnrn-----------rn<em>dll</em>文件用其他程序测试过,没问题rnExMath.<em>dll</em>在本目录rnTest.java编译通过,运行<em>出错</em>:Exception in thread "main" java.lang.UnsatisfieldLinkError:Addrn at Test.Add(Native Method)rn at Test.main(Test.java 10)rn
调用dll结束时出错
void CTestDlg::OnBnClickedOk()rnrn // TODO: Add your control notification handler code herern typedef /*CDialog* */(WINAPI * MAPDLL)(/*CDialog* pDlg,*/ CString sText/*, CWnd* wnd=NULL*/);rn HINSTANCE hmod;rn hmod = ::LoadLibrary ("MapDll.<em>dll</em>");rn if(hmod==NULL)rn rn AfxMessageBox("Failed to load <em>dll</em> file!");rn rn MAPDLL lpproc;rn lpproc = (MAPDLL)GetProcAddress (hmod,"ShowMap");rnrn CString sText = "This is a test!";rn if(lpproc!=(MAPDLL)NULL)rn /*pDlg2 = */(*lpproc)(/*pDlg, */sText);rn rn FreeLibrary(hmod);rnrn OnOK();rnrnrn在函数结束的时候会弹出一个对话框。rnrnRun-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
JNative调用dll出错
java代码:rnpublic class test rn public static void main(String[] args) throws NativeException, IllegalAccessException rn JNative jn = null;rn jn = new JNative("ClientKey.<em>dll</em>", "DecryptPass");rn jn.setRetVal(Type.STRING);rn jn.setParameter(0, 1);rn jn.setParameter(1, "bxxsha ");rn jn.setParameter(2, "aa ");rn jn.invoke();rn String msg = jn.getRetVal();rn System.out.println("pass:" + msg);rn rnrnrn<em>出错</em>信息:rn#rn# A fatal error has been detected by the Java Runtime Environment:rn#rn# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02f014d3, pid=2360, tid=3200rn#rn# JRE version: 6.0_21-b07rn# Java VM: Java HotSpot(TM) Client VM (17.0-b17 mixed mode, sharing windows-x86 )rn# Problematic frame:rn# C [ClientKey.<em>dll</em>+0x14d3]rn#rn# If you would like to submit a bug report, please visit:rn# http://java.sun.com/webapps/bugreport/crash.jsprn# The crash happened outside the Java Virtual Machine in native code.rn# See problematic frame for where to report the bug.rn#rnrn--------------- T H R E A D ---------------rnrnCurrent thread (0x00316800): JavaThread "main" [_thread_in_native, id=3200, stack(0x008f0000,0x00940000)]rnrnsiginfo: ExceptionCode=0xc0000005, reading address 0x02bff000rnrnRegisters:rnEAX=0x02bcdce8, EBX=0x00031319, ECX=0x00031319, EDX=0x00006803rnESP=0x0092f9e4, EBP=0x0092fa60, ESI=0xbae1506d, EDI=0x00000048rnEIP=0x02f014d3, EFLAGS=0x00010202rnrnTop of Stack: (sp=0x0092f9e4)rn0x0092f9e4: 0092fa70 02f016a0 0092fa60 00000000rn0x0092f9f4: 00000000 00000000 00000000 00000000rn0x0092fa04: 00000000 00000000 02f01a60 02f01940rn0x0092fa14: 02f01700 02f016b8 02f01790 02f01af0rn0x0092fa24: 02f01868 02f018f8 02f01988 02f017d8rn0x0092fa34: 02f01748 02f01a18 02f018b0 02f01aa8rn0x0092fa44: 02f019d0 02f01820 010aee46 00006803rn0x0092fa54: 02bcdcc8 02bcb268 00ffffff 0092fa7c rnrnInstructions: (pc=0x02f014d3)rn0x02f014c3: c0 7e 77 89 45 ec bb 01 00 00 00 8b cb 8b 45 0crn0x02f014d3: 0f b6 44 18 ff d3 e0 03 c7 48 b9 ff 00 00 00 99 rnrnrnStack: [0x008f0000,0x00940000], sp=0x0092f9e4, free space=fe0092f518krnNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)rnC [ClientKey.<em>dll</em>+0x14d3]rnC [ClientKey.<em>dll</em>+0x1bc2]rnrnJava frames: (J=compiled Java code, j=interpreted, Vv=VM code)rnj org.xvolks.jnative.JNative.nInvoke(I)V+0rnj org.xvolks.jnative.JNative.invoke()V+55rnj hn.test.main([Ljava/lang/String;)V+42rnv ~StubRoutines::call_stubrnrn--------------- P R O C E S S ---------------rnrnJava Threads: ( => current thread )rn 0x02bb9400 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1656, stack(0x02e30000,0x02e80000)]rn 0x02bb6800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2856, stack(0x02de0000,0x02e30000)]rn 0x02bb1c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=2756, stack(0x02d90000,0x02de0000)]rn 0x02bcf400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1784, stack(0x02d40000,0x02d90000)]rn 0x02b6c800 JavaThread "Finalizer" daemon [_thread_blocked, id=3772, stack(0x02cf0000,0x02d40000)]rn 0x02b6b400 JavaThread "Reference Handler" daemon [_thread_blocked, id=340, stack(0x02ca0000,0x02cf0000)]rn=>0x00316800 JavaThread "main" [_thread_in_native, id=3200, stack(0x008f0000,0x00940000)]rnrnOther Threads:rn 0x02b69c00 VMThread [stack: 0x02c50000,0x02ca0000] [id=3560]rn 0x02bc7800 WatcherThread [stack: 0x02e80000,0x02ed0000] [id=2844]rnrnVM state:not at safepoint (normal execution)rnrnVM Mutex/Monitor currently owned by a thread: NonernrnHeaprn def new generation total 4928K, used 434K [0x23770000, 0x23cc0000, 0x28cc0000)rn eden space 4416K, 9% used [0x23770000, 0x237dc9c8, 0x23bc0000)rn from space 512K, 0% used [0x23bc0000, 0x23bc0000, 0x23c40000)rn to space 512K, 0% used [0x23c40000, 0x23c40000, 0x23cc0000)rn tenured generation total 10944K, used 0K [0x28cc0000, 0x29770000, 0x33770000)rn the space 10944K, 0% used [0x28cc0000, 0x28cc0000, 0x28cc0200, 0x29770000)rn compacting perm gen total 12288K, used 441K [0x33770000, 0x34370000, 0x37770000)rn the space 12288K, 3% used [0x33770000, 0x337de770, 0x337de800, 0x34370000)rn ro space 10240K, 54% used [0x37770000, 0x37cec0f0, 0x37cec200, 0x38170000)rn rw space 12288K, 55% used [0x38170000, 0x3880fb80, 0x3880fc00, 0x38d70000)rnrnDynamic libraries:rn0x00400000 - 0x00424000 D:\Java\jdk\bin\java.exern0x7c920000 - 0x7c9b6000 C:\WINDOWS\system32\nt<em>dll</em>.<em>dll</em>rn0x7c800000 - 0x7c91e000 C:\WINDOWS\system32\kernel32.<em>dll</em>rn0x77da0000 - 0x77e49000 C:\WINDOWS\system32\ADVAPI32.<em>dll</em>rn0x77e50000 - 0x77ee3000 C:\WINDOWS\system32\RPCRT4.<em>dll</em>rn0x77fc0000 - 0x77fd1000 C:\WINDOWS\system32\Secur32.<em>dll</em>rn0x7c340000 - 0x7c396000 D:\Java\jdk\jre\bin\msvcr71.<em>dll</em>rn0x6d8b0000 - 0x6db57000 D:\Java\jdk\jre\bin\client\jvm.<em>dll</em>rn0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.<em>dll</em>rn0x77ef0000 - 0x77f39000 C:\WINDOWS\system32\GDI32.<em>dll</em>rn0x76b10000 - 0x76b3a000 C:\WINDOWS\system32\WINMM.<em>dll</em>rn0x76300000 - 0x7631d000 C:\WINDOWS\system32\IMM32.DLLrn0x62c20000 - 0x62c29000 C:\WINDOWS\system32\LPK.DLLrn0x73fa0000 - 0x7400b000 C:\WINDOWS\system32\USP10.<em>dll</em>rn0x6d860000 - 0x6d86c000 D:\Java\jdk\jre\bin\verify.<em>dll</em>rn0x6d3e0000 - 0x6d3ff000 D:\Java\jdk\jre\bin\java.<em>dll</em>rn0x6d340000 - 0x6d348000 D:\Java\jdk\jre\bin\hpi.<em>dll</em>rn0x76bc0000 - 0x76bcb000 C:\WINDOWS\system32\PSAPI.DLLrn0x6d8a0000 - 0x6d8af000 D:\Java\jdk\jre\bin\zip.<em>dll</em>rn0x66c40000 - 0x66c61000 D:\Java\Project\DLLTest\JNativeCpp.<em>dll</em>rn0x77be0000 - 0x77c38000 C:\WINDOWS\system32\msvcrt.<em>dll</em>rn0x76990000 - 0x76ace000 C:\WINDOWS\system32\OLE32.<em>dll</em>rn0x770f0000 - 0x7717b000 C:\WINDOWS\system32\OLEAUT32.DLLrn0x02f00000 - 0x02f0c000 D:\Java\Project\DLLTest\ClientKey.<em>dll</em>rn0x40000000 - 0x401f2000 C:\WINDOWS\system32\vcl50.bplrn0x71a90000 - 0x71aa2000 C:\WINDOWS\system32\mpr.<em>dll</em>rn0x77bd0000 - 0x77bd8000 C:\WINDOWS\system32\version.<em>dll</em>rn0x77180000 - 0x77283000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.<em>dll</em>rn0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.<em>dll</em>rn0x76320000 - 0x76367000 C:\WINDOWS\system32\comdlg32.<em>dll</em>rn0x7d590000 - 0x7dd84000 C:\WINDOWS\system32\SHELL32.<em>dll</em>rn0x71a40000 - 0x71a4b000 C:\WINDOWS\system32\wsock32.<em>dll</em>rn0x71a20000 - 0x71a37000 C:\WINDOWS\system32\WS2_32.<em>dll</em>rn0x71a10000 - 0x71a18000 C:\WINDOWS\system32\WS2HELP.<em>dll</em>rn0x74c90000 - 0x74cb0000 C:\WINDOWS\system32\oledlg.<em>dll</em>rn0x72f70000 - 0x72f96000 C:\WINDOWS\system32\winspool.drvrnrnVM Arguments:rnjvm_args: -Dfile.encoding=UTF-8 rnjava_command: hn.testrnLauncher Type: SUN_STANDARDrnrnEnvironment Variables:rnJAVA_HOME=d:\java\jdkrnCLASSPATH=.;d:\java\jdk\lib\dt.jar;d:\java\jdk\lib\htmlconverter.jar;d:\java\jdk\lib\jconsole.jar;d:\java\jdk\lib\tools.jar;rnPATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;d:\java\jdk\bin;D:\Program Files\Symantec\pcAnywhere\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;d:\Program Files\IsoBusterrnUSERNAME=zhappyrnOS=Windows_NTrnPROCESSOR_IDENTIFIER=x86 Family 15 Model 107 Stepping 2, AuthenticAMDrnrnrnrn--------------- S Y S T E M ---------------rnrnOS: Windows XP Build 2600 Service Pack 3rnrnCPU:total 2 (2 cores per cpu, 1 threads per core) family 15 model 107 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, mmxext, 3dnow, 3dnowextrnrnMemory: 4k page, physical 1965228k(981868k free), swap 3904092k(2825940k free)rnrnvm_info: Java HotSpot(TM) Client VM (17.0-b17) for windows-x86 JRE (1.6.0_21-b07), built on Jul 17 2010 01:10:15 by "java_re" with MS VC++ 7.1 (VS2003)rnrntime: Fri May 06 09:32:09 2011rnelapsed time: 0 secondsrnrn
求助:加载DLL库文件出错
我在MFC程序中<em>加载</em>DLL时怎么<em>出错</em>了rn我在主对话框中用#import "res\AES.<em>dll</em>"后,报错:annot open type library file: 'res\AES.<em>dll</em>': <em>加载</em>类型库/DLL 时<em>出错</em>。(AES.DLL是从网上找的)rn而我用同样的方法<em>加载</em>#import "res\msado15.<em>dll</em>"就没错,这是怎么回事啊
ODP.NET相关,dll加载出错
机器环境:win2000p,iis5.0,安装ODP.NET无错误提示,运行程序异常:rn无法<em>加载</em><em>dll</em>(OraOps9.<em>dll</em>),请问这如何解决?rn其他信息:机器上装有Oracle8i,本来希望装上ODP.NET以连接另外一台装有rnOracel9i的机器。
DllMain中加载DLL出错!
BOOL APIENTRY DllMain( HANDLE hModule, rn DWORD ul_reason_for_call, rn LPVOID lpReservedrn )rnrn switch (ul_reason_for_call)rn rn case DLL_PROCESS_ATTACH:rn rn if (::LoadLibrary("MyDLL.<em>dll</em>") == NULL) rn int i = GetLasrError();rn return FALSE;rn rn break;rn rn case DLL_THREAD_ATTACH:rn case DLL_THREAD_DETACH:rn case DLL_PROCESS_DETACH:rn break;rn rn return TRUE;rnrnrnrn在DllMain中LoadLibrary返回值为NULL,i=998,如果不是在DLLMain中<em>加载</em>就成功.rn我也看了MSDN的东西,原文如下:rn--------------rnPRB: API LoadLibrary 失败, 998 (ERROR_NOACCESS) 错误rn察看本文应用于的产品rn注意:这篇文章是由无人工介入的自动的机器翻译系统翻译完成。这些文章是微软为不懂英语的用户提供的, 以使他们能够理解这些文章的内容。微软不保证机器翻译的正确度,也不对由于内容的误译或者客户对它的使用所引起的任何直接的, 或间接的可能的问题负责。rn文章编号 : 196069 rn最后修改 : 2004年4月13日 rn修订 : 1.0 rn症状rnLoadLibrary() API 有时会遇到试图映射到<em>调用</em>进程地址空间指定模块时发生访问冲突。 在此事件, LoadLibrary() 返回值为 NULL 并且 GetLastError() 返回错误代码是 998 (ERROR_NOACCESS)。 rn 回到顶端 rnrn原因rnWindowsNT 状态代码 STATUS _ ACCESS _ VIOLATION 映射到 ERROR_NOACCESS Win 32 错误代码。 因此, 如果操作系统<em>加载</em>程序遇到访问冲突 (异常 C 0000005) 映射指定 DLL 时图像文件或执行启动代码, <em>加载</em>将设置到 998 (ERROR_NOACCESS) 最后错误并 LoadLibrary() 函数将失败, 返回值为 NULL。 rn 回到顶端 rnrn更多信息rn当启动代码, 中任意位置发生访问冲突异常发送器检测是否正在调试进程遇到此异常。 若是, 此第一次机会异常发送到调试器。 rnrn为解决 LoadLibrary() 故障, 运行应用程序在调试器并启用首次机会异常处理为 C 0000005 访问冲突异常。 如果<em>调用</em> LoadLibrary() 函数, 时发生访问冲突应用程序将中断到调试器。 调试程序<em>调用</em>堆栈然后跟踪用于发生异常。 堆栈跟踪可帮助您缩小实际问题与正在遇到异常。 rnrn请有关如何启用首次机会异常处理为 C 0000005 访问冲突异常, 请参考其调试器文档。 rn 回到顶端 rnrn---------------rnrn简直说的不知所云!!!!!!!rn也不说解决之道!!!!!rn有哪位知道如何解决?rnrnrn
VB调用VB编写DLL
这是简单的用<em>vb</em>写的一个<em>dll</em>,并用<em>vb</em>进行<em>调用</em>,抛砖引玉.此资料为自己学习所用,无实际下载意义!有需要的,可免积分下载.
vb 调用vb dll的问题。
我用vc写了个动态链接库,想在<em>vb</em>里面<em>调用</em>。由于<em>vb</em>经验不足,今天弄了一天还是没有弄出来。rn在网上查了很多资料也没有关于 char**,或char*[]如何在<em>vb</em>里使用的情况。rn希望高手能够帮忙!万分感激!rnrnvc里的接口如下:rn//.h文件rnvoid __stdcall queryDemo(char* query, char* queryResult[],int count); rn//.cpp文件rnvoid __stdcall queryDemo(char* query, char* queryResult[],int count)rn for (int i=0;i
VB调用VC写的dll,第二次调用CSocket的Create出错
VB第一次<em>调用</em><em>dll</em>中的Create正常,第二次<em>调用</em><em>出错</em>,为什么?具体代码如下:rn<em>dll</em>中的代码:rnint __stdcall kk()rn rn AfxSocketInit();rn CSocket sockClient;rn sockClient.Create();rn sockClient.Close();rn return 0;rnrn第一次<em>调用</em>正常,第二次<em>调用</em><em>出错</em>,两次分别用不同的端口也不行。
加载类型库/DLL时出错。"">加载dll时出现了"加载类型库/DLL时出错。"
我在用“Project - Import Type Library - Add”<em>加载</em>一个<em>dll</em>文件时出现了"<em>加载</em>类型库/DLL时<em>出错</em>。",请问是什么原因?谢谢!
VB怎么调用dll
VB怎么<em>调用</em><em>dll</em>rnDim gn As ObjectrnSet obj = CreateObject(.....)rn括号我写<em>dll</em>名字不对,写路径也不对,DDL应如何和VB相联?rn我DLL里有个SUB叫JN如<em>调用</em>?如果是函数又如何<em>调用</em>?谢谢rn
VB调用 dll问题
别人给我做了一个<em>dll</em>,其中的函数名有点怪,如 "_GetFilename&8",我在VB中如何<em>调用</em>?
Vb调用dll的方法
<em>vb</em><em>调用</em><em>dll</em>的方法,很简单实用,自己可以试试!
VB调用CVI的DLL
主要实现VB<em>调用</em>CVI的DLL,主要实现VB<em>调用</em>CVI的DLL
VB 调用DLL的问题
我用VC写了一个DLL,里面有一个函数和一个结构体的定义。rn我想让函数返回这个结构体的数组,然后VB<em>调用</em>这个DLL获得那个结构体数组,应该怎么写啊?rnrn
vb调用delphi dll
我用DEPHI7.0编写了一个DLL,在DELPHI里可以<em>调用</em>,但我不知道怎么在VB里<em>调用</em>,有高手懂请一定赐教,感恩不尽!rn 下面是DLL模块里的部分代码:rn library prjDLL;rn rn usesrn SysUtils,rn Forms,rn Windows,rn Messages,rn Classes,rn DLLFormUnit in 'DLLFormUnit.pas' frmDLLForm,rn AboutUnit in 'AboutUnit.pas' frmAbout,rn sumt_fgh in 'sumt_fgh.pas' Form3;rn rn $R *.resrn rn varrn DLLApp: TApplication;rn DLLScr: TScreen;rn function CreateDLLForm(App: TApplication; Scr: TScreen):TForm;rn rn rn varrn ptr:PLongInt;rn beginrn Application := App;rn Screen := Scr;rn Application.CreateForm(TfrmDLLForm, frmDLLForm);rn Application.CreateForm(TfrmAbout, frmAbout);rn Application.CreateForm(TForm3, Form3);rn result:=frmDLLForm;rn end;rn rn procedure ExitDLL(Reason: Integer);rn beginrn if Reason = DLL_PROCESS_DETACH thenrn beginrn Application := DLLApp;rn Screen := DLLScr;rn end;rn end;rn rn exportsrn CreateDLLForm;rn rn beginrn DLLApp := Application;rn DLLScr := Screen;rn DLLProc := @ExitDLL;rn rn end.
vb 调用dll的问题
这是一个c写的读卡函数rnunsigned pascal ICC_read_bin(HANDLE fd,long offset,int len,unsigned char *resp); /*rn 参数: fd : 已打开的端口描述符.rn offset : 对CPU卡为文件偏移量 对存储卡为绝对地址rn len : 欲读数据的长度rn resp : 读出的数据rn厂商就只给了接口和动态链接库文件rn现在我用<em>vb</em><em>调用</em>该读卡函数rnrn'读卡rn Declare Function ICC_read_bin Lib "crwicc.<em>dll</em>" (ByVal fd As Long, ByVal offSet As Long, ByVal leng As Long, ByVal ReadDate As String) As Longrn rn用<em>vb</em><em>调用</em>动态链接库rnrn然后我在<em>vb</em>里这样写rnrn ReadDate = ""rn readIC = ICC_read_bin(hPort, 64, 15, ReadDate)rn If Hex(readIC) <> 9000 Thenrn MsgBox "对IC卡读取数据失败,检查IC卡是否损毁"rn Elsern MsgBox ReadDatern MsgBox Left(Trim(ReadDate), 4)rn End Ifrnrn为什么MsgBox ReadDate 为6000 MsgBox Left(Trim(ReadDate), 4) 为空rn读出的内容应该是010123457666666 的rn还请大家指教 在线等了
VB调用VC DLL
VB6.0<em>调用</em>VC6.0编写的DLL,内付VB与VC源码
c#调用vb dll
本例子中实现在c#中<em>调用</em>由<em>vb</em>生成的<em>dll</em>文件(com<em>调用</em>)例子由两个主要步骤组成:一 为在<em>vb</em>中生成有参数和返回值的<em>dll</em> ;二 是在c#中引入步骤一中生成的<em>dll</em>,然后生成实例<em>调用</em>步骤一:首先在<em>vb</em>中新建一个ActiveX DLL 工程,然后在类模块文件中填入以下代
jawin 调用VB dll
刚接触jawinrn想用jawin<em>调用</em>以前的<em>dll</em>(VB做的)rn请求达人指点一下(具体实现过程)。rn多谢!
vb调用dll问题
我有一个已经编译好的<em>dll</em>,没有<em>dll</em>的代码。rnrn然后这个<em>dll</em>也不知道是用什么开发的。。rnrn在注册<em>dll</em>的时候报<em>加载</em>成功,但是找不到<em>dll</em>RegisterServer的加入点。rnrn然后用<em>vb</em>的win32 application可以<em>加载</em><em>dll</em>,但是<em>调用</em>里面函数的时候application自动退出。连编译环境一起退出了。。rnrn请问各位大虾,这是咋回事?有啥办法解决不?
vb调用dll
我新建了一个<em>dll</em>文件,然后和工程放在同一个目录下,然后在调试时提示找不到这个文件,但编译后却一点问题没有,倒
VB加载VC做的DLL
如果用VC做一个DLL,实现在DLL内部实现图片<em>加载</em>,并在VB应用程序中<em>显示</em>rn比如说,我要<em>显示</em>"c:\TEST.JPG",在VB中通过DLL中功能函数SHOWPIC,将其<em>显示</em>在VB应用程序的窗体上.rn
jdk 1.6 英文帮助文档 chm版下载
Sun公司提供了html版的帮助文档,但是chm版更方便些。所以就传上来了。希望能对大家有用。 相关下载链接:[url=//download.csdn.net/download/jayaolon/1132925?utm_source=bbsseo]//download.csdn.net/download/jayaolon/1132925?utm_source=bbsseo[/url]
T J 系列z刷日志下载
很强大,结合多种功能,能刷1300以上,喜欢就拿去吧。 相关下载链接:[url=//download.csdn.net/download/tokjim/3992882?utm_source=bbsseo]//download.csdn.net/download/tokjim/3992882?utm_source=bbsseo[/url]
primavera R8.2全套下载地址下载
链接进去,建立一个账号即可下载!最新版! 相关下载链接:[url=//download.csdn.net/download/taoshunwei/5195239?utm_source=bbsseo]//download.csdn.net/download/taoshunwei/5195239?utm_source=bbsseo[/url]
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件
我们是很有底线的