View previous topic :: View next topic |
Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 27, 2008 10:27 am Post subject: |
|
|
did you make the function a
__declspec(dllexport)
and did u include a .def file including
EXPORTS
FunctionName
etc.
_________________
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Apr 27, 2008 10:54 am Post subject: |
|
|
oh so i'll change the function to __declspec(dllexport)
but what is the thing about the .def including ? what's that file ?
_________________
Stylo |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 27, 2008 11:15 am Post subject: |
|
|
before the function type you put __declspec(dllexport)
for example:
__declspec(dllexport) void Function(void)
{
//...
}
The file is called a "Module-Definition File (.def)"
it'l be in the code section.
it allows you to define the Library name, exports, etc.
_________________
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Apr 27, 2008 2:30 pm Post subject: |
|
|
What IDE / compiler are you using?
_________________
- Retired. |
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Apr 27, 2008 9:13 pm Post subject: |
|
|
visual studio 2008
_________________
Stylo |
|
Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 28, 2008 12:25 am Post subject: |
|
|
file>new file>.def file>add to project, or something like that,i think
_________________
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Apr 28, 2008 12:32 am Post subject: |
|
|
that's the files i can add to my project (view attachment)
as you can see no .def
Description: |
|
Filesize: |
32.98 KB |
Viewed: |
4739 Time(s) |

|
_________________
Stylo |
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Apr 28, 2008 5:38 am Post subject: |
|
|
Just create a notepad and change the extension to .def... then add existing item.
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Apr 28, 2008 5:46 am Post subject: |
|
|
Symbol wrote: | Just create a notepad and change the extension to .def... then add existing item. |
ok i created .def file through the notepad and it looks like that:
Code: |
EXPORTS
addNums(int x, int y);
|
is that good?
_________________
Stylo |
|
Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Apr 28, 2008 5:55 am Post subject: |
|
|
There's 2 method i know.
.h file
.def file
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Apr 28, 2008 6:00 am Post subject: |
|
|
1qaz wrote: | Symbol wrote: | Just create a notepad and change the extension to .def... then add existing item. |
ok i created .def file through the notepad and it looks like that:
Code: |
EXPORTS
addNums(int x, int y);
|
is that good? |
just addNums no parameters.
_________________
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Apr 28, 2008 6:08 am Post subject: |
|
|
lurc wrote: | 1qaz wrote: | Symbol wrote: | Just create a notepad and change the extension to .def... then add existing item. |
ok i created .def file through the notepad and it looks like that:
Code: |
EXPORTS
addNums(int x, int y);
|
is that good? |
just addNums no parameters. |
can you upload an example for doing this because i put the function name without the parameters and still errors and other stuff..
i think the best is that i'll see the whole code
_________________
Stylo |
|
Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Apr 28, 2008 6:13 am Post subject: |
|
|
make a .def file and insert:
Code: | LIBRARY <DLL NAME>
EXPORTS
<FUNCTION YOU WISH TO EXPORT>
|
then, include it in the resource folder (at MSVC++ 2k8)
rebuild sulotion in Release mode
|
|
Back to top |
|
 |
|