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

  • SEARCH
  • Home
  • 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 106k
  • Answers 106k
  • 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
  • Editorial Team
    Editorial Team added an answer On the compact framework I think your going to roll… May 11, 2026 at 8:57 pm
  • Editorial Team
    Editorial Team added an answer just found the answer. when importing you need to register… May 11, 2026 at 8:57 pm
  • Editorial Team
    Editorial Team added an answer You are using the value r as the stopping condition… May 11, 2026 at 8:57 pm

Related Questions

I need some mind reading here, since I am trying to do what I
The situation: I need to convert our current development environment from Windows XP 32-bit to
I have an interesting/annoying problem with some VBScripts running on Windows 2003 Server (they
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component 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.