Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:53:11+00:00 2026-05-10T18:53:11+00:00

In xp 32bit this line compiles with not problem however in vista 64bit this

  • 0

In xp 32bit this line compiles with not problem however in vista 64bit this line:

m_FuncAddr = ::GetProcAddress (somthing); 

gives the following error

error C2440: ‘=’ : cannot convert from ‘FARPROC’ to ‘int (__cdecl *)(void)’

GetProcAddress is defined as

WINBASEAPI FARPROC WINAPI GetProcAddress (somthing) 

And m_FuncAddr as

int (WINAPI *m_FuncAddr)(); 

From what I understand both are stdcall’s.

To avoid the error I had to put

m_FuncAddr = (int (__cdecl *)(void))::GetProcAddress(somthing); 

My Question:

If both m_FuncAddr and GetProcAddress have the stdcall calling convention why do I have to ‘recall’ it with cdecl ?

Is it possible that the VS project setting ‘default calling convention (which is set to cdecl) over-rides the assignemet statment above ?

Thanks in advance!

[Edit]

To clerfiy the question:

On one side of the equation (say side 1) i have

int __stdcall * m_FuncAddr 

On other side (side 2)

INT_PTR far __stdcall GetProcAddress 

So how is it that i have to cast side 2 with cdecl if both are stdcalls ? Or am I not getting something ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:53:12+00:00Added an answer on May 10, 2026 at 6:53 pm

    The return type should be INT_PTR (a 64-bit value in 64-bit builds). You shouldn’t cast around this error — the compiler is trying to tell you that something is wrong.

    From WinDef.h:

    #ifdef _WIN64 typedef INT_PTR (FAR WINAPI *FARPROC)(); 

    So the declaration of m_FuncAddr should be:

    INT_PTR (WINAPI *m_FuncAddr)(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I have written an article with an example app to… May 11, 2026 at 9:53 am
  • added an answer Since the size of your Items collection can vary, you… May 11, 2026 at 9:53 am
  • added an answer I don't know how one is supposed to changed the… May 11, 2026 at 9:53 am

Related Questions

In xp 32bit this line compiles with not problem however in vista 64bit this
I have some UI in VB 2005 that looks great in XP Style, but
What's the best way to detect an application crash in XP (produces the same
I have been developing a C# windows form application in XP. It all works
I know a fair bit about the Windows Task Manager in XP, but I
In Windows XP: How do you direct traffic to/from a particular site to a
In Windows XP, Microsoft took the decision to limit the number of half open
When in Windows XP, if I open the properties window for the file and
Does IPsec in Windows XP Sp3 support AES-256 encryption? Update: Windows IPsec FAQ says
I'm using IIS 5.1 in Windows XP on my development computer. I'm going to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.