Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TreeView Control Pin
molesworth19-May-09 2:32
molesworth19-May-09 2:32 
GeneralRe: TreeView Control Pin
zakkas248319-May-09 2:59
zakkas248319-May-09 2:59 
GeneralRe: TreeView Control Pin
molesworth19-May-09 3:44
molesworth19-May-09 3:44 
AnswerRe: TreeView Control Pin
Alain Rist19-May-09 5:01
Alain Rist19-May-09 5:01 
Questionconvert CString to const wchar_t *. Pin
Le@rner19-May-09 1:46
Le@rner19-May-09 1:46 
AnswerRe: convert CString to const wchar_t *. Pin
Rajesh R Subramanian19-May-09 1:53
professionalRajesh R Subramanian19-May-09 1:53 
AnswerRe: convert CString to const wchar_t *. Pin
_AnsHUMAN_ 19-May-09 1:56
_AnsHUMAN_ 19-May-09 1:56 
GeneralRe: convert CString to const wchar_t *. Pin
Rajesh R Subramanian19-May-09 1:58
professionalRajesh R Subramanian19-May-09 1:58 
JokeRe: convert CString to const wchar_t *. Pin
_AnsHUMAN_ 19-May-09 2:10
_AnsHUMAN_ 19-May-09 2:10 
GeneralRe: convert CString to const wchar_t * Pin
Rajesh R Subramanian19-May-09 2:48
professionalRajesh R Subramanian19-May-09 2:48 
GeneralRe: convert CString to const wchar_t *. Pin
CPallini19-May-09 2:07
mveCPallini19-May-09 2:07 
GeneralRe: convert CString to const wchar_t *. Pin
Rajesh R Subramanian19-May-09 2:46
professionalRajesh R Subramanian19-May-09 2:46 
GeneralRe: convert CString to const wchar_t *. Pin
CPallini19-May-09 3:12
mveCPallini19-May-09 3:12 
QuestionRe: convert CString to const wchar_t *. Pin
CPallini19-May-09 2:08
mveCPallini19-May-09 2:08 
AnswerRe: convert CString to const wchar_t *. Pin
Le@rner19-May-09 2:12
Le@rner19-May-09 2:12 
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 

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.