By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

__fastcall functions in a static lib, cant be called from managed code ??

P: n/a
I have this giant library, it's static and it's all compiled in __fastcall
fashion.
I can not call any of those functions from winforms...
even doing a wrapper off the main class, I still cant call it....
how do I overcome this issue ?
Nov 17 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
What about

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"andrea catto'" <ac****@dataflight.com> schrieb im Newsbeitrag
news:u0**************@tk2msftngp13.phx.gbl...
I have this giant library, it's static and it's all compiled in __fastcall
fashion.
I can not call any of those functions from winforms...
even doing a wrapper off the main class, I still cant call it....
how do I overcome this issue ?

Nov 17 '05 #2

P: n/a
I hear you,
the problem is.
for most of us developers in transition with a bunch of code/legacy.....

we are not encouraged to migrate because there's WAY too much to do to
migrate/migrane !!!

as far as I heard it's possible to do this transition smoothly and
transparently, with IJW, but in my case it's just marketing buzz... it's
more like IJDW (it just doesn't work).

in my current programs,
I only need to #include "mylib.h", add the static.lib to the project
settings and I finally call the damn function.
"cody" <no****************@gmx.net> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
What about

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"andrea catto'" <ac****@dataflight.com> schrieb im Newsbeitrag
news:u0**************@tk2msftngp13.phx.gbl...
I have this giant library, it's static and it's all compiled in __fastcall fashion.
I can not call any of those functions from winforms...
even doing a wrapper off the main class, I still cant call it....
how do I overcome this issue ?


Nov 17 '05 #3

P: n/a
The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.

Ronald Laeremans
Visual C++ team

"andrea catto'" <ac****@dataflight.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I hear you,
the problem is.
for most of us developers in transition with a bunch of code/legacy.....

we are not encouraged to migrate because there's WAY too much to do to
migrate/migrane !!!

as far as I heard it's possible to do this transition smoothly and
transparently, with IJW, but in my case it's just marketing buzz... it's
more like IJDW (it just doesn't work).

in my current programs,
I only need to #include "mylib.h", add the static.lib to the project
settings and I finally call the damn function.
"cody" <no****************@gmx.net> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
What about

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"andrea catto'" <ac****@dataflight.com> schrieb im Newsbeitrag
news:u0**************@tk2msftngp13.phx.gbl...
> I have this giant library, it's static and it's all compiled in __fastcall > fashion.
> I can not call any of those functions from winforms...
> even doing a wrapper off the main class, I still cant call it....
> how do I overcome this issue ?
>
>



Nov 17 '05 #4

P: n/a
> The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.


So what is that in your opinion:

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

a placebo?
Nov 17 '05 #5

P: n/a
if it is not, IT SUCKS,......
I am a Microsoft lover myself........
but. this totally susks...
IJW is bs then...
"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.

Ronald Laeremans
Visual C++ team

"andrea catto'" <ac****@dataflight.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I hear you,
the problem is.
for most of us developers in transition with a bunch of code/legacy.....

we are not encouraged to migrate because there's WAY too much to do to
migrate/migrane !!!

as far as I heard it's possible to do this transition smoothly and
transparently, with IJW, but in my case it's just marketing buzz... it's
more like IJDW (it just doesn't work).

in my current programs,
I only need to #include "mylib.h", add the static.lib to the project
settings and I finally call the damn function.
"cody" <no****************@gmx.net> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
What about

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"andrea catto'" <ac****@dataflight.com> schrieb im Newsbeitrag
news:u0**************@tk2msftngp13.phx.gbl...
> I have this giant library, it's static and it's all compiled in

__fastcall
> fashion.
> I can not call any of those functions from winforms...
> even doing a wrapper off the main class, I still cant call it....
> how do I overcome this issue ?
>
>



Nov 17 '05 #6

P: n/a
well the problem is that there is a HUGE amount of merely static libraries
that have been compiled in a __fastcall fashion.
this is my case....
and if I have to sit here and recompile, provided I am lucky eough to have
the code, or create dlls....
it WON'T WORK !!!
sorry to use capital letters, but this is a huge inconveniece that Microsoft
has to overcome instead of kicking programmets in the butt, __fastcall us a
Microsoft invention, they should suppore it somehow....
__fastcall afterall is nothing but a way to pass arguments to the functions,
if I am not mistaken by using registers instead of the stack.
it's simple assembler that I can even write.
"cody" <pl*************************@gmx.de> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.


So what is that in your opinion:

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

a placebo?

Nov 17 '05 #7

P: n/a
From the "CallingConvention Enumeration" help topic in the documentation:

FastCall This calling convention is not supported.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicescallingconvention classtopic.asp>

Ronald

"cody" <pl*************************@gmx.de> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.


So what is that in your opinion:

[DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]

a placebo?

Nov 17 '05 #8

P: n/a
So am I safe in assuming that you do not have access to source for this
library? In that case the best you can do is to write a wrapper for this
function.

Whereas fastcall used to have significant benefits several years ago, on
modern architectures it does not tend to be a significant performance win
and marking all functions as fastcall might very well make the application
slower overall. Which is the main reason this calling convention is not
supported in the CLR.

Ronald

"andrea catto'" <ac****@dataflight.com> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
if it is not, IT SUCKS,......
I am a Microsoft lover myself........
but. this totally susks...
IJW is bs then...
"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The fastcall calling convention is not supported by the CLR. If you have
source for the library the easiest thing to do is to recompile it with a
different calling convention.

Ronald Laeremans
Visual C++ team

"andrea catto'" <ac****@dataflight.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
>I hear you,
> the problem is.
> for most of us developers in transition with a bunch of
> code/legacy.....
>
> we are not encouraged to migrate because there's WAY too much to do to
> migrate/migrane !!!
>
> as far as I heard it's possible to do this transition smoothly and
> transparently, with IJW, but in my case it's just marketing buzz...
> it's
> more like IJDW (it just doesn't work).
>
> in my current programs,
> I only need to #include "mylib.h", add the static.lib to the project
> settings and I finally call the damn function.
>
>
> "cody" <no****************@gmx.net> wrote in message
> news:OU**************@tk2msftngp13.phx.gbl...
>> What about
>>
>> [DllImport("test.dll", CallingConvention=CallingConvention.FastCall)]
>>
>> --
>> cody
>>
>> Freeware Tools, Games and Humour
>> http://www.deutronium.de.vu || http://www.deutronium.tk
>> "andrea catto'" <ac****@dataflight.com> schrieb im Newsbeitrag
>> news:u0**************@tk2msftngp13.phx.gbl...
>> > I have this giant library, it's static and it's all compiled in
> __fastcall
>> > fashion.
>> > I can not call any of those functions from winforms...
>> > even doing a wrapper off the main class, I still cant call it....
>> > how do I overcome this issue ?
>> >
>> >
>>
>>
>
>



Nov 17 '05 #9

P: n/a
> So am I safe in assuming that you do not have access to source for this
library? In that case the best you can do is to write a wrapper for this
function.

Whereas fastcall used to have significant benefits several years ago, on
modern architectures it does not tend to be a significant performance win
and marking all functions as fastcall might very well make the application
slower overall. Which is the main reason this calling convention is not
supported in the CLR.


So why is there a FastCall in the enum?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 17 '05 #10

P: n/a
Because it is a valid calling convention. Initially there was some thinking
it might be supported in a future version, but that looks very unlikely now.

In another part of the thread I posted the documentation that stated it was
not supported.

Ronald

"cody" <pl*************************@gmx.de> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
So am I safe in assuming that you do not have access to source for this
library? In that case the best you can do is to write a wrapper for this
function.

Whereas fastcall used to have significant benefits several years ago, on
modern architectures it does not tend to be a significant performance win
and marking all functions as fastcall might very well make the
application
slower overall. Which is the main reason this calling convention is not
supported in the CLR.


So why is there a FastCall in the enum?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.