473,378 Members | 1,541 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,378 software developers and data experts.

c++ DLL get parameters

Hi All,

first time building a DLL not to mention C++ program and I'm having a little trouble trying to get the parameters passed to it.

I'm using VC++ 6.0. I created this via a 'Regular DLL using shared MFC DLL'

Upon running it basically creates an application class, then creates a dialog box. This piece works!

Now, I need to pass it three parameters to use though out the program, do I create a new method within the application class to grab these values? (If so can someone give me some example on what I need in this method) Or have I gone the wrong way in trying to build this? All examples I have read are fairly simple DLLs with functions, mine is based on classes.

Any help would be greatly appreciated
Hayden
Jun 7 '07 #1
2 2916
mac11
256 100+
Hi All,

first time building a DLL not to mention C++ program and I'm having a little trouble trying to get the parameters passed to it.

I'm using VC++ 6.0. I created this via a 'Regular DLL using shared MFC DLL'

Upon running it basically creates an application class, then creates a dialog box. This piece works!

Now, I need to pass it three parameters to use though out the program, do I create a new method within the application class to grab these values? (If so can someone give me some example on what I need in this method) Or have I gone the wrong way in trying to build this? All examples I have read are fairly simple DLLs with functions, mine is based on classes.

Any help would be greatly appreciated
Hayden

I'm not sure if I understand the explanation of your setup. You have an application (that you built) which uses a dll (which you also built), and inside the dll is a class? And you want to know how your application can supply data to the class inside the dll? -- I assume these are true in my response

A dll is just a library that the system loads for you at runtime. You just use what's in it. So if the dll holds a class you just use the class. The way you supply parameters to the class from the dll depends on the methods supplied by the class. If your class does not provide methods accept the data you want to send you will have to add methods to your class.
Jun 7 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
Upon running it basically creates an application class, then creates a dialog box. This piece works!
If I understand you correctly, the application class and the dialog are working from inside the DLL. Yes?

If so, just write a function to acquire the arguments you need. Make sure it is extern "C" to turn off the mangler. Have that function locate your apoplication class obejct and call methods on it to set the arguments into the application.
Jun 7 '07 #3

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

Similar topics

7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
2
by: Mark | last post by:
I created a test to check the execution time difference between executing a SQL Server stored procedured using explicit parameters versus not. In one case I created new SqlParameters in the code,...
4
by: Tim::.. | last post by:
Can someone tell me a better way or give me a link that shows a better way to create large numbers of SQL parameters... Example... A better way to write this code! <code> Sub...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
12
by: pamelafluente | last post by:
Hi guys, In the past I have used several time optional parameters in my function. But Now I am more inclined to think that they are more dangerous than useful, and probably better to be...
1
by: John Kotuby | last post by:
Hi all, I am working on porting an application from VB6 to VB.NET 2003 and am running into some problems. When declaring and populating the parameters for a SQL Stored Procedure by using the...
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
2
by: Jared Grant | last post by:
I am trying to find the value from some output parameters from a stored procedure. I have tried several different methods but somehow cannot get it to work. here is my source code: dim dr as...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.