[AccessD] What is App.hInstance in Access

Colby, John JColby at dispec.com
Wed Nov 3 09:22:48 CST 2004


In looking over the time sync stuff I found a class and module to replace
the winsock OCX control.  It has a call:

    p_lngWindowHandle = CreateWindowEx(0&, "STATIC", "SOCKET_WINDOW", 0&,
0&, 0&, 0&, 0&, 0&, 0&, App.hInstance, ByVal 0&)

which fails on App.hInstance.  I'm assuming that this is a handle to the
application window.  Is there an equivelent in VBA?  I think I solved that
one by:

    p_lngWindowHandle = CreateWindowEx(0&, "STATIC", "SOCKET_WINDOW", 0&,
0&, 0&, 0&, 0&, 0&, 0&, Application.hWndAccessApp, ByVal 0&)

However I am now getting a compile error on:

    m_lngResolveMessage = RegisterWindowMessage(App.EXEName &
".ResolveMessage")

There is no apparent equivelent property in the Application object.  Does
anyone know what I would use here?

John W. Colby
The DIS Database Guy


-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk]
Sent: Wednesday, November 03, 2004 4:34 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Time Synchronization


Hi Mark

You can use an ActiveX control for this:

http://www.universalthread.com/wconnect/wc.dll?FournierTransformation~

"Synchronize your client machine or just the software itself by
retrieving the highly accurate time from time servers [..] This is
accurate to the millisecond range so a large use is for Timestamping
of information independent of the local CPU clock."

Or use the winsock ocx. Here's some VB code you probably can adapt:

http://www.freevbcode.com/ShowCode.asp?ID=1594

/gustav


> Date: 2004-11-02 18:39

> Does anyone know of any VBA code to be placed within an Access application
> that can easily poll an Internet-based time server, and return that time
> to a variable?  Searching through the archives hasn't come up with
> naything ... yet ...

> Thanks,

> Mark Naudé

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list