{{tag>category:"None Specified" author:"Nick Pratt" author:"ArjunRevelation" author:"John Curby" author:"Oystein Reigem"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== Visual Basic 16-]32 (None Specified) ==== === At 09 SEP 1999 04:29:16AM Nick Pratt wrote: === We have some VB forms that use REVCAPI to access the engine by declaring functions. This has worked fine in VB 16 bit but we would like to use VB 32 bit. Does anyone know if this is possible ? We get Error 48 , Error in loading DLL. ---- === At 09 SEP 1999 08:52AM ArjunRevelation wrote: === 32 bit DLLs will not work with OI. Let me do some more research and update you on this. ---- === At 10 SEP 1999 04:32AM John Curby wrote: === "Thunk" it. Check Microsoft's KB. Build a 32bit DLL to thunk (convert) to 16bit REVCAPI. You call the functions in the thunk which acts as a go between (from memory). I have a part finished (part working) example which I built to call REVCAPI from java (if needed), but you need to build the thunk in a certain way, switching between 16bit and 32bit builds (ie there is some 16bit ASM compiling needed plus 32bit C compiling (fun stuff). John Curby ---- === At 10 SEP 1999 04:48AM Oystein Reigem wrote: === John, Just out of curiosity: Must the thunk be tailormade? Or is there a general solution? (I have no idea of what's involved.) - Oystein - ---- === At 12 SEP 1999 05:15AM John Curby wrote: === I am working a little from a shaky memory but ... The thunk can be built to make specific calls to the routines within the REVCAPI.DLL. Therefore, although the thunk to REVCAPI must be tailor made, a single thunk can be used for all REVCAPI calls. ie: as long as all of the REVCAPI routines (and the appropriate data passed back and forth) are included as calls within the thunk then anything can call the thunk to call REVCAPI. Two DLLs (a 16 bit and a 32 bit) and thunk script file are built. To give you an idea: The thunk script defines all of the calls made and their parameters, (among other things) eg: int RevOpenQ (LPSTR pQname, LPSTR lpUserName, LPSTR lpPassword, LPHQUEUE lphQueue) { pQname=input; lpUserName=input; lpPassword=input; lphQueue=output; } This is then thunked to produce an assembler file, which is then linked to the 16bit DLL. You call the 32bit DLL, it calls an exported function in your 16bit DLL, which in turn calls the functions in REVCAPI. Any data is returned in reverse. You need MS Visual C++ 1.5 for the 16bit side (I had to build under Windows 3.11), also MS Visual C++ 2+ for the 32bit side (build under Win95), Thunk compiler from Win32SDK (thunk under Win95, assemble under Win31), MASM v6.1+ (Win31), and RC.EXE from Win32SDK. see http://msdn.microsoft.com/library/sdkdoc/win95/tc_7qi4.htm also Article ID: Q155763 (a better reference) from MSDN98 (on MS Vis C++ 6.0) John ---- === At 13 SEP 1999 03:56AM Oystein Reigem wrote: === John, Thanks for the comprehensive answer! - Oystein - [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=6397BB984782F20A852567E7002E9FF5|View this thread on the Works forum...]]