Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 105,772 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,476 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



C# DLL

 
Reply to this topicStart new topic

C# DLL

turtleC++
post 16 Jul, 2008 - 04:38 PM
Post #1


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 41

If I declare like this in C++, how can I declare this same interface but in C#?

CODE

extern "C" __declspec(dllexport) BOOL WINAPI GetPersonInformation(HANDLE program)
{

}

User is offlineProfile CardPM

Go to the top of the page


zakary
post 17 Jul, 2008 - 05:30 AM
Post #2


D.I.C Regular

Group Icon
Joined: 15 Feb, 2005
Posts: 362



Thanked 4 times

Dream Kudos: 175
My Contributions


are you wrapping the C++ dll or you just want to write the code in C# that does the same thing as the c++ code
User is offlineProfile CardPM

Go to the top of the page

turtleC++
post 17 Jul, 2008 - 09:25 AM
Post #3


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 41

When you said wrap the c++ dll, what do you mean by that? but my main purpose is just write c# that does the same like c++. Does C# have HANDLE type?

This post has been edited by turtleC++: 17 Jul, 2008 - 09:25 AM
User is offlineProfile CardPM

Go to the top of the page

zakary
post 17 Jul, 2008 - 10:27 AM
Post #4


D.I.C Regular

Group Icon
Joined: 15 Feb, 2005
Posts: 362



Thanked 4 times

Dream Kudos: 175
My Contributions


wrapping the C++ dll would mean that you create unmanaged code that will access the method in the c++ code by using the c++ dll.

User is offlineProfile CardPM

Go to the top of the page

turtleC++
post 17 Jul, 2008 - 12:13 PM
Post #5


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 41

Thanks for your explanation, but is it possible to use C# to export function like the c++ statement I have above?
User is offlineProfile CardPM

Go to the top of the page

baavgai
post 17 Jul, 2008 - 01:17 PM
Post #6


Dreaming Coder

Group Icon
Joined: 16 Oct, 2007
Posts: 1,471



Thanked 38 times

Dream Kudos: 325

Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions


QUOTE(turtleC++ @ 17 Jul, 2008 - 03:13 PM) *

Thanks for your explanation, but is it possible to use C# to export function like the c++ statement I have above?


I believe the magic google word you're looking for it "unmanaged". This was my first hit and seems answer the question: http://blogs.msdn.com/jonathanswift/archiv.../02/780637.aspx
User is online!Profile CardPM

Go to the top of the page

turtleC++
post 17 Jul, 2008 - 05:11 PM
Post #7


New D.I.C Head

*
Joined: 7 May, 2008
Posts: 41

QUOTE(baavgai @ 17 Jul, 2008 - 01:17 PM) *

QUOTE(turtleC++ @ 17 Jul, 2008 - 03:13 PM) *

Thanks for your explanation, but is it possible to use C# to export function like the c++ statement I have above?


I believe the magic google word you're looking for it "unmanaged". This was my first hit and seems answer the question: http://blogs.msdn.com/jonathanswift/archiv.../02/780637.aspx



YES indeed, it answers to my question, managed calls unmanaged code, but after thinking over this is not what I wish to do. I should do the opposite way which is unmanaged calls managed..
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 03:35PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month