Inpout32.dll port from XP to Win7
Posted: Thu Nov 15, 2012 11:55 am
I'm trying to port an existing legacy VB6 application from an old P4 box to a newer i7 machine.
The old system is running XPSP3 and the new box has Windows 7 32 bit. Having copied my existing code and libraries to the new machine, I just need to open up the VB6 source and change some addresses because the old box had a legacy parallel port at &H378 and the new box has the parallel port on a PCI card. I've not had any problems in the past porting to new hardware, so long as both machines are running 9x, 2k or XP so I know that calling port addresses in the PCI 16 bit address space isn't an issue. Open up old code, change port base address from &h378 to &DF00 or whatever, no problem.
But I'm having a hell of a job running the code on a Win7 32 bit box. Every time I try to access the inpout32.dll in my program, I get an error 47 Bad DLL calling convention. I've installed the full version of VB6 SP6 on the Win 7 box (found the howto on the web) and everything works perfectly. All aspects of my app, the look and feel and everything else works perfectly. Except calling the inpout32.dll. I renamed the file to .bak and the error message changes to 'library not found', so it's not a problem with the path or file location. Rename it back to DLL and I go back to the Bad DLL Calling convention error. Both programs are identical....both sets of declarations are the same and works no problem on the XP box, or any other XP box. Even works ok on Server 2003. But not Windows 7!
I am using the original inpout32.dll from logix4u, and I am wondering if this newer version will solve my problem? I shall try it and see, but was wondering why a call to a DLL from a VB6 app under XP sees the DLL properly and works just fine, but doing exactly the same with the same source, same IDE and same libraries causes this error under Win7. Not tried it under Vista...why would I?!!
Thing is, in a perfect world I would just rewrite the whole package in .NET, but I have three days to do a "1 to 1" port of old software onto a new box andf need a 'quick fix'
The old system is running XPSP3 and the new box has Windows 7 32 bit. Having copied my existing code and libraries to the new machine, I just need to open up the VB6 source and change some addresses because the old box had a legacy parallel port at &H378 and the new box has the parallel port on a PCI card. I've not had any problems in the past porting to new hardware, so long as both machines are running 9x, 2k or XP so I know that calling port addresses in the PCI 16 bit address space isn't an issue. Open up old code, change port base address from &h378 to &DF00 or whatever, no problem.
But I'm having a hell of a job running the code on a Win7 32 bit box. Every time I try to access the inpout32.dll in my program, I get an error 47 Bad DLL calling convention. I've installed the full version of VB6 SP6 on the Win 7 box (found the howto on the web) and everything works perfectly. All aspects of my app, the look and feel and everything else works perfectly. Except calling the inpout32.dll. I renamed the file to .bak and the error message changes to 'library not found', so it's not a problem with the path or file location. Rename it back to DLL and I go back to the Bad DLL Calling convention error. Both programs are identical....both sets of declarations are the same and works no problem on the XP box, or any other XP box. Even works ok on Server 2003. But not Windows 7!
I am using the original inpout32.dll from logix4u, and I am wondering if this newer version will solve my problem? I shall try it and see, but was wondering why a call to a DLL from a VB6 app under XP sees the DLL properly and works just fine, but doing exactly the same with the same source, same IDE and same libraries causes this error under Win7. Not tried it under Vista...why would I?!!
Thing is, in a perfect world I would just rewrite the whole package in .NET, but I have three days to do a "1 to 1" port of old software onto a new box andf need a 'quick fix'