Link to home
Start Free TrialLog in
Avatar of Shay050799
Shay050799

asked on

DLL

hi All,
i have a DLL and the H files, but i do not have the Lib, how can i link this Dll into my VC++ project.
the dll project never created a library...
is it posible ?

Shay
ASKER CERTIFIED SOLUTION
Avatar of migel
migel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ulischmidt
ulischmidt

Hi

Also a possibility is linking the dll at runtime:

in your class where you want to use the dll declare member variables for the functions, e.g.

BYTE (__stdcall* m_lpMyFunction)(int);


.... and a handle for the dll:

HINSTANCE m_hDllInstance;

in your cpp file implement the following (best in the class constructor):

m_hDllInstance=AfxLoadLibrary("YourDll.dll");
if(m_hDllInstance)
{
    m_lpMyFunction=(BYTE (__stdcall*)(int msg))GetProcAddress(m_hDllInstance,"FunctionNameInDll");
}
else
{
    AfxMessageBox("Can't load DLL!");
}


Just look for your .h file of the dll for the correct function definitions
I perfer to use the LoadLibrary() fnunction calls;
In the 'Link' tab of the 'Project Settings' dialog for the calling program, in the 'Object/library modules edit control you must add the full path for the .LIB file.  You said you did not get a .LIB soooo.... if you will send me your EMAIL address (I'm millercg@teleport.com) and I will send you two projects; one for a working 'Caller' and one for a DLL that it will call.

christophm (millercg@teleport.com)
Shay----->  You have asked 95 questions at this site, and only awarded 53 of them....  this is totally against the Guidelines of this site.  Please return to them and update/finalize them this week.  The list is below.  Of these 53 awarded, there are 7 questions that are -1 user id problems which we will need to manually correct.  Please accept the first correct response in each of them and award the experts who helped you with the deserved "A" grade, or comments if less than an A as to why.  If you need our help to special handle any of these, let us know that as well via comment here.  If these are not finalized this week, I will contact Administration for further action.  Please click the HELP DESK link on the left for the rules of engagement here (Guidelines, Member Agreement and Question/Answer process).

I also noticed that a number of your questions are less than 50 points, which is the recommended value for EASY questions, with 300 points the maximum.  To draw additional attention, you can always increase their values without our assistance.

https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20229485
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20123800
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20121605
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20120473
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20110164
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20109749
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=20077855
https://www.experts-exchange.com/jsp/qShow.jsp?ta=wince&qid=12019739 November, 2000, zero comments added, 5 points.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=11169491 November, 2000 ZERO points, comments added
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20135373
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20133207
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20115081
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20103624
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20102120
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20100568
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20088761
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20076668
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=11536619 October, 2000 - 15 points
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=12014539  November, 2000
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=11990378      "
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=11863978      "
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20223052
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20220148
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20149200  July, 2001 - 5 points
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20148518    "      - 10 points
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20138848
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20137234
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20132473
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20132221
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20122930  May, 2001 5 points
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20121466  May, 2001 0 points
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20094887
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20094102
https://www.experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20067934

I have asked Administration to Email you in these regards.  I also noticed several other things I'd like to bring to you attention.  There are some that you did award with "C" grades, and no comment as to why.  Also, some of your questions have had zero response, and that is likely for two reasons:  Poor closure on open items and poor grades.  I think you'll agree, epecially given the number of questions you've asked here, that experts here take great pride in their work, and deserve "A" grades and responses to all help they've given you.

EXPERTS -->  In the event any of these items remain open at the end of this week, I will finalize them and look to you for guidance on the fair results.  As always, we very much appreciate your willingness to help and the excellent support you all give.

Thanks,

Moondancer
Community Support Moderator @ Experts Exchange
Admin notified of user neglect. Force/accepted by

Netminder
Community Support Moderator
Experts Exchange