0

I'm compiling a DLL which needs to use portaudio. It uses all sorts of windows libraries for sockets and such too, but the linker wouldn't recognize the portaudio library. Then I remembered portaudio uses __cdcel instead of __stdcall. Normally I would just use __cdcel and be done with it, but the DLL I'm compiling needs to use __stdcall because I'm going to use it with Visual Basic.

And if this project sounds like a bit of a kludge to you, it is.

Void Star
  • 2,401
  • 4
  • 32
  • 57

2 Answers2

0

Stupid me! All I have to do is use __cdcel and declare the exported functions as __stdcall!

Void Star
  • 2,401
  • 4
  • 32
  • 57
0

I presume you need to use __cdecl because portaudio will call some of your functions? Then create an internal function declared __cdecl, pass this function to portaudio, and provide an exported function (declared __stdcall) that calls your internal function.

But I am kind of guessing at what you are trying to do, you should provide more info.

Les
  • 10,335
  • 4
  • 40
  • 60
  • Ah yes, I answered my own question shortly after asking, sorry for the bother. Instead I made my application use __cdecl (making port audio work) and declared my exported functions as __stdcall. – Void Star Aug 03 '12 at 04:53