Jan 30th, 2002, 03:43 PM
#1
Thread Starter
Fanatic Member
using a DLL
i have a DLL i wanna use, i think i remember seeing a way of adding the DLL sorta like a header file..do you guys know (u prolly do )
i wanna use "icmp.dll" in the windows dir..i dont wanna go through and have to use MFC to use the ping stuff
thanks
-nabeel
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Jan 30th, 2002, 04:05 PM
#2
Member
This is a sample from MSDN and may be what you're looking for...
Note that the code is not complete and will not run, but you can adapt it into your program. Look at the documentation for LoadLibrary for more info.
PHP Code:
typedef UINT ( CALLBACK * LPFNDLLFUNC1 )( DWORD , UINT );
.
.
.
HINSTANCE hDLL ; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1 ; // Function pointer
DWORD dwParam1 ;
UINT uParam2 , uReturnVal ;
hDLL = LoadLibrary ( "MyDLL" );
if ( hDLL != NULL )
{
lpfnDllFunc1 = ( LPFNDLLFUNC1 ) GetProcAddress ( hDLL ,
"DLLFunc1" );
if (! lpfnDllFunc1 )
{
// handle the error
FreeLibrary ( hDLL );
return SOME_ERROR_CODE ;
}
else
{
// call the function
uReturnVal = lpfnDllFunc1 ( dwParam1 , uParam2 );
}
}
Jan 30th, 2002, 05:15 PM
#3
Thread Starter
Fanatic Member
thanks...ill play around with it and see if i can get it to work
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Jan 30th, 2002, 05:29 PM
#4
Monday Morning Lunatic
Try this
Attached Files
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Jan 30th, 2002, 09:02 PM
#5
What can be exported from a DLL?
Jan 30th, 2002, 09:21 PM
#6
Fanatic Member
Originally posted by chilibean
PHP Code:
typedef UINT ( CALLBACK * LPFNDLLFUNC1 )( DWORD , UINT );
What does this line do?
Alcohol & calculus don't mix.
Never drink & derive.
Jan 30th, 2002, 09:24 PM
#7
It is defining the type of LPFNDLLFUNC1... which happens to be a pointer to a function which returns an UINT and recieves a DWORD, and a UINT... which also uses the calling convention CALLBACK ( not sure what this macro is defined as )
Jan 31st, 2002, 08:02 AM
#8
Thread Starter
Fanatic Member
thanks parksie
but i get these errors:
c:\program files\microsoft visual studio\vc98\include\icmpapi.h(148) : error C2061: syntax error : identifier 'IPAddr'
c:\program files\microsoft visual studio\vc98\include\icmpapi.h(237) : error C2061: syntax error : identifier 'IPAddr'
any ideas? i added "icmp.lib"
i get it at
PHP Code:
DWORD
WINAPI
IcmpSendEcho (
HANDLE IcmpHandle ,
IPAddr DestinationAddress ,
LPVOID RequestData ,
WORD RequestSize ,
PIP_OPTION_INFORMATION RequestOptions ,
LPVOID ReplyBuffer ,
DWORD ReplySize ,
DWORD Timeout
);
Last edited by nabeels786; Jan 31st, 2002 at 08:08 AM .
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Jan 31st, 2002, 12:56 PM
#9
Monday Morning Lunatic
Try this - you'll need windows.h as well.
Attached Files
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Jan 31st, 2002, 05:15 PM
#10
Thread Starter
Fanatic Member
still no luck
still says
c:\program files\microsoft visual studio\vc98\include\icmpapi.h(150) : error C2061: syntax error : identifier 'IPAddr'
windows.h, the header you gave me is also added.
i downloaded the platform sdk also to see if that maybe had it, no luck
any other ideas?
thanks
-nabeel
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Jan 31st, 2002, 05:22 PM
#11
Monday Morning Lunatic
Do a full-text search in your PSDK include folder to find where it is - it's definitely defined somewhere because I found it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Jan 31st, 2002, 07:24 PM
#12
Thread Starter
Fanatic Member
nope, couldn't find it
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Jan 31st, 2002, 07:33 PM
#13
Thread Starter
Fanatic Member
ahh nevermind, found it..
all that trouble for
PHP Code:
typedef ULONG IPAddr ; // An IP address.
pfft
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Feb 1st, 2002, 12:34 PM
#14
Monday Morning Lunatic
Somebody kick MS
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width