Help - Search - Members - Calendar
Full Version: Starting To Learn Dlls
BleepingComputer.com > Software > Programming
   
zyrolasting
I went utterly crazy.gif when I looked at the DLL skeleton for C script in Dev-C++ 4.9.9.2 . I suddenly understood nothing.
My question is, how is any form of code implemented into the skeleton, and sent out? Here is the template.

CODE
#ifndef _DLL_H_
#define _DLL_H_

#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */


DLLIMPORT void HelloWorld (void);


#endif /* _DLL_H_ */


I'm to GUESS that dllexport exposes the code to apps, but I think in order to get me on the right track I need to ask a reworded question. If I write a script, where would it go and how would it's returned value go to dllexport? Is that by using return in main?
I have novice experience in C and can understand basic scripts, but am just starting on this. Please explain this to me so I can understand it?
zyrolasting
I'm so sorry about the double post, but for some reason the Edit button is not showing up even with me logged in. Why is this...?

Anyway, I have found more basic knowledge after refining a Google search, but have a new question.

#define DllImport __declspec( dllimport )
#define DllExport __declspec( dllexport )

DllExport void func();
DllExport int i = 10;
DllImport int j;
DllExport int n;

I found this snip as an example for the use.
In DLLEXPORT, when n is declared, how does that get exported...? Is it exported as an uninitialized variables? If so, how is that used?
For the record, Google isn't helping so much. I'm reading up on it, but outside help is appreciated.
KoanYorel
After 24 hours - one cannot edit a post. So don't worry about the back-to-back posts.

Sorry I can't answer your other questions. Another will be along soon. Please be patient.
zyrolasting
Alright, thank you. But my edit button for that post I made 10 minutes ago is now unavailable as well.
Can browser settings interfere with that?
KoanYorel
Ooops, I forgot to note that once another reply has been made, you also lose the edit function. Sorry about that.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.