473,386 Members | 1,820 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,386 software developers and data experts.

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

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
10 3361
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
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
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
> 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
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
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
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
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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
5
by: Bern McCarty | last post by:
I have a DLL written in C++ (it's really C code that was adjusted to compile OK as C++) that I compile successfully into IL with the /CLR switch of Visual C 7.1. I use the resultant library...
2
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a...
2
by: Steve McLellan | last post by:
Hi, We've found some pretty serious performance hits that we didn't expect in a mixed mode C++ application. The number crunching bits of our algorithms are compiled with #pragma unmanaged. They...
7
by: Adam | last post by:
I have a managed cpp wrapper. Im using this in a native dll as a static variable. I need to free this library when the dll is done being used. The perfect place to do this is DllMain for...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
5
by: Jesper Schmidt | last post by:
When does CLR performs initialization of static variables in a class library? (1) when the class library is loaded (2) when a static variable is first referenced (3) when... It seems that...
3
by: Jonathan Wilson | last post by:
I have the following: 1.A C++ dll (with no managed code whatsoever) compiled with visual C++ 2005 that links to libcmt.lib as its runtime library. and 2.A piece of binary code (also compiled with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.