Jump to content


c++ DLL get parameters


1 reply to this topic

#1 ill_comms

    New Member

  • Members
  • Pip
  • 1 posts

Posted 07 June 2007 - 08:21 AM

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

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 07 June 2007 - 04:37 PM

Normally a DLL does not do anything autonomously, but just contains a collection of routines and classes to be called upon by the main application. So, the main application should call some function of the DLL, passing whatever parameters are needed, or the application should instantiate some class, in which case it can pass parameters to the constructor.

If you are creating your objects from the DLL's entry point (LibMain or DllMain), you should move those to a separate initilization function that is called from the application.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users