|
| ||||||||||
| Tags: c plus plus, dll file, exe file, global variable, visual basic |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Exporting or importing global variables from a DLL to an EXE
|
|
#2
| |||
| |||
| Re: Exporting or importing global variables from a DLL to an EXE
Yes it is possible to share global variable between DLLs and exe fil. We know that, one can implement global variables by using programming languages such as C and C++. Hence you need write a code to achieve it. normally global variable is declared and implemented outside of the functions. However this particular variable exist inside the same scope into the single program. I let you know that |
|
#3
| |||
| |||
| Re: Exporting or importing global variables from a DLL to an EXE Quote:
|
|
#4
| |||
| |||
| Re: Exporting or importing global variables from a DLL to an EXE
Even you can do the same thing with class as well. you can use dllexport to export class to dll or function. To get better results you should take care of the thing that exe and dll are running into single process. However if needed you can simply place class to other dll file as well. if you are using C language then I recommend to do following steps. First of C wrapper API. After that use following Win32 API functions.
Now you should create proxy class into DLL which will call variable from exe to dll. |
|
#5
| |||
| |||
| Re: Exporting or importing global variables from a DLL to an EXE
There are huge differences between external and exported variables. External variables are available in programming era from the days of C programming language. In simple terms we can say exported variables are extensions of Windows OS. I would recommend that one should make use of thread local storage. In my opinion file paths would not work particularly I am saying about global variables. API should be used to pass data to the function. To avoid issues, you should not use directly from memory. Why I am saying, the thing global variable can be accessed by any part of the program. So global variable and programming language like VB might be using same DLL, hence some sync should be done between the same. |
|
#6
| ||||
| ||||
| Re: Exporting or importing global variables from a DLL to an EXE
As far as I know global variable should be set to single process. Normally it is initialized to every single module of the program. If you are using C++, then you will get the requirement of yours by using __declspec and __declspec. After that you will be able to export or import file through dll and exe. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Exporting or importing global variables from a DLL to an EXE" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need settings for importing/exporting from imovie | Character | Windows Software | 6 | 31-05-2010 02:45 PM |
| How To Store Global Variables? | ramsun | Software Development | 5 | 03-03-2010 11:54 AM |
| Global Variables in C sharp | Harper 21 | Software Development | 5 | 20-01-2010 07:43 AM |
| Java bans Global Variables | KALLIYAN | Software Development | 4 | 10-11-2009 03:17 AM |
| Exporting and importing data | Humberto | Tips & Tweaks | 2 | 13-10-2008 06:07 PM |