How to call function in DLL (for B3D) from SDK?

Archives Forums/Blitz3D SDK Programming/How to call function in DLL (for B3D) from SDK?

MeowZ(Posted 2007) [#1]
I have compiled demo dll which was use with B3D. I want to import that DLL to C++ and use with SDK. I don't know how to import them and call the functions with parameter(s). Anyone could kindly show me the sample code? Thanks so much.

* Actually I try to implement FastImage with SDK, I did converted .decl to .h, I have FastImage.dll but do not know how to call them. - -"

Please help,


SopiSoft(Posted 2007) [#2]
Here's an example:
http://www.goffconcepts.com/techarticles/development/cpp/calldll.html


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


ZJP(Posted 2007) [#4]
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);
   }
}



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

http://www.blitzbasic.com/codearcs/codearcs.php?code=2056


MeowZ(Posted 2007) [#6]
Thanks so much ZJP,
Now I stuck with SystemProperty("Direct3DDevice7") which the SDK does not have it. and I tried several ways to get that pointer. Unfortunately, I can't find a way to do that. Hope BSL can help. T____T.