请教DLL中使用数据模块的方法,就这点分了,先谢谢了(26分)

  • 主题发起人 主题发起人 lifepass
  • 开始时间 开始时间
L

lifepass

Unregistered / Unconfirmed
GUEST, unregistred user!
在DLL中使用数据模块.和平常有什么不一样的.我刚学,写了个例子编译可以通过,可是运行出错.
//---------------------------------------------------------------------------
#include <windows.h>
#include &quot;StoredProcess.h&quot;
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
switch(reason)
{
case DLL_PROCESS_ATTACH:
CoInitialize(NULL);
break;

case DLL_PROCESS_DETACH:
CoUninitialize();
break;
case DLL_THREAD_DETACH:
CoUninitialize();
break;
case DLL_THREAD_ATTACH:
CoInitialize(NULL);
break;
}
return 1;
}
//---------------------------------------------------------------------------
extern &quot;C&quot;
__declspec(dllexport) void __stdcall IV_RealStored(char *DevProviderName,const DynamicArray<int>& DevInfo)
{
dm_Stored->StoredProc_CDS->ProviderName=AnsiString(DevProviderName);
dm_Stored->StoredProc_CDS->Params->Clear();
for(int i=0;i<=DevInfo.Length;i++)
{
dm_Stored->StoredProc_CDS->Params->Add();
if(i==0)
dm_Stored->StoredProc_CDS->Params->Items[0]->AsDateTime = DateTimeToStr(Now());
else
dm_Stored->StoredProc_CDS->Params->Items->AsInteger=DevInfo[i-1];
}
dm_Stored->StoredProc_CDS->Execute();

}
 
后退
顶部