| | |
DLL Function Call
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 25
Reputation:
Solved Threads: 0
Hello !!!!
I'm callind a form from Dll it works jut pirfect, but i have no idea how it works, so now i need to add parameters to the function,so i can pass some parammeters to the form, and have no idea how to do this, any one can help??
in line 3 is set the dll file name, in line 4 is set the function thet is defined and implemented in the dll file, it is a void MyFunction() now i need to run the same function but with parammeters, like void MyFunction(AnsiString A, TIBTable* IBTable1), how do i do this???
I'm callind a form from Dll it works jut pirfect, but i have no idea how it works, so now i need to add parameters to the function,so i can pass some parammeters to the form, and have no idea how to do this, any one can help??
C++ Syntax (Toggle Plain Text)
{ 1 typedef void (*CALLEDFUNCTION) (TComponent* Owner); 2 CALLEDFUNCTION DllFunctionPtr; 3 AnsiString fDllName = "MyDll.dll"; 4 AnsiString fFunctionName = "MyFunction"; 5 AnsiString fMessage; 6 char fDllNameStr[50]; 7 strcpy(fDllNameStr, fDllName.c_str()); 8 HINSTANCE DLLInst = NULL; 9 DLLInst = LoadLibrary(fDllNameStr); 10 if (DLLInst) { 11 DllFunctionPtr = (CALLEDFUNCTION) GetProcAddress(DLLInst, unctionName.c_str()); 12 if (DllFunctionPtr) DllFunctionPtr(this); 13 else { 14 fMessage = "Could not obtain pointer for function"; 15 fMessage += fFunctionName; 16 fMessage += " in DLL "; 17 fMessage += fDllName; 18 } 19 } 20 else { 21 fMessage = "Could not load DLL "; 22 fMessage += fDllName; 23 Edit1->Text= fMessage; 24 } 25}
in line 3 is set the dll file name, in line 4 is set the function thet is defined and implemented in the dll file, it is a void MyFunction() now i need to run the same function but with parammeters, like void MyFunction(AnsiString A, TIBTable* IBTable1), how do i do this???
![]() |
Similar Threads
- How Do I . . . Make a Class Accessible from a DLL (C++)
- DLL problem in Borland C++ (C++)
- Calling c++ dll in vb (Visual Basic 4 / 5 / 6)
- C# DLL's (C#)
- DLL and Application (C++)
- Dll Library Function loading (Visual Basic 4 / 5 / 6)
- How can i write VC++ Dll to call in VB (C++)
- HELP~! how to call Matlab function in C#? (C#)
- Export Obejct from DLL (C++)
- putting the address of a function pointer into a struct (C)
Other Threads in the C++ Forum
- Previous Thread: Average and sum with array
- Next Thread: C++ how to create this program?
Views: 708 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project python random read recursion recursive reference return sort stream string strings struct studio system template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






Now you will easily remember that the next time you encounter that problem. 