The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

pointers to functions in


i have a function in an application, so far so good. it manipulates the user interface (adds menu items etc) based on information passed as parameters.

i also have a library plugin, now the plugin has a consistant user interface, so my application includes that interface (actually the project includes one plugin so it 'knows' about the object)

question is.. how can i call the application.function() from the plugin.

in c its pretty easy, just include a header and away you go, or failing that just use a pointer. yes you can shoot yourself if you make a mistake. but it is possible.

the alternative is to have a lot more functions in the plugin (many of which will normally return 'nothing').

does have an equivelent of c's header files? to allow an objects structure to be imported without the code?

and if so what is it called so i can go dig up some info?
Claire Rand
Wednesday, May 24, 2006
If the function is located in a regular DLL that you can call from C, you can simply use the same DLL from .NET using P/Invoke. That is, you declare the required structures and methods inside your VB.NET assembly.

Google P/Invoke and also look up DLLImportAttribute and MarhalAsAttribute, those are the two most important attributes for that facility. The website has lots of examples for system libraries.
Chris Nahr Send private email
Wednesday, May 24, 2006
> does have an equivelent of c's header files? to allow an objects structure to be imported without the code?

Start by reading up on interfaces and delegates.
Wednesday, May 24, 2006
all the functions are within a regular .dll created in (though some may well end up from c++ etc later).

i've been using 'addressof' to get the function by name, but that requires me to have the objects structure loaded.

hmm. the 'interfaces' bit looks very useful, since i only need a very small number of functions in a secondary interface for the plugins to load..

marshalling etc is a big black hole at the mo, but i will look into it.

thanks :-)
Claire Rand
Wednesday, May 24, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz