乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 10|回复: 0

arx 工程在特定的文件出错

[复制链接]

62

主题

218

帖子

10

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
466
发表于 2014-8-18 16:31:00 | 显示全部楼层 |阅读模式
acrxEntryPoint.cpp文件
  1. // (C) Copyright 2002-2012 by Autodesk, Inc.
  2. //-----------------------------------------------------------------------------
  3. //----- acrxEntryPoint.cpp
  4. //-----------------------------------------------------------------------------
  5. #include "StdAfx.h"
  6. #include "resource.h"
  7. #include "CreateEnt.h"
  8. #include "ModifyEnt.h"
  9. #include
  10. #pragma once;
  11. using namespace std;
  12. //-----------------------------------------------------------------------------
  13. #define szRDS _RXST("")
  14. //-----------------------------------------------------------------------------
  15. //----- ObjectARX EntryPoint
  16. class CtxbhApp : public AcRxArxApp {
  17. public:
  18.   CtxbhApp () : AcRxArxApp () {}
  19.   virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
  20.     // TODO: Load dependencies here
  21.     // You *must* call On_kInitAppMsg here
  22.     AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
  23.    
  24.     // TODO: Add your initialization code here
  25.     return (retCode) ;
  26.   }
  27.   virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
  28.     // TODO: Add your code here
  29.     // You *must* call On_kUnloadAppMsg here
  30.     AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
  31.     // TODO: Unload dependencies here
  32.     return (retCode) ;
  33.   }
  34.   virtual void RegisterServerComponents () {}
  35.   static void MyGroup_test () {
  36.     // Put your command code here
  37.     AcGePoint3d pt(0,0,0);
  38.     vector pts;
  39.     for(int i=0;i::iterator j=pts.begin();j!=pts.end();++j)
  40.     {
  41.       ACHAR str[10];
  42.       AcDbObjectId textId;
  43.       acdbRToS(bstart,-1,-1,str);
  44.       textId = CCreateEnt::CreateText((*j),str,7);
  45.       CModifyEnt::ChangeColor(textId, 3);
  46.       CModifyEnt::ChangeWidthFactor(textId, 0.7);
  47.       bstart=bstart+1;
  48.     }
  49.   }
  50.   
  51.   
  52. } ;
  53. //-----------------------------------------------------------------------------
  54. IMPLEMENT_ARX_ENTRYPOINT(CtxbhApp)
  55. ACED_ARXCOMMAND_ENTRY_AUTO(CtxbhApp, MyGroup, _test, test, ACRX_CMD_MODAL, NULL)
CreateEnt.h文件复制代码CreateEnt.cpp文件复制代码ModifyEnt.h文件复制代码ModifyEnt.cpp文件复制代码上面5段代码合在一起的压缩文件:
用于测试的图形
     现在是这样情况,我手头三台电脑:
1、安装win7x64+cad2014;
2、安装win7x86+cad2007;
3、安装winXPx86+cad2008;
三台电脑在新建的空白文件上运行上述代码都没有问题;1#机在test.dwg中运行上述代码也没有问题;2#机和3#机在test.dwg中运行上述代码就引起cad崩溃,提示acad.exe缓冲区溢出。

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-5 04:50 , Processed in 0.155675 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表