Brett Barabash
BBarabash at TappeConstruction.com
Wed Nov 3 11:05:38 CST 2004
No, that parameter refers to the parent instance handle, not the window handle. However, according to MSDN, this value is ignored in Windows NT/2000/XP, so you could just put 0& in its place. If you wish to cater to the elite Windows 95/98/ME crowd, you need to use the following code to get the Instance handle from the Application window: Private Const GWL_HINSTANCE = (-6) Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long GetWindowLong(hWndAccessApp, GWL_HINSTANCE) -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Colby, John Sent: Wednesday, November 03, 2004 9:23 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] What is App.hInstance in Access 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 -------------------------------------------------------------------------------------------------------------------- The information in this email may contain confidential information that is legally privileged. The information is only for the use of the intended recipient(s) named above. If you are not the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or the taking of any action in regard to the content of this email is strictly prohibited. If transmission is incorrect, unclear, or incomplete, please notify the sender immediately. The authorized recipient(s) of this information is/are prohibited from disclosing this information to any other party and is/are required to destroy the information after its stated need has been fulfilled. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Tappe Construction Co. This footer also confirms that this email message has been scanned for the presence of computer viruses.Scanning of this message and addition of this footer is performed by SurfControl E-mail Filter software in conjunction with virus detection software.