Subj : Re: BC++ 5.02 Stack Restore Bug To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Wed Dec 01 2004 12:20 pm > thanks Ed!!! you hit it right on the head! I appreciate that you came back to tell me that what I said was correct. I almost always hear if what I suggested didn't handle a problem, but when I post a winner I rarely hear back! > ...now I will have to negotiate with the vendor or force ... Nah. He obviously doesn't know to make DLL exports __stdcall as is the custom in Windows programs. Since he doesn't know (or doesn't care), why bother? Just fix it yourself. Make a module definition file for the DLL. impdef DllName.DEF DllName.DLL Pull it up in an editor and you'll see a section something like this: EXPORTS HaltAndCatchFire @1 JumpOffBridge @2 And add lines with aliases to the end of it like this: _HaltAndCatchFire = HaltAndCatchFire _JumpOffBridge = JumpOffBridge Then make an import library for it like this: implib -c DllName.LIB DllName.DEF When you add the import library to your project it will then supply underscored symbols for all the items for which you have provided an alias. .. Ed > kurt jensen wrote in message > news:41ADECF8.5C9E343C@SPAMspiricon.com... > > thanks Ed!!! you hit it right on the head! > > the vendor provides a DLL of C functions where none of > functions is prefaced with an underscore (_). I had to > preface all the declarations with _stdcall in order to > convince Borland to link and run. BUT, the functions > are NOT __stdcall and do NOT clean up the stack. now > I will have to negotiate with the vendor or force my function > to allocate some automatic variables in order to make > the stack correct before return. .