473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DLL links to modified function???

I created DLL that it includes Bryan() function, but
Bryan2() function is defined outside DLL so function
pointer is created. I tried to tell DLL that function
pointer should be declared, but not defined. The problem
is that error linkage message says unresolved linkage to
function pointer so I decided to define it by adding zero.
Bryan2() function is defined in EXE's source code.
main() function is able to access pBryan() to retreive
memory address inside DLL. I attempt to duplicate
Bryan2() function into pBryan(), but it seems that EXE
can't link to pBryan() in DLL.
I believe that it may be two duplicated pBryan().
One is in DLL. Another is in EXE.
If you run, you will get error exception message,
it is because pBryan() inside DLL is never modified
that it is always equals to zero.
I want all unmodified functions in DLL while they
can be linked to modified functions in EXE. Please
take a look at my code below so it gives you your idea.
Please explain what is __declspec(dllimport). I
believe that it is only declaration. Should I use it
in EXE source code while __declspec(dllexport) is
always used in DLL.

/* Header for DLL */
#ifndef _DLLTEST_H_
#define _DLLTEST_H_

extern "C" __declspec(dllexport) void Bryan();
extern "C" __declspec(dllexport) void (*pBryan)(void) = 0;

#endif

/* Source Code for DLL */
#include "dlltest.h"

extern "C" __declspec(dllexport) void Bryan()
{
printf("Hello, this is Bryan.\n");
pBryan();
}

/* Source Code for EXE */
#include "dlltest.h"

void Bryan2()
{
printf("Hello, this is Jon.\n");
}

void main()
{
void (*pBryan)(void) = Bryan2;
Bryan();
}
Jul 22 '05 #1
1 1046
"Bryan Parkoff" <Br**********@yahoo.com> wrote in message
news:d5*************************@posting.google.co m...
I created DLL that it includes Bryan() function, but


[snip]

Your question is unrelated to the standard C++ language. This might point
you in the right direction:
http://www.slack.net/~shiva/welcome.txt

DW

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Fine | last post by:
I would like some guidance regarding a "content scanner" I'm trying to build. This ASP widget will automatically scan remote web sites for certain kinds of content using a screen scraping component...
2
by: chris hughes | last post by:
Can anyone please tell me how to create a javascript that I can place in any page that will disable all the links or just change all the hrefs to # Many Thanks Chris Hughes
12
by: magmike | last post by:
When users of my site submit articles to our database (http://www.netterweb.com/articles/) they almost always have http:// addresses within the text. They are pasting that text into a box which...
4
by: Brian Watkins | last post by:
Hello All, I have a a file display page that contains two frames. In the left frame is a tree view that lists a directory and all its subfolders. Each node in the left frames tree is a link...
16
by: namemattersnot | last post by:
re, I have the following problem: links containinig cyrillic characters do not display by the javascript. server-side PHP script encodes them with rawurlecode() function and everything works...
3
by: John Nagle | last post by:
Are weak refs slower than strong refs? I've been considering making the "parent" links in BeautifulSoup into weak refs, so the trees will release immediately when they're no longer needed. In...
3
by: Gretsch | last post by:
Web, html, javascript, Hi, I need to calculate the time since this .htm file was last modified. {which I can then use in a calculation, rather than display, so days&decimals format would be OK}...
2
iam_clint
by: iam_clint | last post by:
/*###############################*/ /* Link fade script by iam_clint, bytes.com */ /* www.bytes.com, If you use this script on your site */ /* Please keep this comment at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.