应是你的 VC 做的过程 ReturnJubCdLabel(int n,char*p);
要用 stdcall 定义其参数调用方式,在Delphi中方可在默认方式下
顺利调用,详细可看看MSDN,和查看DELPHi有关的STDCALL,CDECL 等等的
定义说明
要用 stdcall 定义其参数调用方式,在Delphi中方可在默认方式下
顺利调用,详细可看看MSDN,和查看DELPHi有关的STDCALL,CDECL 等等的
定义说明
调试欢乐多
extern"C"__declspec(dllexport) int ReturnJubCdLabel(int pSlot,char *pLabel)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState()); DWORD t=100;
LPDWORD size=&t;
char ComName[100];
::GetComputerName(ComName,size);
CString m_ComName(ComName);
jbmSetupConnection(m_ComName);//jbmSetupConnection是将这里要用的第3方动态连接库与机算计相连的函数
JBMSDK_JUKEBOX_T*m_pJukebox=new JBMSDK_JUKEBOX_T;
jbmGetJukeboxByNr(0,m_pJukebox);//Get jukebox's information include numMagazines and numSlots;
UINT JukeNr=m_pJukebox->jbxId;//Jukebox'ID;
JBMSDK_SLOT_T*m_pSlotIfom=new JBMSDK_SLOT_T; //这个接够里有一个260位的字符树组
jbmGetSlot(JukeNr,pSlot,m_pSlotIfom);//Get the first slot infomation. 给这字符数组里添字符 strcpy(pLabel,m_pSlotIfom->label);//传给delphi提供的pchar参数!
delete m_pSlotIfom;
delete m_pJukebox; return 0;}
高手救命!
volume: array[0..260] of Char;
begin
ReturnJubCdLabel(1, volume);
ShowMessage(volume);
end;
stopped.use step or Run to continue
我记得一般都是对不可写的内存执行写操作等等的时候的毛病啊!
再说伴水的方法好使的话,实在是很有可能是因为内存的缘故而不是DLL.
请仔细检查你前面VOLUME的定义和操作,
如有问题请速贴上来让大家了解真相.
volume:PChar;
...
GetMem(volume,260);
ReturnJubCdLabel(1,volume);
//这句改成ReturnJubCdLabel(1,volume^);试试。。
extern"C"__declspec(dllexport) int __stdcall ReturnJubCdLabel(int pSlot,char *pLabel)