import DLL to C++, please help.

Archives Forums/Blitz3D SDK Programming/import DLL to C++, please help.

MeowZ(Posted 2007) [#1]
How can I import userlibs DLL for B3D to use with SDK in C++? Anyone can post a sample here?

Thanks so much,


MeowZ(Posted 2007) [#2]
for example, I want to use FastImage with SDK and C++. Is it possible to do that? The SDK cannot blend image which is loaded with bbLoadImage(), result in jaggy image. Thank you.


Kanati(Posted 2007) [#3]
most likely possible. Contact whoever wrote the dll and see if he/she has a header file for the dll.


REJLA(Posted 2007) [#4]
follow the link

http://msdn2.microsoft.com/en-us/library/ms684175.aspx

you must know the functions name, type and parameters in order to use it


MeowZ(Posted 2007) [#5]
Hi,

I have function's name, type and parameters declare in *.decl which come with .DLL to use with Blitz3D. The problem is, there is an InitDraw function which call SystemProperty("Direct3D7") to get access to Direct3D. but in SDK we don't have SystemProperty function. Anyone can help me out? Thank you.


ZJP(Posted 2007) [#6]
+1
Convert a .decls file to a "include.h" file is THE great solution for all Blitz3d wrappers. Somebody save us ;-)

JP


ZJP(Posted 2007) [#7]
I'm found a solution. The Explicitly Dll calling
http://msdn2.microsoft.com/en-us/library/784bt7z7
(VS.80).aspx
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);
   }
}



MeowZ(Posted 2007) [#8]
Thanks so much ^^


ZJP(Posted 2007) [#9]
How to convert the Blitz3D DECLS
http://www.blitzbasic.com/Community/posts.php?topic=70890