473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to change calling convention in C?

As C supports _cdecl calling convention if I want to change it to _stdcall then what should I have to do?
Nov 20 '12 #1
3 1212
donbock
2,426 Expert 2GB
This is outside the C Standard, making it an implementation-defined feature. What is your compiler and target environment?
Nov 20 '12 #2
weaknessforcats
9,208 Expert Mod 8TB
Just place the calling convention between the function name and the return type:

Expand|Select|Wrap|Line Numbers
  1. void _stdcall Myfunction( etc...);
BTW: _stdcall is also known as WINAPI.
Nov 20 '12 #3
Thank you weaknessforcats.....
Nov 21 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jeremy R. Harner | last post by:
I'm trying to use a DLL, but when I try to run it from Visual Basic by going to Run > Start I get a 'Bad DLL Calling Convention' error when I try to access a function inside the DLL. If I compile...
1
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
1
by: Ross Cooper | last post by:
Hi all, you know how with DllImportAttribute you can specify a calling convention, can you specify one for a COM interface as well? Im trying to talk to some COM objects and it turns out they were...
4
by: apm | last post by:
Is there a way to change the calling convention of a delegate to Cdecl? Is it possible to define a callback function in C# that used the Cdecl convention? Thanks in advance.
1
by: Sriniv | last post by:
Hello all C-eers! I've heard oc calling convention. What is it really? I've seen some prefix words before function definitions. __stdcall, WINAPI, to name a few. What are these? Are they platform...
6
by: RB Smissaert | last post by:
Made a C++ dll with MS VC6 and trying to call the dll from Excel VBA. This is the code in the .cpp file: #include "stdafx.h" #include <string> #include <math.h> using namespace std;
2
by: Geler | last post by:
A theoretical question: Sorry if its a beginner question. Here is a quote from the MSDN explaning the C/C++ calling convention.. It demonstrates that the calling function is responsible to clean...
6
by: priyanka | last post by:
Hi there, I want to learn about the calling convention that is adopted by the gcc compiler for C programs ? I need to learn about it immidiately for finding out the parameters passed to...
10
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK...
6
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.