replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - OK, so I've got two 3rd-party DLLs. One's win32, one's .NET
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OK, so I've got two 3rd-party DLLs. One's win32, one's .NET

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KennyT



Joined: 02 Aug 2005
Posts: 320

PostPosted: Fri Aug 05, 2011 9:00 am    Post subject: OK, so I've got two 3rd-party DLLs. One's win32, one's .NET Reply with quote

And I'd like to link to both of them from the same .exe!

I've compiled my FTN95 code in .NET and tested that it can call the 3rd-party .NET DLL - OK.

But when I try to link mydotnet.dll against the 3rd-party win32.DLL using the /R:win32.dll command, I get an error window:

dbk_link2.exe - Bad Image
"The application or DLL mydotnet.DLL is not a valid Windows image, please check this against your installation diskette"

Am I trying to do something illegal or is there a trick?

I'm a bit new to .NET stuff (as my recent posts will attest!) but it seems that it should be possible at some level to link a .NET DLL to a Win32 DLL - surely that's what the OS does somewhere along the line?

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8257
Location: Salford, UK

PostPosted: Fri Aug 05, 2011 2:03 pm    Post subject: Reply with quote

You will not be able to link directly in this way and there is no documented way to do this kind of linking.

In theory you can link with both types of dll and this happens when FTN95 uses salflibc.dll under .NET but this usage is not supported and, off hand I don't know how to do it.
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 320

PostPosted: Fri Aug 05, 2011 3:33 pm    Post subject: Reply with quote

OK, thanks. Saves me chasing rainbows!

Do you happen to know if .NET/win32 DLL interfacing is possible in the c++ world? In other words, if:

"FTN95.NET exe" calling "FTN95.NET dll" calling "c++ win32 dll" won't work,

will

"FTN95.NET exe" calling "FTN95.NET dll" calling "c++ .NET dll" calling "c++ win32 dll" work?

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8257
Location: Salford, UK

PostPosted: Sat Aug 06, 2011 7:02 am    Post subject: Reply with quote

The password is "pinvoke". Type this into Google and enjoy.
Back to top
View user's profile Send private message AIM Address
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Mon Aug 08, 2011 2:55 pm    Post subject: Reply with quote

In C# you can use DLL-imports like
[DllImport("my.dll", EntryPoint = "my_function", ExactSpelling = true)]
internal extern static void my_function(StringBuilder name, ref int id);

(search for "calling unmanaged code" and similar). Don't know if this is what you're looking for though.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group