Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7876301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:08:50+00:00 2026-06-03T03:08:50+00:00

I hope I can explain this problem decently well! I’m trying to implement a

  • 0

I hope I can explain this problem decently well!

I’m trying to implement a ReWire audio device as a Delphi .dll. If you don’t know what ReWire is, don’t worry about it. What’s important is that my code compiles into a .dll, and I get calls from the ReWire system into my .dll to open up a display, check if the display is opened, and close it again.

When I get the call to launch, I do the following:

  if not Assigned(form) then
    form := TMyForm.Create(nil);
  form.Show;

where form is a global variable inside of my Delphi library (maybe a problem?). I have hooked up MyForm‘s OnCreate event to do some interesting things like prepare an array of stuff I want to work with.

So far everything’s good. My form has a little button in it that opens up a TOpenDialog. I find that as soon as that dialog closes, somehow the OnCreate event is firing again in my form!

I have checked that OnDestroy is not being called, so I have no idea why OnCreate is getting called again.

Unfortunately I’m not really sure what information is relevant, but here’s the call stack the first time around (when the form is first set up):

First call stack

As expected, ReWire is making a call into my .dll to Launch the Panel application, so I create my form. Great, things are looking good.

Then inside my form, I open up a little dialog, select a file, and do some operations. Out of left field, OnCreate is called again, and here’s the call stack that time:

Second call stack

It’s a crazy party of calls! Reaper (at the bottom) is the ReWire host I’m using to test my application, but I have no idea what’s going on inside that stack trace because none of it is my code. Suddenly the event just gets called when I don’t think it should, because OnDestroy wasn’t even called.

The only other important thing I can think of is that if I print out the address of the Sender, it’s different each time, so it’s somehow getting Created again or something, but I’ve checked that I only call the MyForm.Create once.

Any ideas as to how this type of thing could happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:08:50+00:00Added an answer on June 3, 2026 at 3:08 am

    In the first stack trace, the OnCreate call is preceded by a call to TCustomForm.Create(), which is correct behavior. In the second stack trace, the OnCreate call is preceded by a call to TObject.Create() instead, which is not correct behavior. That leads me to think that something in your button OnClick event handler is either constructing an object with a bad VMT, or is otherwise corrupting memory in general and causing a bad jump into code that just happens to be occupied by your TForm class. Either way, double check your OnClick logic for bugs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well guys, this problem just baffles me. I hope someone can explain to me
I hope I can explain this well enough so that you can understand the
I hope this I can explain what I am trying to achieve: I want
This is in my opinion an abstract problem and I hope I can explain
Hello I hope someone can explain this problem. This is the code: class Memory{
I hope I can explain this properly. I'm using flashDevelop for an avatar creation
I hope I can explain this right I have two input fields that require
I hope I can explain my problem in a way that it's clear for
Image describing the problem http://img215.imageshack.us/img215/3725/20100314235127schedule2.jpg I hope the image above can explain what I
Hope someone can help me out with this problem I am having. I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.