Page 1 of 1

Problems with Keyguard and AM 4.6.1 and 4.70

PostPosted: Wed Jun 27, 2012 1:45 am
by Sedani Studio
Fellow AM Users:

I have searched through the forums, with no luck on this topic, so thank you in advance. The problem I am experiencing is that when I enable the Keyguard plugin (4.11) in a project, I get the error message contained in the attachment. I'm trying to understand what is wrong. My frames are 900 x 600 - could that be it? I've tried it on both x32 and x64 systems, and the problem appears in both places.

Also, when I am able to use both without errors, the Keyguard plugin causes a small strip at the bottom of the window when working in the 360 panorama mode. Has anyone else experienced this?

I'm developing a keystroke help system with Keyguard in my project, and don't want to lose its functionality. However, when I disenable the plugin, the problems go away.

My most attempt to understand the problem consisted only of a new project with about 3 frames, with no other scripting involved. The problems still came up. Does Shadowhunter or anyone else have any suggestions? I didn't see any of the problems I'm facing in the known limitations documentation of the plugin.



Sedani Studio

PostPosted: Wed Jun 27, 2012 7:30 am
by mercedes
I'm developing a keystroke help system with Keyguard in my project, and don't want to lose its functionality. However, when I disenable the plugin, the problems go away.

It looks like you are using a line of code that KG doesn't support...

What exactly are you trying to do..?

PostPosted: Wed Jun 27, 2012 8:14 am
by ShadowHunter

Thank you for your questions:

1. There is no "RenderTextReset" method in KeyGuard hence the error. Where did you get this method and what would you like to accomplish?

2. The space at the button when using the panoramic plugin was reported to me a about two weeks ago, I did not know about this before. I will look into it and try to fix it in the next release which will also be compatible with AM 4.7.0 and with Windows 7 in general.

I do recommand to use KeyGuard 5 rather than 4.11, you can use the undocumented event:

Sub KeyGuard_KeyPressedAdvanced(ret)
MsgBox "Key " & ret(0) & " was pressed"
End Sub

To use all keystrokes without to much trouble.

Good luck,

With best regards,


PostPosted: Wed Jun 27, 2012 3:17 pm
by ShadowHunter

Hi, I did a bit more investigation:

In version 4.11 there is no RenderTextReset methode, but in version 5 there is. This methode is called when launching the game, this is defined in the PL1 file.

This means you have the PL1 file of version 5 and are using plugin 4.11, please check it and pay attention to the locations (on Windows 7 it should be in the user/documents folder)

With best regards,


Thanks for the help!

PostPosted: Wed Jun 27, 2012 5:45 pm
by Sedani Studio
Shadowhunter and Mercedes:

Thank you for your kind responses to my dilemma. Ok - I guess there are two things. (1) what have I done so far and (2) what is my goal.

(1) I haven't really done anything so far other than add an opening frame, some opening music and a hotspot link to another couple of frames (about 4 frames so far - nothing special). Thus far, I have not done any coding of procedures. I deleted the original project and started fresh. Right before the opening frame pops up, the error message (Error in Game.AddAdditionalComponent) appears. When I hit "ok", the second message pops up several times (repeatedly after every click on "ok" in the dialogue box).

(2) Ultimately, my goal is to use keystrokes to take the player to an "evidences" page. On certain still frames (non-panoramic), there will be a hotspot that can be clicked on to take a picture or record a sound. Later, by pressing the "H" button, the player is transported to a screen where pictures can be reviewed and sounds listened to again without traveling back to where they were recorded. I've actually managed to do this on a couple of test projects, and it works fine.

Back to #1 - it looks like somehow it's not recognizing the plugin. I've made sure that it's the Keyguard 5 files, even looking in the coded procedures to make sure. After installing Keyguard 5, I copied and pasted the .pl1 file and the .ocx files from where they were installed (in Program Files x(86)/Adventure Maker v. 4.7.0 etc) into the shared plugins folder in my documents. And, as I said, I went in to "modify plugins" (no changes made) to verify that I had version 5 and not version 4.11 in the folder.

I did later enter my previous user name and key (from version 4.11) into the appropriate places in the code. Perhaps I need to update these as it doesn't seem to have made a difference.

Sorry to be such a bother! It's just adding so much functionality to my project, I wanted to be sure I didn't have to lose out on it. However, as I stated before, when I disenable the plugin in project properties, the problems disappear. Weird!

I am working on an x64 system, for full disclosure.

Man, I hope this ends up being something really silly that I've overlooked!


Sedani Studio

One other thing I've tried...

PostPosted: Wed Jun 27, 2012 5:54 pm
by Sedani Studio
For what it's worth, I also tried simply installing the .pl1 and .ocx files directly into my shared plugins folder (in my documents) by reinstalling Keyguard and indicating that folder path. It did install them there, but there's been no change.

