Hello there! I'm currently doing some VC++ programming. I'm using MFC programming and DLL which is explicitly linked. I have placed my initialization and the usage of GetProcAdress inside my "buttonClicked" function. When a button is clicked, the function in the DLL should be called.
void CSample::buttonClicked(){
if(hLib){
pSampleFunc = (SampleFunc)GetProcAddress(hLib, "Sample");
if(pSampleFunc ){
pSampleFunc (iVar, cVar);
}
FreeLibrary(hLib);
}else{
MessageBox("Library Failed!");
}
//DO SOME STUFF HERE
......
}
The first execution of the button is successful but if I pressed it the second time, it does nothing. What do you think is the problem? Please advise. Thank you. :)