几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 09:01 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】odinitialize90 causes runtime error

odinitialize() causes runtime error
odinitialize() causes runtime error
hello
it might well be, that my topic doesn't belong in this forum... but maybe you can share some dwgdirect c++ wisdom/experience with me and point me to the right direction.
i've built an activex control using vs9 with a rather simple interface. my dll links to your dwgdirect libraries (vc9md). the control is kept quite simple. every call to an interface-function initializes dwgdirect, does what it is intended to do, uninitializes dwgdirect and returns (sample code). on the other hand i have a console-application called tester, which calls the registered activex controll (my dll). this application is also built in vs9. so both my dll and the tester depend on msvcr90.dll, as do the dwgdirect dlls (msvcr90.dll, msvcp90.dll).
sample code:
code:
stdmethodimp cdxfmerge::determinedimension(bstr dxfdrawing, double* height, double* width, long* returncode)
{
odstaticrxobject<myservices> svcs;
odinitialize(&svcs);
odgsinitialize();
{ //scope for smartpointers
int rcode = rc::r_odread;
try{
oddbdatabaseptr pdb = svcs.readfile( dxfdrawing, false, false, oda::ksharedenyno );
double h = 0;
double w = 0;
rcode = commonfunctions::calculatedimension( pdb, h, w );
*height = h;
*width = w;
} catch( oderror e ){
odstring s = e.description();
odresult r = e.code();
}
*returncode = rcode;
} //scope for smartpointers
odgsuninitialize();
oduninitialize();
return s_ok;
}when i run that tester console-application, everything works fine. i open, edit and write dxf-files with no problems at all. so far, so good.
however, if i build another console-application (very same code) in vs8 and then make calls to my dll, i get following error: r6034 an application has made an attempt to load the c runtime library incorrectly.
this error occurs, as soon as i use dwgdirect functionality inside my dll(i.e. odinitialize()).
what could be the reason for this? do i have to use other library types, which ones?
thanks in advance for your help!
martin
----------------------------
additional info:
compiler-settings:
code:
/od /i "d:\classcad_addons\opendesign\2.06\include" /i "d:\classcad_addons\opendesign\2.06\include\ge" /i "..\dwgdirect\exservices" /i "d:\classcad_addons\opendesign\2.06\include\gs" /i "..\dwgdirect\common" /i "..\dwgdirect\bmpexport" /i "d:\classcad_addons\xerces\2.8\include" /i "d:\classcad_addons\cximage\599c\cximage" /d "win32" /d "_windows" /d "ndebug" /d "_usrdll" /d "_toolkit_in_dll_" /d "_windll" /d "_atl_dll" /d "_unicode" /d "unicode" /fd /ehsc /md /fo"release\\" /fd"release\vc90.pdb" /w3 /nologo /c /zi /tp /errorreportromptthe linker-settings:
code:
/out:"d:\myproject\\bin\release\merge.dll" /incremental:no /nologo /libpath:"d:\classcad_addons\opendesign\2.06\lib\vc9md" /libpath:"d:\classcad_addons\xerces\2.8\vc9\lib\release" /libpath:"d:\classcad_addons\cximage\599c\cximage\cximagedll\release" /dll /manifest /manifestfile:"release\merge.dll.intermediate.manifest" /manifestuac:"level='asinvoker' uiaccess='false'" /def:".\merge.def" /subsystem:windows /opt:ref /opt:icf /dynamicbase /nxcompat /machine:x86 /errorreportrompt dd_vc9md_jpeg.lib dd_gs_dll.lib dd_db_dll.lib dd_dbroot_dll.lib dd_ge_dll.lib dd_root_dll.lib dd_acisbuilder_dll.lib dd_gi_dll.lib dd_alloc_dll.lib dd_key.lib xerces-c_2.lib cximagecrt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
this is probably a manifest problem.
to make sure - add to the vc8 console application manifest references to vc9 runtime.
vladimir

i did as you proposed and it worked!
thanks for the rather fast reply!
martin
fighting the dll hell, ms seem to have produced a manifest one
vladimir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】link errors in odreadex on visual studio 2005 yang686526 DirectDWG 0 2009-05-06 05:00 PM
【转帖】error when using afx.h yang686526 DirectDWG 0 2009-05-05 09:48 AM
【转帖】error c2664 yang686526 DirectDWG 0 2009-05-05 09:34 AM
【转帖】cant compile odrx-heap-operators90 in rxobject.h yang686526 DirectDWG 0 2009-05-04 05:31 PM
【转帖】2005 link error yang686526 DirectDWG 0 2009-05-04 02:57 PM


所有的时间均为北京时间。 现在的时间是 08:04 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多