Are you a C++ guru?

123

Senior Member
I'm looking for help from a fellow Cocooner with C++ coding experience. If writing code in C++ is part of your day job, and you're willing to spare some time helping a newbie, please read on.

I have the source code for a UPB driver (developed for an HA program) as well as the compiled DLLs. My ultimate goal is to modify the source code but the first step is to successfully compile and link the existing code and ensure it works properly.

I believe it was developed for VS2005 C++ and I have access to this development environment. I believe it relies on the "ATL Project" template so I assume that rules out using the Express editions of VS. The source code does not contain a solution file ... so it's not as simple as opening the SLN file and everything falls into place. The source code does include a makefile so I assume I'll have to run nmake to build the DLL.

In fact, the driver is composed of three DLLs. The first one handles UPB communications (I don't need to change it) and the other two handle UPB devices from specific manufacturers (one for PCS and the other for SA). These so-called "manufacturer DLLs" contains embedded XML that lists the manufacturer's devices and their capabilities. This XML exists as a file in the source code. My goal is to modify it (append new devices) then re-build the DLL so it'll be able to support new UPB devices. But first, I need to know how to compile and link!

So where should I begin? Is there anything I should look for in the "sources" file, or other places, to ensure that I have all the required dependencies? Or will a failed make session list everything I'm missing?

Source can be found here.
I'm guessing the SDK may also be required to build this driver from its source code
 
Sounds like what you are dealing with is Windows device driver code, not application. The skill set required for writing drivers is different than applications. Fortunately, the kind of modification you are looking for is the same for both, but knowing how to complie and build requires some device driver experience.

So I suggest asking for someone with Windows driver expertise, not general C++.

Hope this helps.
 
I'll happily accept assistance from anyone who can help me compile and build the solution, regardless of language expertise! :)
 
I'll happily accept assistance from anyone who can help me compile and build the solution, regardless of language expertise! :)
I'll take a quick look, but I'm leaving for a week-long vacation on Saturday morning so I probably won't have time to do much until I get back. At quick glance it looks like they're using the Windows Platform SDK rather than Visual Studio for their builds. I'm not sure if the Platform SDK is a free download, I think it used to be.

If all you want to do is edit the XML embedded in the DLLs, then try opening upbPCS.dll with Visual Studio and manipulating the resources that way; you won't have to recompile the whole thing. If that works, do the same for upbSA.dll.
 
Many thanks for your help rosengui! I'll investigate the Windows Platform SDK and see what I can do during your vacation. Here's what I've learned so far:

I opened upbSA.dll with VS2005 and it presented the DLL's resources in a treeview. The nodes are:
HTML
"REGISTRY"
String Table
"TYPELIB"
Version

The XML device list is a child-node of HTML and is simply called "1" (1.htm). If I open "1.htm" in binary mode, I can edit the contents byte-for-byte but not append anything. If I simply open it in text mode, the XML is displayed but VS indicates that 1.htm is Read-Only; I can't save my edits. It appears that one cannot append anything to this resource ... and that is what I need to do.

I noticed that "1.htm" has the following properties:
External File = False
Filename = ""
This suggests that the XML device list need not be embedded in the DLL but can exist as an external file. If this is true, it would simplify the process of adding support for new UPB devices. Unfortunately, these properties are locked suggesting it is not something you can do after the DLL has been built.
 
Try this:
  1. Edit the XML to your liking and save it in a file somewhere.
  2. Open the DLL in Visual Studio - it should open the DLL in resource view by default.
  3. Delete the HTML resource with ID 1 (the current XML)
  4. Right-click in the Visual Studio DLL window and select "Add Resource..."
  5. Click "Import..."
  6. Select the modified XML file you created in step #1
  7. Type "HTML" (no quotes) as the resource type.
  8. Edit the properties of the imported HTML resource to set the ID to 1 since it probably got assigned a different ID.
  9. Save the modified DLL
  10. Cross your fingers & give it a try :)
 
Rosengui, you're a scholar and a gentleman!

I exported the XML, made a minor modification that changed its byte-count by replacing the vendor-name "Simply Automated" with "Completely Automated" and I was able to save the DLL. Premise loaded it without complaint and displayed the driver as being from "Completely Automated". Woo hoo! That's just a baby-step but it is very promising!

My next step is to add new UPB devices to the XML list and test the driver's functionality. First, I have to learn more about a UPB device's properties so I can define it correctly in the XML file. I'm be relying on fellow Premise users to test the modified UPB driver because <sheepish grin> I haven't ordered my UPB gear yet.

I would still like to re-compile the driver in case I ever need to tweak some of its source-code. The driver was built in 2005 and the UPB protocol may have been amended since then. I'll pursue this goal after I finish updating the list of UPB devices.

Many thanks for your help! Have a great vacation!
 
Back
Top