Форум программистов «Весельчак У»
  *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: 1 [2]  Все   Вниз
  Печать  
Автор Тема: Удаление массива  (Прочитано 38867 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Dobro
Гость
« Ответ #30 : 26-01-2004 09:18 » 

Копали вы в правильном направлении, но немного не докопали. Вся проблема у Lex в том, что он статически линкует MFC в своем проекте. Именно в этом случае каждая пользовательская dll использует отдельный пул в памяти. И получается, что функции основного модуля (exe) используют один пул в памяти, а функции динамической библиотеки - другой.
Вот что по этому поводу вещает нам MSDN

Quick Note on Memory Management

The section titled “Memory Management,” near the end of this technical note, describes the implementation of the MFCxx.DLL with the shared version of MFC. The information you need to know to implement just an extension DLL is described here.

MFCxx.DLL and all extension DLLs loaded into a client application's address space will use the same memory allocator, resource loading and other MFC “global” states as if they were in the same application. This is significant because the non-MFC DLL libraries and regular DLLs that statically link to MFC do the exact opposite and have each DLL allocating out of its own memory pool.

If an extension DLL allocates memory, then that memory can freely intermix with any other application-allocated object. Also, if an application that uses the shared MFC libraries crashes, the protection of the operating system will maintain the integrity of any other MFC application sharing the DLL.

Similarly other “global” MFC states, like the current executable file to load resources from, are also shared between the client application and all MFC extension DLLs as well as MFCxx.DLL itself.
Записан
Джон
просто
Администратор

de
Offline Offline
Пол: Мужской

« Ответ #31 : 26-01-2004 10:49 » 

Dobro, Точно!!! Чёт такое было. Помню только, когда сделал другую облочку со статическим MFC длл-ки перестали грузится. Надо покапать.
Записан

Я вам что? Дурак? По выходным и праздникам на работе работать. По выходным и праздникам я работаю дома.
"Just because the language allows you to do something does not mean that it’s the correct thing to do." Trey Nash
"Physics is like sex: sure, it may give some practical results, but that's not why we do it." Richard P. Feynman
"All science is either physics or stamp collecting." Ernest Rutherford
"Wer will, findet Wege, wer nicht will, findet Gründe."
Алексей++
глобальный и пушистый
Глобальный модератор

ru
Offline Offline
Сообщений: 13


« Ответ #32 : 15-04-2006 18:18 » new

(комент)

Джон, ну так как - победили или нет? Улыбаюсь
Если да в FAQ , наверное.

Записан

Страниц: 1 [2]  Все   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines