Wednesday, 13 October 2010

AxVLCPlugin2, Visual Basic 2008 and Windows 7 64bit - clr20r3 and REGDB_E_CLASSNOTREG

I've been writing an application to monitor multiple streams in VB 2008 and I started using the AxVLCPlugin2 which comes with VLC.

It is a nice plugin and apart from a few problems (it will not go fullsceen in version 1.1.4 for example) works fine for any stream that VLC supports.

I do most of my work on a 32bit XP box at work, but sometimes I like to work on projects at home using my 64bit Win7 PC.

For most projects this works fine, but on this one every time I started the application it would crash telling me that an error with an "EvenType: clr20r3" has occurred. It also gives a lot of information about the crash but nothing useful to point to the source of the error.

Assuming that the problem was that the application could not find VLC or that the AxVLCPlugin2 was not recognised, I fired up Visual Studio, cleaned up the project and tried to recompile - at which point VS proclaimed that "Class not registered (Exception from HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))".

No matter how many times I removed the reference an added it again, the error remained the same.

The solution was quite simple though.

Go to the "Project properties -> Compile" and set the platform to "x86" instead of "Any CPU". This allowed the application to successfully compile and run on the 64bit Win7 pc, without breaking it for the 32bit.


If "x86" does not appear in the combobox, open the configuration manager (Build -> Configuration Manager).

In the Configuration Manager dialogue, select "New" from the "Active Solution Platform" combobox.


In the new dialogue, select "x86" and "Copy Setting from Any CPU" and leave the checkbox ticked.


Keep in mind that this will create a new directory under the "<project>/bin/" folder of your project called "x86" which will contain new debug and release subdirectories. So make sure that if you have any shortcuts to your executables pointing to the old "<project>/bin/release" or "<project>/bin/debug" folders they are updated accordingly.

Tuesday, 12 October 2010

Setting up an AXIS 241QA Video Server to Control an Everfocus PTZ Camera

Camera Setup
1. Set the protocol on the camera to Pelco-D.
2. Set the baud rate to 9600bps.
3. Give a unique address to the camera.

For the Everfocus EPTZ500 cameras, the setup DIP switches will look like: 10 00 00 00

AXIS Server Setup

1. Set the RS485 mode to “Pan Tilt Use”.
2. Load the Pelco driver. It can be found at the Axis website (there is a link in the server’s web UI).
3. Check the “Force Install” checkbox before hitting ok.
4. Set the device type to “Generic”.
5. Set the Address to be the same as the camera’s address.
6. Set the RS485 port settings as follows (they are at the bottom of the page):
Baud Rate: 9600
Data Bits: 8
Stop Bits: 1
Parity: None

Cable Connection
1. The Yellow (+) cable on the Camera goes to the RS-485-A pin on the Axis (Pin 11 for the 241QA).
2. The Orange (-) cable on the Camera goes to the RS-485-B pin on the Axis (Pin 12 for the 241QA).

Troubleshooting
1. If something doesn’t work, make sure that Camera’s address is reflected correctly in the server’s port/video settings.