I use shared memory inside my dll.
(#pragma data_seg )
I must initialize all verbs i put in that segment (if not ever process that loads the dll will get its own copy of the shared verbs).
It is easy to init primitive, but can i put object there?
How can i init it?
I read somewhere that if i init a class member inside the constructor then that will be ok but it did not work.
(the object was not shared and each process that loaded the dll got its on copy).
What can i do?
2)I have this code:
class AAA : CDialog
AAA *o = new AAA();
If i run it i get:
error C2247: 'new' not accessible because 'CDialog' uses 'public' to inherit from 'CWnd'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(674) : see declaration of 'new'
error C2247: 'delete' not accessible because 'CDialog' uses 'public' to inherit from 'CWnd'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(676) : see declaration of 'delete'
So i tried to use malloc and it worked, it did not gave that error.
The problem with malloc is that it does not call the constructor and i need that constructor to be called since i do things in the constructor that must be done only there.
Any workaround here?