473,405 Members | 2,210 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.

Multiple functions in a single DLL

I need to make dll file for computing user defined function in Lindo Lingo. I need to implement two new functions, but I can make only one myuser.dll file for use in Lingo.
But, talking with people from Lindo, it is possible to make two argument myuser.dll function, with first first argument as a "branching" variable. for example, For example,
@USER( 1, 2.4)
might compute the sin of 2.4, while
@USER( 2, 2.4)
would compute the cosine of 2.4. The first argument of 1 implies return the sin, while a first argument of 2 implies return the cosine.

My question is how to do that, because I am new to Vc++.
Thanks in advance,
Aleksandar
May 27 '11 #1
1 2506
weaknessforcats
9,208 Expert Mod 8TB
I would not do a branching argument.

What you do is create a VC++ project to create your DLL.

This project will produce your DLL plus a .LIB.

Next create a second VC++ project for your application.

Now comes the fun.

If you want to call your DLL functions as though they were C functions, then set the project properties of your application to include the name of the .LIB in your DLL project. PLus add the path to the LIB so your linker can find it.

Next, you ave to turn the C++ name mangler OFF for the functions in your DLL that will be called from your application. Make these extern "C" in the DLL project. That;s becuase te functions will be called by name as a string argument in GetProcAddress so that name better the same as the function inisde he DLL.

What the .LIB does is contain a phony function of the same name and arguments as the the function in the DLL. This phny functions calls LoadLibrary to load your DLL plus a call to GetProcAddress using the function name.

If you want to call LoadLibrary yourself followed by GetProcAddress then you do not need to add the .LIB to your application project.

Lastly, consider getting a copy of Windows via C/C++ by Jeffrey Richter where this is explained in great detail.
May 28 '11 #2

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

Similar topics

5
by: Mike | last post by:
I have some code I am working on. One function reads a file using fso, then I have multiple functions using the string read from the file. Each function splits the lines up and will return one...
10
by: reynoldscraigr | last post by:
Hi All, I am trying to call 2 functions from the 1 onMouseOver event on an anchor tag, but I can't seem to get it to work. the following should demonstrate <a...
3
by: Disco-181 | last post by:
Hi, I have a script which isn't working in Mozilla based browser for some reason. I'm trying to run two functions from the body onload tag and it simply isn't happening. I have a cascading...
3
by: d.schulz81 | last post by:
Hi all how can i manipulate a multiple select into a single select dropdown field with JavaScript? thanks
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user...
2
by: Wei Wang | last post by:
Hi, Can I call multiple functions in one trigger? Something like this: CREATE TRIGGER match_cond_name_generate BEFORE INSERT OR UPDATE ON public.predicate_index FOR EACH ROW EXECUTE...
13
LacrosseB0ss
by: LacrosseB0ss | last post by:
I was wondering, can an OnClick event of a button call multiple functions? The reason for this is I have a page that when "ok" is clicked, goes to a preview page before submitting data to the...
7
by: pronerd | last post by:
Does any one know how to add a function to an event handler with out losing the current event handler? For example you can add multiple functions to a single event handler with something like : ...
3
by: Harshpandya | last post by:
<form action="?= $postUri ?>" method="post" onSubmit="return verifyInput();" onReset="setTimeout('toggleDHCP()',100) setFormDisabled(true);"> In this code - i want to pass multiple functions...
1
by: su817200 | last post by:
Dear Friend, I would like to run multiple functions on Button Click eg... <input type="button" value="Update" name="B1" onclick="ReadFileToString() timedRefresh(1500)"></p> It is giving...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
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...

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.