I get the feeling there's something obvious I'm missing, given that no one else has mentioned any of these things in the posts.

PostPosted: Wed Jun 27, 2012 8:40 pm
by ShadowHunter

Error 1. Okay the Class ID you provided is the one from KeyGuard.MainControl, so this means that AM was not able to register the plugin for some reason (or the installer for that matter)

Error 2. Because it was not registerd AM cannot find the OCX and thus cannot call any method or property.

So, let's try to resolve this by beginning to check if the OCX was registered correctly:

Open regeditor (regedit) and search for the CLSID, it should be in HKEY_CLASSES_ROOT\CLSID\{F7436B2F-937E-4DF7-88B7-0C68E5F9E027} and the value is KeyGuard.MainControl

Should you not be able to find the key (use search function in regedit) then try to register it manually by using regsvr32 and check again...

Please let me know the outcome of this...

With best regards,


I found it in the registry

PostPosted: Wed Jun 27, 2012 10:02 pm
by Sedani Studio

Ok, I did as you instructed. I was able to find the CLSID folder, and it contained the code you mentioned, but it is not in the HKEY_CLASSES_ROOT\CLSID folder. Instead, it is found in the HKEY_CLASSES_ROOT\Keyguard.MainControl\CSLID folder (see attached picture).

What would be the next step?


PostPosted: Wed Jun 27, 2012 10:55 pm
by ShadowHunter

Is this the only location were you find it?

If you continue to search 'F3' is there no entry at the location I mentioned?

I mean no HKEY_CLASSES_ROOT\CLSID\{F7436B2F-937E-4DF7-88B7-0C68E5F9E027} ?

In that case please try to register the OCX manually, copy the OCX to the c:\windows\system32 folder and register it with

regsvr32 keyguard.ocx (click windows 'start' button and in the search text box enter the command)

What happens? Was the registration succesfull? If so, please try again...

With best regards,


On to the next step!

PostPosted: Thu Jun 28, 2012 5:03 am
by Sedani Studio
That is right, there is no HKEY_CLASSES_ROOT\CLSID\{F7436B2F-937E-4DF7-88B7-0C68E5F9E027} folder. I then did as you instructed, and got the following error (attached picture). Bummer ... I suspected it was a problem with the fact that I'm running an x64 system.

Is there a workaround? Or will I just need to compile my project on an x32 system? Will this affect the compatibility of the final product?

I tried copying the .ocx file into the SysWOW64 folder, as well, but got the same result after attempting to register in as you described using regsvr32 keyguard.ocx

Thank you so much for your help!

PostPosted: Thu Jun 28, 2012 6:19 am
by ShadowHunter

I tried on a x86 and x64 machine:

I could reproduce the problem on a 64 bit system, however I could register it by using the 64bit variant of regsvr32...

Okay, do this:

1. Copy the OCX to the SysWOW64 folder and to the System32

2.Register like this: C\Windows\SysWOW64\regsvr32.exe "c:\Windows\System32\KeyGuard.ocx"

3. If succuss, try AM and KeyGuard again...

4. If at step 2 the problem was not solved try registering like this C:\Windows\SysWOW64\regsvr32.exe KeyGuard.ocx

With best regards,


Registering the .ocx file

PostPosted: Thu Jun 28, 2012 6:12 pm
by Sedani Studio
Ok, the .ocx files were pasted, and I did what you asked in #2 - this gave me just a search box.

When I did #4, I got various errors, which I've attached as pictures. I tried various ways of doing this, such as simply typing C:\Windows\SysWOW64\regsvr32.exe KeyGuard.ocx into the search box or typing in regsvr32.exe C:\Windows\SysWOW64\regsvr32.exe, for example. Please let me know if I'm doing that wrong!

PostPosted: Thu Jun 28, 2012 10:18 pm
by ShadowHunter

I verified it on a super recent x64 WIN7 machine (with SSD yeah 8) ) and it worked without a problem...

1. Copy KeyGuard.ocx to C:\windows\system32\
2. Run exactly like this: C\Windows\SysWOW64\regsvr32.exe "c:\Windows\System32\KeyGuard.ocx"

This means that we run the 64 version of regsvr which resides in the SysWOW64 folder to register the 32 bit OCX located in the system32 folder...

With best regards,


I can't seem to make this work

PostPosted: Thu Jun 28, 2012 11:54 pm
by Sedani Studio
I'm doing exactly as instructed - I've copied the .ocx files into the appropriate folders, etc. - even copied and pasted the text right off of your response into the text search box. Nothing happens when I put it in the text search box and hit enter. Apparently, it isn't finding anything to execute. Or I get the error like in the previous post.

Maybe I should call Dell about this one. Any other ideas?

