Questions tagged [stdcall]

Anything related to the `stdcall` calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

Anything related to the stdcall calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

See Wikipedia on:

150 questions
4
votes
1 answer

error C2143: syntax error : missing ';' before '__stdcall"

I'm having some trouble creating a COM DLL. My IClassFactory-implementation looks like the following: include #include #include "AddObj.h" #include "AddObjFactory.h" HRESULT __stdcall CAddFactory::CreateInstance(IUnknown*…
Nrgyzer
  • 783
  • 1
  • 14
  • 38
4
votes
3 answers

When using PInvoke, why use __stdcall?

I have been using PInvoke to let my C# application call C++ functions I wrote. Now, I keep hearing everywhere and beyond that I need to define those externally accessible functions with the __stdcall convention. My question is: Why? So far, I have…
Lee White
  • 3,649
  • 8
  • 37
  • 62
4
votes
1 answer

Using std::bind with __stdcall function

How does one can use std::bind (not boost::bind) on __stdcall function or is it even possible in current implementation? When i try to compile following example: std::function func; func =…
Ivan0x32
  • 413
  • 1
  • 7
  • 18
3
votes
2 answers

What is advantage/use of __stdcall?

Before posting this question, I have already read some documentation, SO answers and watched some videos to understand __stdcall. So far I have understood that it's a calling convention and specifies to push parameters from right to left on the…
skm
  • 5,015
  • 8
  • 43
  • 104
3
votes
2 answers

Typedef function inside a class

I want to to be able to have my typedef function inside a class. But i dont find a way to do that. I need to scan for the address so i cant hardcode it in, therfor i need to sett the address like this SetCursorPosFunction = (_SetCursorPos)(address…
3
votes
0 answers

Lambda as WNDPROC C++

I want to use c++ lambda expression as a window procedure in WinApi. I've seen it on many pages, this one for example. The code won't compile tho: WNDPROC x = [](HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -> LRESULT { return…
Cansisti
  • 153
  • 7
3
votes
1 answer

Why Doesn't MSDN or VS2015 Declare IUnknown Methods with __stdcall convention?

Apologies if this question is a bit unfocused. I am working with COM, writing some simple COM servers and objects with Visual Studio 2015 Community, under Windows 10. All COM objects must implement the IUnknown interface. VS2015's IDE will offer to…
Stevens Miller
  • 1,387
  • 8
  • 25
3
votes
1 answer

Can stdcall have a variable arguments?

As far as I know, only the caller-clean-stack convention can use variable arguments. By the way, the WinApi StringCchPrintfW is declared like this.(I removed the SAL) __inline HRESULT __stdcall StringCchPrintfW( STRSAFE_LPWSTR pszDest, size_t…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
3
votes
1 answer

Why use __stdcall for function pointer

I was looking at some code like the one mentioned here: Function pointers for winapi functions (stdcall/cdecl), Function pointer and calling convention, etc. What is the need, benefit for declaring the calling type of a function pointer as…
armundle
  • 1,149
  • 2
  • 15
  • 28
3
votes
2 answers

Is it possible to have an exported function in __stdcall and the name unmangled?

I am working on a project to generate a dummy DLL for offline testing. We have the real DLL and its header file, though they seem incompatible. The names in the DLL are unmangled but the function forward declarations declarations are called out as…
J Collins
  • 2,106
  • 1
  • 23
  • 30
3
votes
1 answer

How to create default parameters for DLL procedures (stdcall)?

I have made a DLL which exports several functions (with stdcall). I want to have some of them accept parameters or not. So a lazy programmer can just call it without any parameters. I read somewhere on a forum that default parameters don't work in…
Tom
  • 2,962
  • 3
  • 39
  • 69
3
votes
1 answer

How to make stdcall from Go

I have a pointer to a COM interface and would like to take the function pointers from its virtual table and make method calls. To do this I need to make stdcall method calls. In Go how do I make a call with convention stdcall or make a call with…
user782220
  • 10,677
  • 21
  • 72
  • 135
2
votes
2 answers

__stdcall without any decoration

I have a .dll I suspect uses __stdcall functions, but totally undecorated names (not even an underscore or @ sign). I wrote a .def file for it with aliases like func1 = func1 func1@4 = func1 but I think lib (which I am using to create the import…
Baruch
  • 20,590
  • 28
  • 126
  • 201
2
votes
1 answer

DLL export __stdcall without DEF file and decorated function names with VS

If I have a DLL file...how can I see functions are built as __stdcall or __cdecl? I want to create a DLL to export functions as __stdcall without DEF file and decorated function names with Visual Studio like: __declspec(dllexport) int __stdcall…
Aleksej
  • 49
  • 7
2
votes
1 answer

Problem with Delphi object type with DLLImport in C#

I am integrating my software with legacy hardware, and the DLL documentation made available for integration was done in Delphi. Her documentation states that the call should be made as follows: Function ConfigurarOnLine( Sender: TObject; Com: Byte;…
qoxoq
  • 21
  • 1
1 2
3
9 10