There is the following part of the code:

procedure TForm1.FormActivate(Sender: TObject); begin DM.TrayIcon1.Visible := true; DM.TrayIcon1.Hint := 'Журнал заявок'; // Убираем с панели задач ShowWindow(Handle, SW_HIDE); // Скрываем программу ShowWindow(Application.Handle, SW_HIDE); // Скрываем кнопку с TaskBar'а SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or (not WS_EX_APPWINDOW)); end; 

When compiling, an access violation error occurs (see figure).

Is memory overflow in this procedure possible?

Mistake

  • 2
    You get an error not when compiling, but when launching an application. It is necessary to run through debag, directly in the IDE. Then you will see exactly where the error occurred. See where - add your question with this information, and you can guess a lot. Offhand - dm has not yet been initialized. - kami
  • judging by the fact that the address is read close to zero, then most likely it is. - teran

0