The problem might be that it's not recognizing the regvsr32.exe in the SysWOW64 folder. I've tried some alternatives just to see what happens. When I just put in the first part of what you instructed me (i.e. C\Windows\SysWOW64\regsvr32.exe) it isn't finding anything. It does, however, when I write it as C: at the beginning, but gives an error that says:

The module "c:windows\system32\keyguard.ocx" was loaded but the call to DllRegisterServer failed with error code 0x80004005"

I appreciate your expertise!

PostPosted: Fri Jun 29, 2012 7:32 am
by ShadowHunter

I have taken a screenshot of what I done, this is on a x64 WIN7 device, as you can see no problem.

Now, the error you mentioned means "access denied" so it could be you have to run regsvr32 with an elevated command prompt. Do this:

1. Click on Windows 7 Start Button
2. Go to All Programs and next to Accessories
3. Right on Command Prompt and select ?Run as Administrator?

Enter the command string here... Did it work? If not we have to try more advanced stuff :wink:

With best regards,


It worked.. but there are new problems

PostPosted: Fri Jun 29, 2012 4:42 pm
by Sedani Studio

Thank you!!!!!!! That seems to have worked. The screenshot really helped.

I am experiencing some new problems, however. There appears to be a conflict with the AM Panorama plugin (not the cubic plugin), however. Again, all I have is an initial frame, with a hotspot link to a second frame. The second frame uses the AM Panorama plugin. I also have a few other frames connected to one another using the panorama plugin. No scripting on my part yet, no variables. Just some frames and links.

Interestingly enough, when I disable the AM Panorma plugin, the problems go away, so perhaps this should be a different thread? Or does the fact that I cannot seem to get KeyGuard and the Panorama plugin to coexist mean it should stay here?

I've attached the error messages I'm receiving. The first couple happen on the initial frame, and the last 3 when I link to the second frame.

PostPosted: Fri Jun 29, 2012 9:41 pm
by ShadowHunter

Alright, I'm glad the initial problem is solved :D

Now for the other errors:

The first error probably occured due to:

* Using KeyGuard Studio in compression mode and the OCX in non-compression mode or visa versa
* Or the POL-file was corrupted (located in the frames folder, this is the file that holds the data for a specific frame)

So, please check the help file for compression and non-compression mode. Compression is default enabled when fresh installed, to change KGS to non-compression you have to perform change a key in the registry located here: HKEY_CURRENT_USER\Software\ShadowHunter\KeyGuard change the value of "UseCompression" from 99 to 16. If this entry does not exist you can create it manuall (type REG_SZ)

To change the OCX from compression to non-compression you have to alter the "Component("KeyGuard").Object.General_DisableCompression = False" to "True" which can be found when you select to edit a plugin, under the tab "Startup", the top textbox.

If the file is corrupt simply delete the POL-file in the "Frames" directory of you project folder and draw it again.
Note: it is best to restart and reload your project during each test or change. Sometimes the OCX is not unloaded completely due to the edit mode of AM, if so certain values stay in the memory.

For the second problem:

The Panoramic plugin and KeyGuard can exists next to eachother BUT with a lot of limitations.

- KeyGuard can only be used for keystrokes, not (yet) for polygons, hint cursors or text rendering...
- A pixel shift happens but this is already solved in the next release of KeyGuard (stay tuned)
- The cursor won't change anymore, also fixed in the next release

And finally the limitation that is causing your problem. This happens when you have move from non panoramic frame but with KeyGuard and go to a panoramic frame using a transition (depending on the speed of your computer COULD also happen with no transitions but I never saw that)

The reason for this is perhaps to complex to explain in detail but involves hWnd and hDC changes by the panoramic plugin whilst KeyGuard already has info on the previous handles (hWnd = windows handle, hDC = device context handle), I was not yet able to solve this behaviour... but I'm working on it.

This error does not appear when you start the game by using a frame that uses the panaromic plugin and has a KeyGuard function. The other way arround: moving from pana to only a KeyGuard frame poses no problems.

Disabling the transition might of course also fix the problem...

I hope this information can help you.

With best regards,


Thank you again - I'll get back on this in a week or so

PostPosted: Sat Jun 30, 2012 5:35 am
by Sedani Studio

Your help is very much appreciated. I'm leaving town for about a week, but will get back to this when I return.

Thanks again!

Re: Thank you again - I'll get back on this in a week or so

PostPosted: Sat Jun 30, 2012 6:13 am
by ShadowHunter
Sedani Studio wrote:Shadowhunter:

Your help is very much appreciated. I'm leaving town for about a week, but will get back to this when I return.

Thanks again!

Have a good trip :D

Problems with Keyguard w 4.71

PostPosted: Tue Nov 26, 2013 5:25 pm
by Stitches
Question for Shadow Hunter:
After converting hotspots and redesigning them (to create a path for a sprite) how do you constrain walk path? When reloaded into AM the player just wanders off randomly way outside of the hotspot instead of walking the constructed path.