Exporting Functions and variables

Exporting Functions and variables

Post by Scherbina » Mon, 12 Dec 2005 23:56:31



http://www.yqcomputer.com/


yes

--
Vladimir
 
 
 

Exporting Functions and variables

Post by Kellie Fit » Tue, 13 Dec 2005 06:21:22

Hi,

Well, one good option to share objects in a .DLL file and create
chuncks of shared memory, is to create and use memory mapped files,
it is elegant, efficient and multiThreading-safe as well, just try
to use some sort of synchronization technique if you are running
multiple threads within your application.

CreateFileMapping()
OpenFileMapping()
MapViewOfFileEx()
UnmapViewOfFile()
FlushViewOfFile()
CloseHandle()

Also, here is a sample program that shows how to use these
functions:

http://www.yqcomputer.com/

http://www.yqcomputer.com/

http://www.yqcomputer.com/

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Hope these information helps,

Kellie.

 
 
 

Exporting Functions and variables

Post by Scherbina » Tue, 13 Dec 2005 06:25:55


Really ? Even passing data via MMF one should care about data syncronization
 
 
 

Exporting Functions and variables

Post by Kellie Fit » Tue, 13 Dec 2005 07:36:51

Hi,

when using memory mapped files, you should use some sort of
synchronization technique
if you are running multiple threads within your application.

Kellie. :---)
 
 
 

Exporting Functions and variables

Post by Scott McPh » Tue, 13 Dec 2005 08:29:00


Synchronization is also required if multiple processes are using the
memory mapped file.

--
Scott McPhillips [VC++ MVP]
 
 
 

Exporting Functions and variables

Post by Kellie Fit » Tue, 13 Dec 2005 08:49:23

Hi Scott,

Very valid point --- I couldn't agree any more, thanks.

Kellie.
 
 
 

Exporting Functions and variables

Post by Mori » Tue, 13 Dec 2005 09:33:38

I have a main programs which loads a dll. Then this dll loads a new dll and
uses its functions.
I need to use inside the main program, an exported function from the last
dll.

I have 2 questions-

What should I do to export functions?

Is it also possible to to use exported variables in the main prgram?

Thnaks in advance.

Moris
 
 
 

Exporting Functions and variables

Post by UGF2ZWwgQS » Tue, 13 Dec 2005 23:46:05


Export or import? The DLL do EXPORT functions.
The main program IMPORTs them. ok?

If your question means, how the main program IMPORTS functions
from a DLL loaded by another DLL:
- call GetModuleHandleEx to find the 2nd DLL in the address space of
the process. You need to know the name of that DLL.
- then call GetProcAddress with this handle to get the function pointer.

--PA