我想在我的程序中进行动态查询.SQL Server有针对此类任务的简洁sp_executesql过程,MySQL中有什么可以帮助我实现类似的功能吗?
我使用一些使用直接绘制的遗留代码,我处于相当尴尬的境地.不久前我已更新我的系统,不得不适应新的情况(加载ddraw.dll),一切正常.今天我探索了另一个传统的解决方案,它也使用了我已经改变的类(文件),但我坚持上面提到的链接错误.我检查并比较了项目属性,他们缝得很好.
这是directX初始化的代码,"麻烦"的代码是粗体.
typedef int (__stdcall *DirectDrawCreateFunc)(GUID FAR* a ,LPDIRECTDRAW FAR* b, IUnknown FAR* c);
/* init_directx:
* Low-level DirectDraw initialization routine.
*/
int CDCUtils::init_directx(HWND allegro_wnd)
{
LPDIRECTDRAW directdraw1;
HRESULT hr;
LPVOID temp;
HINSTANCE ddraw = LoadLibrary("%WINDIR%\system32\ddraw.dll");
if(ddraw== NULL)
{
return -1;
}
_ddrawLib =ddraw;
DirectDrawCreateFunc ddFunc = (DirectDrawCreateFunc)GetProcAddress(ddraw,"DirectDrawCreate");
if(ddFunc)
{
/* first we have to set up the DirectDraw1 interface... */
hr = ddFunc(NULL, &directdraw1, NULL);
if (FAILED(hr))
return -1;
}
///* first we have to set up the DirectDraw1 …Run Code Online (Sandbox Code Playgroud)