|
-
Dec 15th, 2003, 10:27 PM
#1
Thread Starter
Addicted Member
importing functions from DLL and making them global
I'm trying to import function from a DLL and make them global in my application. I can import them into one .cpp file, but then how do I let all the other files access the same functions? I can't make them external from within the .cpp. Do I have to import them into every single .cpp individually?
-
Dec 15th, 2003, 10:40 PM
#2
You can import them within a header file I think..... then again I never use DLLs
-
Dec 15th, 2003, 10:44 PM
#3
Thread Starter
Addicted Member
I don't want to use an import library though, so I have to import them from within a function.
-
Dec 16th, 2003, 10:35 AM
#4
Member
Hi friend,
In a function import the function. Include the file where required. Call the function when required.
I think its easy.
Try and tell me if it happens..
-
Dec 17th, 2003, 03:44 AM
#5
If you mean by GetProcAddress, you can make the function pointer you assign to global across all files. E.g. for UpdateWindow:
Code:
main.cpp:
void (WINAPI *ptrUpdateWindow)(HWND);
// Later:
ptrUpdateWindow = GetProcAddress(...);
some.h:
extern void (WINAPI *ptrUpdateWindow)(HWND);
and you can use it everywhere you include some.h.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 17th, 2003, 05:48 PM
#6
Thread Starter
Addicted Member
thx, i think thats exactly what i want.
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
|