Visio Guy

Product Support => Paul Herber's Products => Topic started by: Nikolay on December 09, 2010, 05:43:35 AM

Title: Register: Call to OS function failed?
Post by: Nikolay on December 09, 2010, 05:43:35 AM
The registration of Visio Super Utilities does not seem to work on Windows 7 x64? Even if you run Visio as Administrator, i.e. UAC is off. Visio 2007 Prof.
It works fine on XP though. Please consider fixing ;)
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on December 09, 2010, 08:50:47 AM
Hi Nikolay, this is a problem I've heard about occasionally. Nobody seems to know what causes it, Googling for the problem brings up all sorts of ideas.

Start the registry editor, go to key
HKEY_CURRENT_USER\sandrila_vsu.ini\RegistrationKey
and create a key called "Key". Right-click -> Modify
and paste in the registration key.
Please let me know if you have any problem.
Title: Re: Register: Call to OS function failed?
Post by: Nikolay on December 09, 2010, 09:31:37 AM
Hi Paul,

The registration itself was successful (i.e. the key value was successfully written by addon itself),
it was just this odd window about "OS function failed" was shown.

Thanks, Nickolay
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on December 09, 2010, 09:39:31 AM
Hi Nikolay, maybe 2% or so of users have reported this problem, naturally I can't reproduce it here! I tried sending debug versions to various customers trying to find where the problem comes from but the error seems to be from before my code starts. "A call to an OS function failed", I can imagine less informative messages! Doing a searching for this error brings up all sorts of reports in all sorts of software, but nothing conclusive.
Title: Re: Register: Call to OS function failed?
Post by: Nikolay on December 09, 2010, 10:18:21 AM
Hi Paul,

Feel free to send me log/debug version. Or symbols (SYM) file, so I can send you the stack trace of error.
It seems that this is not the problem with the registry write though; I've monitored using ProcMon (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx), all registry writes appear to be successful. There is an exception thrown though, and this dialog seems to be shown from an exception hander. I.e. it seems that this happens actually later when the addon tries to show "Registration key is accepted" message box, and not when it writes to the registry.

Anyways, thank you for the utilities!
Kind regards, Nikolay.
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on December 09, 2010, 10:35:26 AM
Yes, you are right, I was thinking of a different error that occurs at another place!
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on February 04, 2011, 07:58:09 AM
Do you have Visual Studio installed?
Title: Re: Register: Call to OS function failed?
Post by: Nikolay on February 04, 2011, 09:25:33 AM
Hi Paul, yes I have VS installed, in fact, two of them (2008 and 2010)
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on February 16, 2011, 05:43:36 PM
Hi Nikolay, I've pinned this problem down to the installation of Visual Studio (there may also be other software installations that cause the same problem). I now have a system here where without VS my software works fine, install VS and this error message occurs in certain places. Uninstall VS and the error messages disappear.
The message appears to occur when there is a dialog box on the screen and my software tries to open another dialog box, the most common reason for this is to show an error or information dialog box, like "registration accepted". So, this error occurs when displaying the standard message dialog box, also when showing the "open folder path dialog" but not the open file or save file dialogs. There is also an identical problem when using a tabbed dialog box and trying to open one of the other tabs (this is in my SDL for Visio application).
So, I've got around this problem within the utilities by never opening a second dialog box but always showing the current status within the main dialog.

I've tried asking about this error ("A call to an OS function failed") in the MSDN Visio Studio forum but the only person who responded to my message totally misunderstood what I was talking about and moved my post into an "off topic" area of the forum.
Title: Re: Register: Call to OS function failed?
Post by: Nikolay on February 25, 2011, 11:14:34 AM
Hi Paul,

I don't think this issue has anything to do with Visual Studio actually; I believe this must be some Delpi-related issue. As far as I know this message only exists in Delphi runtime, i.e. it is not an OS- message. The problem is most probably that Delphi runtime calls the SetForegroundWindow function when it activates a new form. And this function fails because the behavior of this function was changed in Vista (and above), especially if UAC is activated, but good old Delphi does not expect this function to fail, and throws an exception.

This is all just my guess of course.
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on March 03, 2011, 01:37:13 AM
Hi Nikolay, hmmmm, very interesting idea, thanks. Ok, I think I have to try some things. I'll be back.
Title: Re: Register: Call to OS function failed?
Post by: Paul Herber on March 21, 2014, 11:27:19 AM
The Visio Super Utilities are in the process of being ported to a new development platform (Lazarus/Free Pascal - it is wonderful!) - got some testing to do and a few fiddly bits to finish off - this little problem will soon be history!