Recent

Author Topic: Failed to create win32 control error 0: operation completed successfully??  (Read 2647 times)

FeelingPain

  • New member
  • *
  • Posts: 7
Hello all!

I'm creating a program utilising a TOpenDialog, however I am having an issue where every other time the program is run on my laptop so I can test it, I get the error "Failed to create win32 control error 0: the operation completed successfully" and a memory address. This only happens when I have the TOpenDialog in the form and then show that form, but the crash happens when it starts showing "(debugging...)". It happens every other time I run the program and show the form with the TOpenDialog, even if I don't activate it through a button press, it'll crash the entire IDE with that message next time I run it. Only fix is to close/reopen Lazarus. If there's no TOpenDialog, my program runs fine every single time.

I'm struggling here to figure out what I need to do to fix this - I think there's something wrong with my Lazarus installation as on a seperate computer with Lazarus installed it debugs fine every time... I have already tried to uninstall/reinstall Lazarus using the included uninstaller but I'm still getting the issue and I don't think all the Lazarus files were deleted. Not sure what I'm doing or what I can do to try and fix this? Maybe how to clean uninstall/reinstall the IDE?

Thanks for reading this wall of text.

FeelingPain

  • New member
  • *
  • Posts: 7
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #1 on: February 19, 2020, 05:26:29 pm »
Also, whenever the IDE crashes from this error it comes up with a "Read error" window saying the message "Access violation
Access violation" with an OK button. I don't have anything else apart from Lazarus open? Not even the File Explorer

Thaddy

  • Hero Member
  • *****
  • Posts: 14200
  • Probably until I exterminate Putin.
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #2 on: February 19, 2020, 05:52:06 pm »
Example code? >:(
Specialize a type, not a var.

FeelingPain

  • New member
  • *
  • Posts: 7
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #3 on: February 20, 2020, 12:42:58 am »
I can't really provide example code as this happens if a TOpenDialog is in the form in the form editor. Removing the TOpenDialog "fixes" the issue/doesn't crash my IDE every other time I try to run the program, but I need this TOpenDialog box for my user. Doesn't matter if no code is running - if I just use FormThatHasTheTOpenDialog.Show, then the next time I run my program for debugging, it's gonna give me the win32 control error 0.

But here's basically how I'm using the TOpenDialog, if this helps.
Code: Pascal  [Select][+][-]
  1. if OpenDialog.Execute then Path := OpenDialog.Filename;

This doesn't appear to happen on a work computer with Lazarus installed, so I think my Lazarus installation is messed up or something but I don't know how to cleanly fix this or uninstall or whatever I can try doing. I can post my PC specs if that helps but I know I'm running a 64-bit Windows 10 and downloaded the 64-bit Lazarus 2.0.6... Sorry if this isn't much help but it's all I can provide.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #4 on: February 20, 2020, 01:02:18 am »
Hi!

Check if there are some weird values  of the OpenDialog in the OI.
InitialDir? Filter?

And now a tip - not logic but it helps sometimes:

Delete the OpenDialog from the project.
Save it and close lazarus.
Restart Lazarus and add a new OpenDialog.
Does the mess happen again?

Winni


Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #5 on: February 20, 2020, 03:26:33 am »
I can't really provide example code ...

Without code to test, it is hard to say where is the problem.

I used TOpenDialog in some of my programs, no problem so far. So I don't think the bug is in the TOpenDialog. Not much but here are things you can try:

- Totally uninstall Lazarus/FPC and reinstall again
- Try the code on different versions of Lazarus/FPC
- Try the code running in a virtual machine
- Make sure the computer is virus free and then disable the antivirus

But first I recommend you to try someone code's to see if the issue will happen or not. If not, then the problem is in your code. Maybe you can try this demo:
https://forum.lazarus.freepascal.org/index.php/topic,37442.msg251587.html#msg251587

Zvoni

  • Hero Member
  • *****
  • Posts: 2317
Re: Failed to create win32 control error 0: operation completed successfully??
« Reply #6 on: February 20, 2020, 11:09:28 am »
Is your "problematic" IDE-installation pointing to a/the correct debugger?
I'd check the debugger-settings between your working and problematic IDE-Installation
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018