Click here to Skip to main content
15,911,360 members
Home / Discussions / C#
   

C#

 
AnswerRe: Global events or messaging. Pin
Not Active9-Aug-06 9:39
mentorNot Active9-Aug-06 9:39 
GeneralRe: Global events or messaging. Pin
mbnbonin9-Aug-06 9:43
mbnbonin9-Aug-06 9:43 
GeneralRe: Global events or messaging. Pin
Not Active9-Aug-06 14:58
mentorNot Active9-Aug-06 14:58 
GeneralRe: Global events or messaging. [modified] Pin
Larantz10-Aug-06 23:14
Larantz10-Aug-06 23:14 
Questionhow to call functions in unmanaged C++ dll from C# app Pin
moniqui9-Aug-06 8:09
moniqui9-Aug-06 8:09 
AnswerRe: how to call functions in unmanaged C++ dll from C# app Pin
Judah Gabriel Himango9-Aug-06 9:01
sponsorJudah Gabriel Himango9-Aug-06 9:01 
GeneralRe: how to call functions in unmanaged C++ dll from C# app Pin
moniqui9-Aug-06 9:30
moniqui9-Aug-06 9:30 
GeneralRe: how to call functions in unmanaged C++ dll from C# app Pin
Judah Gabriel Himango9-Aug-06 13:08
sponsorJudah Gabriel Himango9-Aug-06 13:08 
moniqui wrote:
What is a ref class?


In C++/CLI, it's a managed C++ class, that is, the contents of the class are exposed to other .NET languages natively, it uses .NET garbage collection, and so on. C++/CLI is new to Visual Studio 2005; if you're using Visual Studio 2003, there's managed extensions for C++, in which case you'd use the __gc keyword instead of the ref keyword. Go to the C++/CLI forum if you have more questions about C++/CLI syntax and how to wrap a native library. Basically, when write a ref class in C++/CLI, any other .NET language can immediately call into that class, no P/Invoke or interop code required; you'd use it like any other normal type.

moniqui wrote:
Do I need to create a .def file?

Not from the C++/CLI project, no. For the native class you're wrapping, I'm not sure, I recommend going into the C++/CLI forum for a better answer.

moniqui wrote:
Where you said "mynative->Start()", is mynative the name of my dll (so it would be MITT->Start() )? I tried that and the compiler said it couldn't resolve MITT, so I'm not sure how to make this C++ class aware of the dll.


mynative was just your C++ class instance that contained the Start method. If the Start method is not defined in a class (i.e. it's global) then you wouldn't have a mynative reference.

moniqui wrote:
I'm not sure how to make this C++ class aware of the dll.


I recommend you read this article[^] on wrapping native libaries using C++/CLI.

Often times, if you just need to call one or two functions, the easiest way is through P/Invoke with [DllImport]. But if you're calling lots of functions, structures, or if the native C++ library contains its functionality inside of classes, you're best bet is with C++/CLI.


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: how to call functions in unmanaged C++ dll from C# app Pin
moniqui10-Aug-06 10:59
moniqui10-Aug-06 10:59 
GeneralRe: how to call functions in unmanaged C++ dll from C# app Pin
Judah Gabriel Himango11-Aug-06 4:29
sponsorJudah Gabriel Himango11-Aug-06 4:29 
AnswerRe: how to call functions in unmanaged C++ dll from C# app Pin
Eric Dahlvang9-Aug-06 10:35
Eric Dahlvang9-Aug-06 10:35 
QuestionUser controls, delegates and the designer Pin
Wjousts9-Aug-06 5:20
Wjousts9-Aug-06 5:20 
AnswerRe: User controls, delegates and the designer Pin
Ed.Poore9-Aug-06 5:25
Ed.Poore9-Aug-06 5:25 
GeneralRe: User controls, delegates and the designer Pin
Wjousts9-Aug-06 5:27
Wjousts9-Aug-06 5:27 
GeneralRe: User controls, delegates and the designer Pin
Ed.Poore9-Aug-06 5:32
Ed.Poore9-Aug-06 5:32 
GeneralRe: User controls, delegates and the designer Pin
Wjousts9-Aug-06 6:38
Wjousts9-Aug-06 6:38 
GeneralRe: User controls, delegates and the designer Pin
Ed.Poore9-Aug-06 11:47
Ed.Poore9-Aug-06 11:47 
Questiontest connection Pin
Sandrina9-Aug-06 4:55
Sandrina9-Aug-06 4:55 
AnswerRe: test connection Pin
Ed.Poore9-Aug-06 5:22
Ed.Poore9-Aug-06 5:22 
GeneralRe: test connection Pin
Sandrina9-Aug-06 21:38
Sandrina9-Aug-06 21:38 
GeneralRe: test connection Pin
Ed.Poore9-Aug-06 22:02
Ed.Poore9-Aug-06 22:02 
AnswerRe: test connection Pin
Not Active9-Aug-06 5:38
mentorNot Active9-Aug-06 5:38 
GeneralRe: test connection Pin
Sandrina9-Aug-06 21:41
Sandrina9-Aug-06 21:41 
Questionconsole.writeline Pin
Harvey Turtle9-Aug-06 3:38
Harvey Turtle9-Aug-06 3:38 
AnswerRe: console.writeline Pin
stancrm9-Aug-06 3:45
stancrm9-Aug-06 3:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.