Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Starting To Learn Dlls


  • Please log in to reply
4 replies to this topic

#1 zyrolasting

zyrolasting

  • Members
  • 45 posts
  • OFFLINE
  •  
  • Local time:03:09 AM

Posted 17 May 2008 - 01:03 AM

I went utterly :thumbsup: 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.

#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?

Edited by zyrolasting, 17 May 2008 - 01:04 AM.


BC AdBot (Login to Remove)

 


#2 zyrolasting

zyrolasting
  • Topic Starter

  • Members
  • 45 posts
  • OFFLINE
  •  
  • Local time:03:09 AM

Posted 18 May 2008 - 02:13 PM

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.

#3 KoanYorel

KoanYorel

    Bleepin' Conundrum


  • Staff Emeritus
  • 19,461 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:65 miles due East of the "Logic Free Zone", in Md, USA
  • Local time:03:09 AM

Posted 18 May 2008 - 02:17 PM

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.
The only easy day was yesterday.

...some do, some don't; some will, some won't (WR)

#4 zyrolasting

zyrolasting
  • Topic Starter

  • Members
  • 45 posts
  • OFFLINE
  •  
  • Local time:03:09 AM

Posted 18 May 2008 - 02:21 PM

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?

#5 KoanYorel

KoanYorel

    Bleepin' Conundrum


  • Staff Emeritus
  • 19,461 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:65 miles due East of the "Logic Free Zone", in Md, USA
  • Local time:03:09 AM

Posted 18 May 2008 - 02:22 PM

Ooops, I forgot to note that once another reply has been made, you also lose the edit function. Sorry about that.
The only easy day was yesterday.

...some do, some don't; some will, some won't (WR)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users