December 10th, 2011, 8:21 am
The problem in <= VC6 is the amazingly shit Microsoft sample code...Rather than zero terminated strings, the Excel interface has l-strings like many Basic or Pascal implementations, the first byte determines the length.Registering functions requires that you supply a name in this format, and that will be based upon a string literal in your codeI'm going to skip over non-relevant bits to make it a little clearerYou have a function called "Catweazel".Ms decided to recommend that the literal is instead " Catweazel", and that the initialisation function does thischar *Name = " Catweazel";Name[0] = strlen (Name); //some coerciion needed hereThat looks easy to spot but the example code spreads this over several functions.In C++ there is no concept of read only, instead there is const which is not the same thing at all, being more of a promise not to change rather than a rule.After C++ 6 Ms decided to make literals read only which has some good points, but it meant that the initialisation code now tried to write to read only memory, marked as a such ata processor level.Excel takes some steps to protect itself against badly behaved addins so it doesn't crash, no that would be too easy.It tells you that the XLL has the wrong format, based upon the way it fails during load.So when I hit this problem myself I was running a new version of VC++ which included a new linjker so I wasted a pathetic amount of time trying to persuade the linker to generate the right format of DLLSinc it was doing this already, the most I could achieve was to stop it producing the right form of DLL, quite a trick since there is little you can actually do wrong here.The reason all this crap matters to Zerdna is that in a new environment you hit problems that make no sense and where the diagnostics mislead you. Also it may be a year or two from now when exactly why you did something a particular way may be rather less clear than it was at the time.That's why an escrow agreement must have a sensible amount of time for you to remedy issues, the issue I site above took me days to get round (if you ever use it , you owe me a beer), but I had the luxury that no one was standing over my shoulder needing it ready now.This was a compilation issue and a reasonable person with a decent level of tech know how will readily concede that a port between compiler versions has a very wide spread of timescales, sometimes it will be nearly zero, sometimes it will suck up your life.At IBM labs I got sucked into a horridly horrid problem with one of their network adapters. Some would work, others would not.By this point the systems were on viciously expensive Intel ICEs trying to step through code to work out why two identical cards behaved so differently, hard to do in a real time connectivity environment.The Intel diagnostics were utterly unhelpful "Invalid opcode" which means "you've jumped to the wrong address in the machine code and the shit I find here isn't anything I can execute"...except it wasn't.Intel was telling the truth (for a change)The compiler generated opcodes for this processor which was designed for communications equipment, but Intel had decided that it wasn't all that good and had re-implemented it from scratch using the reference manual as the definition of working.The compiler developers had found a really cool instruction in the old version of the processor and so the compiler generated it, without telling the C developers, (look up my post about why you need some knowledge of assembler)Intel had kept the part number identical, so depending on what patch of the processor used, you were executing on a processor with an incompatible instruction set.This is an example of where a better programmer can be at least two whole orders of magnitude more productive than the average, indeed it's not clear that an average programmer could ever have solved this problem given infinite time.Again going back to Zerdna, you should try to hold out for legal language of the form "the supplier shall respond within 7 days", note I don't say "fix"Also you want the right to bring in the extra help if it's an issue outside your skills, partly because we all have boundaries, but also because you want to choose who gets to see your code.I'm assuming in all this that although the majority of the code is nothing special, but that there are some clever routines and tricks.If possible then you want to segment the escrow.Since I don't know your system, I will imagine that it's some sort of quant calculation thingIt accepts data, screws wiith it, then sends it somewhere elseEven if it doesn't currently come in that packaging I'd encourage you to think about doing it like that...The data sucking may be FIX or TibCo and is the part that is most vulnerable to issues outside your control.The calculation parts are the opposite, things you understand at a deep level and presumably your client doesn't.Then it gets shoved out onto the network or onto a screenThis segmentation means you can set up the Escrow so that if your input mechanism goes tits up, they don't get access to your clever calculations.Also, if you want to delegate network or GUI or Excel interfacing to someone who's got more time/skill than you, there is no need for them to have access to the clever calculations.
Last edited by
DominicConnor on December 9th, 2011, 11:00 pm, edited 1 time in total.