Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert CString to const wchar_t *. Pin
CPallini19-May-09 2:27
mveCPallini19-May-09 2:27 
GeneralRe: convert CString to const wchar_t *. Pin
Cedric Moonen19-May-09 2:42
Cedric Moonen19-May-09 2:42 
GeneralRe: convert CString to const wchar_t *. Pin
Le@rner19-May-09 2:45
Le@rner19-May-09 2:45 
GeneralRe: convert CString to const wchar_t *. Pin
Cedric Moonen19-May-09 2:56
Cedric Moonen19-May-09 2:56 
JokeCédric is on my side... Cédric is on my side... Pin
Rajesh R Subramanian19-May-09 3:00
professionalRajesh R Subramanian19-May-09 3:00 
GeneralRe: Cédric is on my side... Cédric is on my side... Pin
Cedric Moonen19-May-09 3:09
Cedric Moonen19-May-09 3:09 
GeneralMFC Application with different DLLs(having same function name) Pin
aravind.sn19-May-09 1:31
aravind.sn19-May-09 1:31 
GeneralRe: MFC Application with different DLLs(having same function name) Pin
Stuart Dootson19-May-09 1:56
professionalStuart Dootson19-May-09 1:56 
You need to use explicit DLL linking. Here's an example. Let us say the function is called Test and has the same signature in all three DLLs (because that simplifies things), which is int Test(int). Then we can do this:

// Declare a type for the function we want to load.
typedef int (*pTest)(int);
// Function that tries to get a nfunction named Test from the DLL we pass it.
pTest GetTestFnFromDll(LPCTSTR dllName)
{
   // Load the DLL
   HMODULE hDll = LoadLibrary(dllName);
   if (!hDll) return 0;
   // Get the function address
   return (pTest)GetProcAddress(hDll, "Test");
}

int main()
{
   // Use first.dll!Test
   pTest aTestFn = GetTestFnFromDll(_T("first.dll"));
   if (aTestFn)
      std::cout << aTestFn(10) << std::endl;

   // Use second.dll!Test
   pTest aSecondTestFn = GetTestFnFromDll(_T("second.dll"));
   if (aSecondTestFn)
      std::cout << aSecondTestFn(10) << std::endl;

   return 0;
}
HTH!



GeneralRe: MFC Application with different DLLs(having same function name) Pin
Rajesh R Subramanian19-May-09 1:57
professionalRajesh R Subramanian19-May-09 1:57 
GeneralRe: MFC Application with different DLLs(having same function name) Pin
Stuart Dootson19-May-09 2:58
professionalStuart Dootson19-May-09 2:58 
GeneralRe: MFC Application with different DLLs(having same function name) Pin
Rajesh R Subramanian19-May-09 3:32
professionalRajesh R Subramanian19-May-09 3:32 
GeneralRe: MFC Application with different DLLs(having same function name) Pin
aravind.sn19-May-09 4:54
aravind.sn19-May-09 4:54 
GeneralRe: MFC Application with different DLLs(having same function name) Pin
aravind.sn19-May-09 18:42
aravind.sn19-May-09 18:42 
Questionequivalent of c# @"" string literal? Pin
Jon Hulatt19-May-09 1:04
Jon Hulatt19-May-09 1:04 
AnswerRe: equivalent of c# @"" string literal? Pin
Taran919-May-09 1:08
Taran919-May-09 1:08 
AnswerRe: equivalent of c# @"" string literal? Pin
«_Superman_»19-May-09 1:09
professional«_Superman_»19-May-09 1:09 
AnswerRe: equivalent of c# @"" string literal? Pin
CPallini19-May-09 1:28
mveCPallini19-May-09 1:28 
GeneralRe: equivalent of c# @"" string literal? Pin
Jon Hulatt19-May-09 1:57
Jon Hulatt19-May-09 1:57 
GeneralRe: equivalent of c# @"" string literal? Pin
CPallini19-May-09 2:02
mveCPallini19-May-09 2:02 
GeneralRe: equivalent of c# @"" string literal? Pin
BadKarma19-May-09 3:56
BadKarma19-May-09 3:56 
QuestionRe: equivalent of c# @"" string literal? Pin
CPallini19-May-09 6:06
mveCPallini19-May-09 6:06 
QuestionRefreshing network connections folder after changing phonebook Pin
H@r@ld19-May-09 0:32
H@r@ld19-May-09 0:32 
QuestionRe: Refreshing network connections folder after changing phonebook Pin
wahaha018-Dec-11 1:02
wahaha018-Dec-11 1:02 
Questionchar array to string Pin
lune1219-May-09 0:25
lune1219-May-09 0:25 
AnswerRe: char array to string Pin
Rajesh R Subramanian19-May-09 0:26
professionalRajesh R Subramanian19-May-09 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.