Skip to main content

Generating OPC Automation IDL, TLB and header files from OPCDAAuto.dll

OPC Automation IDL, TLB and header files are not easy to find. You can obtain this files from OPC Foundation if you are a member or maybe from OPC application vendor.

The IDL file can be reverse engineered using OLE-Com Object Viewer. Once the IDL is generated TLB and other files can be generated from it as well. Below is a general direction how to do this.

Steps to reverse generate IDL, TLB and header files for OPCDAAuto.dll:

  1. Download Windows 7 SDK. I am using GRMSDKX_EN_DVD.iso as the OS is Windows 7 64-bit.
  2. Install the SDK.
  3. Open CMD Shell (Start | All Programs | Microsoft Windows SDK v7.0 | CMD Shell)
  4. Change directory to bin folder.
  5. Run oleview.exe, this will open a 32-bit version of the application. Note that this is important as the OPCDAAuto.dll I have is 32-bit as well.
  6. Navigate to Type Libraries | OPC Automation 2.0 (Ver 1.0)
  7. Double click to view Type Library definition.
  8. Do File | Save As... to D:\OPCDaAuto\OPCDaAuto.IDL.
  9. Go back to the cmd.exe as per step 3. Change directory to D:\OPCDaAuto.
  10. Fix OPCDaAuto.IDL
    1. Compile the IDL file, like, midl /win32 OPCDaAuto.IDL /header OPCDaAuto.h 
    2. This will fail about OPCGroups type specification.
    3. Fix this by moving OPCGroups definition in line 188-195 to line 104, this is above OPC Server Object. Save the file, this will change the numbering.
    4. Compile again as per sub-step 1 above.
    5. This will fail again about single type specification. Change single to float for the lines as per the output of the compilation.
    6. Compile again. This time it will complain about OPCGroup type specification.
    7. Fix this by moving OPCGroup around line 255-262 to around line 196. This above definition of Collection of OPC Group Objects.
    8. Compile again. This will fail again for another single data type. Convert it to float in 2 more places. Line location should be indicated in the compilation output.
    9. Compile again. This time it should be successful.
Note that I haven't used the corresponding TLB and header files, yet. I am hoping it will work.

Comments

Popular posts from this blog

Error! Could not locate dkms.conf file install VirtualBox 4.1.8 on Ubuntu 11.10

Tried to update my Ubuntu host today and it did pickup that new version of VirtualBox is available (4.1.8). All other packages installed properly except that VirtualBox installation was complaining about missing dkms.conf file, see error message below. $: sudo /etc/init.d/vboxdrv setup * Stopping VirtualBox kernel modules [ OK ] * Uninstalling old VirtualBox DKMS kernel modules Error! Could not locate dkms.conf file. File: does not exist. [ OK ] * Trying to register the VirtualBox kernel modules using DKMS [ OK ] * Starting VirtualBox kernel modules [ OK ] Though it looks like installation was fine but I am concerned about its effects to VirtualBox functionality. To fix this, do: $: cd /var/lib/dkms/vboxhost $: sudo rm -r 4.1.4 $: sudo /etc/init.d/vboxdrv setup Of course you have to re

The following add-ins could not be started MonoDevelop.GnomePlatform

Installing MonoDevelop in OpenSUSE 12.2 from its repository was very easy. When running it for the first time though I got the message: The following add-ins could not be started: The root of the trace shows MonoDevelop.GnomePlatform,2.8 A quick search shows that MonoDevelop depends on libgnomeui . This should have been part of dependencies when installing the application but well.... Below is the screen shot of the error message. References: http://software.1713.n2.nabble.com/MonoDevelop-and-openSUSE-12-1-td7462957.html [2013/04/09] - Same issue observed in OpenSUSE 12.3 and also the same fix. [2014/11/02] - Same issue observed in OpenSUSE 13.3, mondevelop 3.0.6 and the same fix.