473,508 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link between a dll and an exe..

2 New Member
hi,
i have a dll written in C language
and have some global variables.

If i connect the dll from an exe, and applying some operations like addition, multiplication on the global variable and completd the operation
then again in the same exe, may be somewhere i am again calling the dll and using addition...
but in the second time i couldnt get the initial value for the global variables. the value will be the last performed operations result value.
so how can i initialize the variable whenever i call the dlll functions?

and if use dll, we need their .lib files also?
why we need this .lib file?
please clarify my doubts..
Oct 20 '06 #1
1 1491
Banfa
9,065 Recognized Expert Moderator Expert
First in answer to
and if use dll, we need their .lib files also?
why we need this .lib file?
please clarify my doubts..
The .lib is used when you link you exe file, that is the only time it is needed it provides vectored calls(i.e. non-direct) to the functions in the DLL.


Onto your problem, the memory in a DLL appears in your programs EXE virtual memory address space. If you want the global variables inside your DLL reinitialised under certain conditions then you will have to provide a function to perform that task.

If you want them reinitialised everytime you call the function that uses them then you probably shouldn't be using global variables since you are using them in a local context. Use of global variables like that makes the library functions non-reentrant.
Oct 21 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
17067
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited...
26
3815
by: Harrie | last post by:
Hi, After Brian mentioned the use for <link rel=..> for navigational purposes in another thread, I've been looking into it and found that HTML 3.2 has two other recognized link types than HTML...
4
4075
by: Franklin | last post by:
WITHOUT KNOWING ANYTHING ABOUT THE CURRENT COLORS, I want to swap the foreground/background colors of a link when someone hovers over it. Is this possible with HTML, CSS, DOM, & JavaScript? If...
8
4156
by: sudhirlko2001 | last post by:
How to swap two nodes of doubly Linklist
14
2804
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
1
2072
by: sri2097 | last post by:
Hi all, I have written a Link list implementation in Python (Although it's not needed with Lists and Dictionaries present. I tried it just for the kicks !). Anyway here is the code - # Creating...
8
2429
by: Steve | last post by:
Hi; I had a big link checking job to do and it has been years since I have done anything like that so I found a test page to use that I knew had bad links on it( a friends site ) and I decided...
7
1946
by: gehegeradeaus | last post by:
Can someone help me to make a regular expression for this sort of replacement : text with {link:pagehref}a link{/link}. replace to -> text with <a href="pagehref">a link</a> I tried...
7
13471
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect(...
4
1828
by: perryche | last post by:
Is this possible? Instead of using the link wizard, can the FE/BE link be established any other way that users can simply type the link path? Thanks, Perry
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.