Home All Groups Group Topic Archive Search About

__declspec(dllexport) c++

Author
3 Mar 2006 11:37 AM
Luis
Hello...
How can I do an exported function in Visual Basic.Net?

In Visual C++ the source is the next... but I need the same in VB.Net

Thank you

/* This is an example of an exported function. */
__declspec(dllexport) int fnDLLSAMPLE(void)
{

    return 42;
}

Author
3 Mar 2006 12:03 PM
Armin Zingler
Show quote Hide quote
"Luis" <L***@discussions.microsoft.com> schrieb
> Hello...
> How can I do an exported function in Visual Basic.Net?
>
> In Visual C++ the source is the next... but I need the same in
> VB.Net
>
> Thank you
>
> /* This is an example of an exported function. */
> __declspec(dllexport) int fnDLLSAMPLE(void)
> {
>
> return 42;
> }


In the OO world, all methods are parts of classes. Create an assembly, add a
class and add the method. In the client app, set a reference to the
assembly. The client language must support the .Net Framework.


Armin
Author
3 Mar 2006 12:55 PM
Herfried K. Wagner [MVP]
"Luis" <L***@discussions.microsoft.com> schrieb:
> How can I do an exported function in Visual Basic.Net?
>
> In Visual C++ the source is the next... but I need the same in VB.Net
>
> Thank you
>
> /* This is an example of an exported function. */
> __declspec(dllexport) int fnDLLSAMPLE(void)
> {
>
> return 42;
> }

You cannot export functions that way.  All you can do is creating a .NET API
(classes, interfaces) and/or make this API visible to COM.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>