64 bit win 7 & "Kernel32" problem

FuzMic

DataBase Tinker
Local time
Tomorrow, 01:50
Joined
Sep 13, 2006
Messages
744
Greetings to all

Recently I tried to run a perfectly running Access 03/07 .mdb application (no problem up to win7 32 bit) in a 64bit Win7 and found that I faced problem.

The problem is when I use a customized function "Shell2End"; a function to resolve the problem of incompletion of dos execution. In this function I use various Declares such as the following:

Declare Sub Sleep Lib "kernel32" ( ByVal milsec As Long)

Can someone give me a quick leap on the following questions:
1 Does it mean if I just refer after Lib to "kernel64", then all is well with 64 bit win7
2 Do you see any issues with another declare: Declare Function getTime Lib "winmm.dll" () As Long
3 Did I miss something else?
4 Are there any other problems with running a Access 03/07 .mdb in 64 bit win7

I need help from the gurus to have gone before me on this. Thanks :cool:
 
Last edited:
Here is an alternate to the sleep API that should work on any Windows computer...

Code:
Public Function Pause(NumberOfSeconds As Variant)
On Error GoTo Err_Pause

    Dim PauseTime As Variant, start As Variant

    PauseTime = NumberOfSeconds
    start = Timer
    Do While Timer < start + PauseTime
    DoEvents
    Loop

Exit_Pause:
    Exit Function

Err_Pause:
    ErrorMsg "modCommon", "Pause", Err.Number, Err.Description
    Resume Exit_Pause

End Function

This is how you call it...
Code:
Pause (0.5) 'half second pause

I admit I prefer to use this Pause() function over the Sleep API for it allows me to update the caption of a label when running mulitple processes and I sometimes use labels to visibly alert the user as to what the db is doing.
 
Hudson, Thanks for the "Pause" alternative to "Sleep" using Timer. It certainly do away with the kernel32.

However in shelling to run the dos .exe, i need 2 another functions from the the kernel. They are the OpenProcess and GetExitCodeProcess functions. Do you know of another way to shell in VB6 that will wait for completion without using the kernel?

I am also using CreateFile, LocalFileTimeToFileTime, SetFileTime, SystemTimeToFileTime & CloseHandle from kernel32 for another purpose. Where can i get some fast leap frog help on the migration of these function to kernel64. I was hoping that just from change the lib from "kernel32" to "kernel64", all these functions will work; then life is easier for an old mountain turtle like me trying to keep up. I am no expert in the use of API as a tinker.


NEW FINDING
I just learnt that 64-bit OS have two System32 folders. The C:\WINDOWS\System32 directory contains the 64-bit libraries (such as kernel32.dll) and a new directory called C:\WINDOWS\SysWow64, which contains the exact same files as System32, but their 32-bit partners. The SYSWOW64 service in Windows will automatically map programs to the right version.

If that's the case why is my OS not mapping the shell2end to the kernel32.dll. Is it because service STSWOW64 is not installed, not started or is there something else missing? I am using win7 64 bit OS in an Acer Aspire Laptop.

More help required!!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom