Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2018, 02:40 PM
Paul Cain Paul Cain is offline Correct syntax for PtrSafe Function AccessibleObjectFromWindow Windows 10 Correct syntax for PtrSafe Function AccessibleObjectFromWindow Office 2013
Novice
Correct syntax for PtrSafe Function AccessibleObjectFromWindow
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default Correct syntax for PtrSafe Function AccessibleObjectFromWindow

Hi

I use a number of Windows API Functions in a vba project that I have converted to 64 bit Excel. I remain unsure about 1 of these because of my lack of understanding of MicroSoft published syntax. This function does appear in a number of different www sources but these have inconsistent Types and none of them is authoritative.



Is anyone able to confirm if this is correct? I have highlighted the 2 types I am uncertain of:

Private Declare PtrSafe Function AccessibleObjectFromWindow Lib "oleacc" _
(ByVal HWnd As LongPtr, _
ByVal dwId As Long, _
ByRef riid As GUID, _
ByRef ppvObject As Object) As LongPtr

thanks
Reply With Quote
  #2  
Old 11-19-2018, 04:25 AM
Debaser's Avatar
Debaser Debaser is offline Correct syntax for PtrSafe Function AccessibleObjectFromWindow Windows 7 64bit Correct syntax for PtrSafe Function AccessibleObjectFromWindow Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

dwId is correct as Long (it's just a DWORD) but the return value should also be a Long, not LongPtr. It's just a value indicating success or failure of some sort, not a pointer to anything.
Reply With Quote
  #3  
Old 11-19-2018, 04:29 AM
Paul Cain Paul Cain is offline Correct syntax for PtrSafe Function AccessibleObjectFromWindow Windows 10 Correct syntax for PtrSafe Function AccessibleObjectFromWindow Office 2013
Novice
Correct syntax for PtrSafe Function AccessibleObjectFromWindow
 
Join Date: Oct 2012
Location: Australia
Posts: 6
Paul Cain is on a distinguished road
Default

Wonderful
thankyou Debaser
Much appreciated
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Assistance with Today() function returning correct value DaveWSinger Excel 4 03-08-2018 05:34 AM
Correct syntax for PtrSafe Function AccessibleObjectFromWindow VLookup Syntax ketbdnetbp Excel 2 04-12-2014 03:18 PM
Correct syntax for PtrSafe Function AccessibleObjectFromWindow Is it correct (PasteSpecial function) gsrikanth Excel Programming 7 01-17-2012 11:23 PM
Correct syntax for PtrSafe Function AccessibleObjectFromWindow Can't seem to get the correct syntax for Wine list mailmerge daym Mail Merge 3 05-02-2011 03:26 AM
Correct syntax for PtrSafe Function AccessibleObjectFromWindow Syntax help needed blazzercat Excel 3 07-09-2009 02:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft