Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Making a window .dll

Author
Message
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 1st Jul 2005 01:39
I guess I stumped you.
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 1st Jul 2005 02:41
Send me the hold project in a zip, I'll sort it

( Sorry: forgot about the post )

Email's Checked every 10 Minutes..
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 1st Jul 2005 03:00
Wow! Thanks, I can't believe you would do that. Don't be sorry!!!

Attachments

Login to view attachments
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 1st Jul 2005 03:05 Edited at: 1st Jul 2005 03:06
Here, Things you did not do...:

1.) Have globalStruct.h in the same folder...
2.) Did not set Direct X sdk root/include as a include directory
3.) Needed to change g_pGlob->hwnd to , g_pGlob->hWnd ( My bad )

---- Files ----
Attached - >>>>

(edit: Oh yeah.. Goto Project Options and Change the include to your DX root )

Email's Checked every 10 Minutes..

Attachments

Login to view attachments
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 1st Jul 2005 03:20
I decided to put globstruct.h in my include directory so that I wouldn't have to copy it to all my progects. Anyway thanks Eddie B you were a great help. I could kill myself for not seeing that W uncapitalized (Still too used to BASIC where caps don't matter).
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 1st Jul 2005 03:39
Does it work for you then?

Email's Checked every 10 Minutes..
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 1st Jul 2005 04:25 Edited at: 1st Jul 2005 04:32
It compiled good I am just having a little trouble fining the decorated name in the dll, I can find it in my other dlls. Is there some other way to get it other than by looking at the dll in notepad?
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 1st Jul 2005 06:35
Meh, I dont bother with them, I just do:

What you want it to be called via%LLS%functionname
^^^ - Only an example - ^^

L=int
S=String

and if it returns a value , To be called[%LS or what ever%functionname

Email's Checked every 10 Minutes..
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 2nd Jul 2005 02:17 Edited at: 2nd Jul 2005 08:08
That is what I do but you still need the decorated function name. I can usually find it in notepad but now the name I find and use in the stringtable doesn't work. If it helps this is the name I keep finding _clswndw. I know it should be _Z4clswndwv but that doesn't work either
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 2nd Jul 2005 14:36
he is using devc++ u msvc++ idiots

devc++ is a bit different in a lot of ways

sorry if this is a bit over your head but look here http://forum.thegamecreators.com/?m=forum_view&t=55616&b=18
and look at http://forum.thegamecreators.com/?m=forum_view&t=55588&b=18

Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 2nd Jul 2005 18:13
Quote: " he is using devc++ u msvc++ idiots"


I use DevC++

Email's Checked every 10 Minutes..
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 2nd Jul 2005 23:48
have u not noticed that devc++ doesnt export the same way msvc does then

Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 3rd Jul 2005 02:01 Edited at: 3rd Jul 2005 02:03
So I just have to add a def file right? When I make my stringtable do I use _clswndw or _Z4clswndwv ? (I found _clswndw in notepad)
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 4th Jul 2005 04:10
I tried both and neither worked.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 4th Jul 2005 05:54
ummm
ok this would be .def

and stringtable


Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 4th Jul 2005 07:27
I made a def file called Progect1.def, Inside I typed
, I opened up DevC++, opened progect options, used the Parameters tab, under Linker I typed -Progect1.def, I typed Closew%0%mynickname as my stringtable, and in DBP I typed Closew. What is wrong?
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 4th Jul 2005 08:07
hmmm
hmmmmmmmmmmmmmm hmmmmmmmmmmmmmmmmm
what is the error(exactly)
if it says closew isnt found then make sure u copied it to plugins-user and also another thing u should try is try CLOSEW in your stringtable as i think everything must be capitalized except for your c/c++ function name(C/C++ is case sensitive also so check that)

Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 4th Jul 2005 08:31
I tried what you said and still got the same error. The error being that it can't find mynickname. (I can't find mynickname in notepad which leads me to believe that Dev isn't compiling the def file for some reason)
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 4th Jul 2005 10:10
I figured out part of the problem in the linker box I typed -Progect1.def when I should have typed --def Progect1.def . My DevC++ compiler now gives me this error
. So do you know what is wrong?
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 4th Jul 2005 12:49
ummm in your stringtable change your paremeters i didnt realize it was like that
and i have no idea what that means are u sure your that the case is right afterall c/c++ is case sensitive

Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 5th Jul 2005 02:07
I checked my stringtable, it is fine. This error is coming from my C++ compiler not my dbp compiler though.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 5th Jul 2005 15:08
__int128
that dont quite make sense
hmmm
i have no idea

n00bs will be shot on spot...
i need some more ammo there are just too many of them better call in the moderators to help
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 6th Jul 2005 02:30 Edited at: 6th Jul 2005 02:40
It doesn't make sense to me either since my function recieves and returns void. Can anybody else make sense of it? Here is my whole progect if it helps.(Something wierd to look at is the first time you compile, it gives you a different error than the second time.)

Attachments

Login to view attachments
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 6th Jul 2005 13:32
to start this
#include <globstruct.h>
should be
#include "globstruct.h"

COMMAND void ReceiveCoreDataPtr (LPVOID _Core)
{

g_pGlob=(GlobStruct*)_Core;
Core = GetModuleHandle("DBProCore.dll");

}

i dont have that in my code and it works fine, i think it might be declared in globstruct.h

extern "C" {
try not using that and see what it does

COMMAND void clswndw( void )

is command defined in globstruct?

thats all i can see that could possibly be wrong

n00bs will be shot on spot...
i need some more ammo there are just too many of them better call in the moderators to help
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 7th Jul 2005 02:13
I have globstruct in my include directory so it globsruct has to have the <>. You can't take out the recievecoredataptr function (I tried). Taking out extern "C" { does nothing.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 7th Jul 2005 02:44
hmmm seems i commented that out oops u do need recievecoredataptr
try this source code/project if this code dont compile then try reinstalling or updating devc++ if there is anything new out

btw
this contains dbpstring function so u can instead of doing tons of compilicated junk to return a string u can just say return dbpstring("hello world!");

n00bs will be shot on spot...
i need some more ammo there are just too many of them better call in the moderators to help

Attachments

Login to view attachments
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 7th Jul 2005 10:25
All the fuctions in that dll worked, but when I used my function I got the same error. I have now figured out the only thing wrong is the decorated function name in the def file, how am I suppose to get it?
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 7th Jul 2005 12:47 Edited at: 7th Jul 2005 12:49
open it in notepadand look, it should have a _Z(number) at the first
edit:
wait!
if u use extern "c" then use the unmangled function name

n00bs will be shot on spot...
i need some more ammo there are just too many of them better call in the moderators to help
Black Shadow
19
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 8th Jul 2005 01:44
So that is what is so special about extern "C". Everything works great thanks.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 8th Jul 2005 08:50
so now it works since u use extern "c" and the unmangled function name

extern C uses the C dll export method rather than c++ and C dont have mangled names

n00bs will be shot on spot...
i need some more ammo there are just too many of them better call in the moderators to help

Login to post a reply

Server time is: 2024-04-27 13:32:16
Your offset time is: 2024-04-27 13:32:16