how to get SetWindowLongPtr address from user32.dll?

I use the API GetProcAddress to get export function from user32.dll, such as
SetWindowLongA, SetWindowLongW, which can work well. But SetWindowLongPtr
have some problem, whatever I used SetWindowLongPtr
,SetWindowLongPtrA,SetWindowLongPtrW, it return NULL
why?


0
m_lihui (7)
12/11/2003 6:16:14 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
915 Views

Similar Articles

[PageSpeed] 11

>I use the API GetProcAddress to get export function from user32.dll, such as
>SetWindowLongA, SetWindowLongW, which can work well. But SetWindowLongPtr
>have some problem, whatever I used SetWindowLongPtr
>,SetWindowLongPtrA,SetWindowLongPtrW, it return NULL

I think you'll find it's a macro wrapper and not really a function.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
12/11/2003 8:34:13 AM
Thanks!
yes, it 's a macro wrapper.I found it declare in winuser.h

#define SetWindowLongPtrA   SetWindowLongA
#define SetWindowLongPtrW   SetWindowLongW

"David Lowndes" <davidl@mvps.org> wrote in message
news:qtagtvc2artlqa1fftcps9q97bb9esso56@4ax.com...
> >I use the API GetProcAddress to get export function from user32.dll, such
as
> >SetWindowLongA, SetWindowLongW, which can work well. But SetWindowLongPtr
> >have some problem, whatever I used SetWindowLongPtr
> >,SetWindowLongPtrA,SetWindowLongPtrW, it return NULL
>
> I think you'll find it's a macro wrapper and not really a function.
>
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq


0
m_lihui (7)
12/11/2003 10:28:46 AM
>I think you'll find it's a macro wrapper and not really a function.

or an inline function in some circumstances.

It appears to be a real OS function for Win64!

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
12/11/2003 11:01:01 AM
Reply:

Similar Artilces:

