You are setting mem-flags to a 1 which indicates that you wish to allocate shared memory. In the docs under CBL_ALLOC_MEM it says: The maximum size of shared memory is restricted by the operating system and the run-time system. The run-time tunable, shared_memory_segment_size, can be used to set the maximum size. The default is 65536, and the minimum is 8192 bytes. So you are limited to 65636 unless you change this setting. You can change the max shared memory by setting the run-time tunable shared_memory_segment_size. The easiest way to change this is to create a config file and set the environment variable COBCONFIG to point to its name. The file would contain: set shared_memory_segment_size=60000 If you saved the above in file c:\temp\cobconfig.cfg and set environment variable COBCONFIG=c:\temp\cobconfig.cfg then this would allow you program to allocate shared memory blocks of 600000 bytes. If you are creating an .exe from your project then you can also add an application.config file to your project by right-clicking on the project and selecting add-->New Item and then choose application.config file. Click on the app.config file to open the editor and then click on the run-time tunable configuration. Look for the option for Shared Memory-->Initial size of the shared memory block and change the value there. Try again.
↧