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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   How to disable SolidWorks memory handler(C++) (http://www.dimcax.com/hust/showthread.php?t=451)

huangyhg 2007-01-23 10:45 PM

How to disable SolidWorks memory handler(C++)
 
C++

How to disable SolidWorks memory handler


A DLL add-in runs in the same address space as SolidWorks. If your DLL dynamically allocates memory, then this memory is in the SolidWorks address space.

SolidWorks installs an exception handler that catches all failures to dynamically allocate memory. In some cases, the add-in can adjust its algorithms for such low memory situations. However, the SolidWorks memory handler is invoked upon any such failures.

To install your own memory handler, you can use the VC++ function:

_set_new_handler()


before attempting to dynamically allocate memory. You should always restore the SolidWorks memory handler after you have finished allocating memory.


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