How to get the heap address?
Hello all: Look: unsigned long get_esp() { unsigned long val_esp; __asm { mov eax,esp mov val_esp,eax } return val_esp; } Could these codes get the stack address?I want to know how to get the heap address?Thanks very much. Well, sort of. They will return to you A stack address, but I have no idea what THE stack address is because it is dynamic. Note that this only works on a 32-bit machine for two reasons: you only allowed 32 bits for the address, and in Win64 the values are 64 bits; and Win64 does not support __asm inserts. UINT_PTR get_esp() { DWORD top; retur...

how to get rid of read only
hi When I copy my files to CD and use the CD in another PC, the files ar available as 'read only'. Is there a way to get rid of this problem? thanks Tom -- Message posted from http://www.ExcelForum.com You cannot save direct to a CD therefore all files on CD are read only. --- Message posted from http://www.ExcelForum.com/ Smile, when you put the files on the other computer you can right click on them, select them all at once, and choose properties and uncheck read only -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so...

Restore Address book in Outlook 2002
Is there a way to restore a deleted address book in Outlook 2002? Any help would be appreciated. Kevin Since there is no address book file or folder in Outlook, we'd need to know a bit more about what you deleted and how. -- Russ Valentine [MVP-Outlook] "K. Miller" <kmiller@pinespringsranch.org> wrote in message news:074401c34673$d626db80$a301280a@phx.gbl... > Is there a way to restore a deleted address book in > Outlook 2002? > > Any help would be appreciated. > > Kevin ...

Citrix and Outlook Address Book
Hello, I have 80 Citrix users who connect to Exchange 5.5. They all have access to 3 public contacts folders that contain customer email addresses. On a specific client you can right click the public contact folder, go to properties, Outlook Address Book and then you can check Show this folder as an Outlook Address Book. This enables you to use the public folders in your address book hierarchie. Now I would like to enable this setting for all my Citrix users. Can I do this on the Citrix boxes or on the Exchange box, without having the users to manually check the option? Thanks for yo...

setting the default address book for all domain users?
Hi, I was just assigned the Exchange admin duties at our office. We have Exchange 2003 server on Windows 2003 Enterprise. Outlook XP (but moving to Outlook 2003 clients) Office management wants the default address book that displays first to be an Outlook address book instead of our Global Address book (our global address book contains email addresses of other outside offices and an email was accidently sent outside to someone with the same name). They want this done for ALL USERS. I know how to do it in Outlooks with the Tools->Address Book-> Options etc. Is there a way to set this g...

problem with calling mfc dll from #C
Hi All, Debug Assertion Failed File dbgheap.c _CrtIsValidHeapPointer() I get the above while trying to CGAL::Intersection(Polygon_2 , Polygon_2,std::back_inserter(...)) in a MFC DLL project (Visual Studio .Net 2003) I call it from C# project. What to do to fix my project? Please Help Thanks Miki How are you calling the MFC dll? Is it managed code with MFC or simply an COM server which has been imported in managed code? Also, you are better off posting this in dotnet.vc newsgroup. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "miki" <mich...

Howto get standard SystemInfo dialog
Hello, does anyone know how to call the 'Microsoft System Information' dialog from mfc? The same dialog you get e.g. at the Microsoft Word -> About -> System info button. Thanks in advance, Arno Try a ShellExecute[Ex]() / CreateProcess() of msinfo32.exe -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "Arno" <Arno@discussions.microsoft.com> wrote in message news:AA524CFD-AF69-4606-888C-D3BF60BEA4DB@microsoft.com... > Hello, > does anyone know how to call the 'Microsoft System Information' dialog from > mfc? > T...

Outlook prompts to add addresses?
Outlook 2002... when I enter new email addresses in the address line of a new message, Outlook will not send the message without first asking me if I want to add each one to the Contact folder. Does anyone know if this is an option I can turn off? Thanks Scott Holmes ...

Where do I get codes from?
Hi, I'm a new user of MS Access and I need to find out where to find the codes for formulate reports in the system. Most of my report are very basic, but I'm not able to find where to go to enter any fuctions or sums for fields....Can someone advise me on this...also, does anyone know how to tell the system to calculate a blank field. For example, if I want to run a report that shows no completion dates or the fields are blank, how would I do that? I know this is very basic, but I haven't used MS Access in years and I'm not sure where to go to retrieve info.... A common...

how to get the row and col count of a TMGrid using sendmessage?
I have a 3rd party application which uses TMGrid, I want to get the row and col count of this TMGrid using SendMessage. The Parent Control is a TTabSheet. Anyone know how to do it? I tried the LVM_ message, but failed. Hi, try to find out what messages this control can handle, e.g. with Spy++. Just give it a try,... Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Microsoft Live Space: http://kerem-g.spaces.live.com/ Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "This reply is provided as ...

0x8004210A smtp errors on outlook 2003
Hi all, I've read just about everything I can lay my hands on with this problem and am rapidly getting nowhere...... heres what I've got : multiple new, freshly build ol2003 installs on new xp pro sp1 machines. Some of the machines intermittently get this error - sometimes all the time, other times seldom. One or two machines have never had it. All machines have been through an identical build process. heres what I think its not: - not the MTU problem mentioned elsewhere - have tried the blackhole and pmtu changes and they dont help. - not anything to do with antivirus - running ...

Address Book Quirk
I moved my .pst file from Outlook 2000 to Outlook XP. When I type in a name in the To box on an e-mail it does not recognize it although it's in the contacts folder. When I click on the To button it lists my contacts twice, one with SMTP and the other FAX. How can I just have the SMTP addresses and not the FAX addresses show up in the To list? Typing in the To: field uses autocompletion, which does not use your Contacts Folder. It uses a cache of names created as you send messages. The standard behavior for the Outlook Address book is to display all electronic addresses (both fa...

Set public folder as default address list
Is there a way that I can set a public contact folder as the default address list when composing a message on all of my clients? JBeckett [MCSA] <JBeckettMCSA@discussions.microsoft.com> wrote: > Is there a way that I can set a public contact folder as the default > address list when composing a message on all of my clients? This is an Outlook thing. You can change the Outlook Address Book to display whatever you like as its initial view, in the settings in the address book menu, I believe. You don't want to make Outlook do *lookups* first from the public contacts folder, ...

Form control events get broken.
My colleagues and I have a problem that occurs while designing access forms and it isn't helped by the fact that our applications have a lot of buttons on their forms. The best way I can describe the problem is to explain how to repeat the problematic behavior. 1) Create a blank form and stick a button on it and connect it to some code say: Private Sub Command6_Click() MsgBox ("Hello World") End Sub 2) Change the form to design view. Right Click the button then do edit cut, edit paste from the main menu. Right click the form title bar and choose form view. Click the butt...

Accepting all addresses....
Hi, If someone sends mail to xyz@domain.com and xyz doesn't exist, what happens to that email? I assume exchange sends a message back saying this user doens't exist. If that's the case, how do I stop exchange from sending that response? I'd like to just accept the mail then delete it, so spammers don't know the real addresses on the domain. Also, If I have a user with 20 alias, etting mail at all those alias, and I add a new domain to the server, to accept mail, do I have to recreate all those alias with the new domain for that user? OR will exchange be smart enough to k...

How to get the type code for a custom entity ? MSCRM v3
I created a new entity Called PRITem. When using theSiteMap.XML I need to specifity the EntityType to show it. Ity appears (Automatically) in the workspace. But i can't use it in the SiteMap.XML because i can't find the number. For example: <SubArea Id="nav_activities" EntityType="4200" Icon="/_imgs/ico_16_4212.gif" Url="/Workplace/home_activities.aspx" /> <SubArea Id="nav_calendar" Icon="/_imgs/area/18_calendar.gif" ResourceId="Homepage_Calendar" Url="/workplace/home_calendar.aspx" Clie...

How do I turn my contacts in micro outlook into address labels
I want to be able to run address labels from the names in my microsoft outlook 2007 contacts "jane" <jane@discussions.microsoft.com> wrote in message news:B7AE087F-A214-4460-85A3-FC8CD1492C10@microsoft.com... > I want to be able to run address labels from the names in my microsoft > outlook 2007 contacts Google is YOUR friend. http://ot.bloomu.edu/Documents/Outlook2007/ContactsLabelMerge.pdf ...

Getting hotmail into outlook 2007 mail folders.
I just got hotmail plus. Email goes into outlook but into separate folders created under my hotmail address. How do I get email to go into the regular outlook mail folders automatically? Thanks. "Prince Arthur" wrote in message news:F33A810E-955F-4999-8F16-9EB6807D9D95@microsoft.com... > I just got hotmail plus. Email goes into outlook but into separate > folders > created under my hotmail address. How do I get email to go into the > regular > outlook mail folders automatically? Thanks. Exchange and POP3 accounts get their messages aggregated into the one (de...

Address State Field
I have a client that has a need to make the address state field a drop down so that they can run reports off of it. Is there any way to do this? The only way I thought of was by creating a new field with a drop down. Any ideas would be appreciated..... Thanks! -- Tara Sifuentes, CCDA, CCNA Hi, We always create a new drop down field for Stateorprovince and we write a script in "onchange" on the properties --> Event of this new field. The code update the original field and you don't need to change all of your reports. the only thing is you need to keep the original f...

vbscript to get photos from ldap provider
Hi All.... I'm trying to connect to an ldap provider and pull user photos and save them to file. The vbscript i'm using runs fine (kinda sorta). It does connect and pull the photos out and saves them to file, but it only pulls the first 500 users and then I get this error "Provider: The size limit for this request was exceeded." I've tried playing around with the provider and page size to no avail. Thanks in advance for any suggestions or advice! ################################################################### ' Set path to save picture slocal=&quo...

Getting the Type Descriptor Provider at runtime
I have a implemented a custom TypeDescriptorProvider / CustomTypeDescriptor solution for a custom type to display custom properties when an instances of my custome type is selected by the PropertyGrid. To register the TypeDescriptionProvider for my type I use the TypeDescripionProvider Attribute with my class: [TypeDescriptionProvider(typeof(MyTypeDescriptionProvider))] The MyTypeDescriptionProvider maintains a cache of PropertyDescriptors that I need to refresh every so often so I need to get access to it after it's been registered. I've tried to call the functio...

Looking for a way how to get currently selected item from List control
Hi, guys. There is a task. I have a window that is something like CListCtrl (but different framework, not MFC). I know only the HWND for that window. Inside are items. In fact it looks like usual ListCtrl but with some options like background and small buttons in the bottom to add/delete items. So I'm looking for a way how to find out which item is currently selected. I mean i need coordinates of that item. Is it possible to do using some WinAPI functions or so? Thank you. -- ---- German Koninin --------------------------------------- For every complex problem, there's solution t...

Help! Trying to get free/busy availability info on OWA...
We're trying to use OWA as our only client to the Exchange Server. We want to use calendars in OWA as well. However, I cannot see people's free/busy information including my own. How do I initiate free/busy features in OWA Thanks in advance for any assistance. Have you looked at these articles: 322196 XCCC: Outlook Web Access Cannot Retrieve Free-and-Busy Information 813152 XCCC: Outlook Web Access Cannot Obtain Free/Busy Data for Some Recipients 832196 How to Make Sure That Your Free/Busy Information Is Correctly Updated in Doug Blanchard [MSFT] Microsoft PSS Please do not send ...

forward outlook email to external address
I was wondering if I can have my outlook email at work also sent to my home address automatically. Rules Wizard and only if the Exchange Admin allows forwards to the Internet. Any admin worth their salary keeps this disabled. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, can I forward outlook email to external address asked: | I was wondering if I can have my outlook email at work | also sen...

How to get outlook working
I am using Outlook 2000. Is there a difference between outlook and outlook express? How do get this started so that I can send and receive e-mail from there? When I try to use outlook express I get the following message. "The host 'smtp' could not be found. Please verify that you have entered the server name correctly. Account: 'http', Server: 'smtp', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket Error: 11001, Error Number: 0x800CCC0D". I do not know how to set this up properly. AOL is my primary connection to the internet and e-mail now. What d...