Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: regarding project!! Pin
Rajkumar R26-Feb-08 1:10
Rajkumar R26-Feb-08 1:10 
GeneralRe: regarding project!! Pin
Maxwell Chen26-Feb-08 4:10
Maxwell Chen26-Feb-08 4:10 
QuestionRe: regarding project!! Pin
Rajkumar R26-Feb-08 5:07
Rajkumar R26-Feb-08 5:07 
GeneralRe: regarding project!! Pin
Maxwell Chen26-Feb-08 6:36
Maxwell Chen26-Feb-08 6:36 
GeneralRe: regarding project!! Pin
Maxwell Chen26-Feb-08 1:00
Maxwell Chen26-Feb-08 1:00 
GeneralRe: regarding project!! Pin
rowdy_vc++26-Feb-08 1:14
rowdy_vc++26-Feb-08 1:14 
GeneralDLL found with VS2003 but not VS2005 Pin
Merlin Tintin26-Feb-08 0:10
Merlin Tintin26-Feb-08 0:10 
GeneralRe: DLL found with VS2003 but not VS2005 Pin
Iain Clarke, Warrior Programmer26-Feb-08 0:45
Iain Clarke, Warrior Programmer26-Feb-08 0:45 
Merlin Tintin wrote:
"?Play@@YGPB0K0H_NHH@Z"


Going from the above quote, you are using C++, and exporting a C++ function. You've noticed the name mangling, (sorry, "decorating"), and have tried to compensate for it.

This decoration is famously fragile, and you can't mix C++ exported functions with different compilers. I bet 2003 and 2005 have different decoration.

If I'm right, the fix is simple. Here is a snippet of a function I export from one of my Extendy DLLs.

extern "C" {
	BOOL __declspec(dllexport) GetBusModuleDetailsW (BusModuleInformation *info, UINT nFlags);
}
BOOL __declspec(dllexport) GetBusModuleDetailsW (BusModuleInformation *info, UINT nFlags)
{
....
}


And here is how I load it:
typedef BOOL (*BUSGETMODULEINFORMATION)(BusModuleInformation *info, UINT nFlags);

....

	g_hModuleBus = ::LoadLibrary (sModule);
	BUSGETMODULEINFORMATION md = NULL;

	if (g_hModuleBus)
	{
		md = (BUSGETMODULEINFORMATION) ::GetProcAddress (g_hModuleBus, "GetBusModuleDetailsW");
		if (!md)
		{
			FreeLibrary (g_hModuleBus);
			g_hModuleBus = NULL;
		}
	}
	else
		md = GetBusModuleDetailsW;

	if (md)
	{
		(md) (&somestruct, SOME_FLAGS);


Some code has been changed, as it's not relevant to you what structures and flags do what within my software.

So, you could make your DLLs safe using extern "c" in vs2003, then compile the appropriate ones in vs2005.


Good luck,

Iain.

Iain Clarke appearing in spite of being begged not to by CPallini.

QuestionRe: DLL found with VS2003 but not VS2005 Pin
Rajkumar R26-Feb-08 0:52
Rajkumar R26-Feb-08 0:52 
GeneralRe: DLL found with VS2003 but not VS2005 Pin
Iain Clarke, Warrior Programmer26-Feb-08 1:01
Iain Clarke, Warrior Programmer26-Feb-08 1:01 
QuestionRe: DLL found with VS2003 but not VS2005 Pin
Rajkumar R26-Feb-08 0:56
Rajkumar R26-Feb-08 0:56 
GeneralRe: DLL found with VS2003 but not VS2005 Pin
Merlin Tintin26-Feb-08 1:39
Merlin Tintin26-Feb-08 1:39 
GeneralRe: DLL found with VS2003 but not VS2005 Pin
Rajkumar R26-Feb-08 1:49
Rajkumar R26-Feb-08 1:49 
GeneralRe: DLL found with VS2003 but not VS2005 Pin
Merlin Tintin26-Feb-08 21:22
Merlin Tintin26-Feb-08 21:22 
Generalstring operation and related exception Pin
George_George25-Feb-08 23:47
George_George25-Feb-08 23:47 
Generalbasic_string constructor Pin
George_George25-Feb-08 23:29
George_George25-Feb-08 23:29 
GeneralRe: basic_string constructor Pin
Jeet_IT_in25-Feb-08 23:44
Jeet_IT_in25-Feb-08 23:44 
GeneralRe: basic_string constructor Pin
George_George26-Feb-08 13:57
George_George26-Feb-08 13:57 
GeneralRe: basic_string constructor Pin
Maxwell Chen26-Feb-08 0:38
Maxwell Chen26-Feb-08 0:38 
GeneralRe: basic_string constructor Pin
George_George26-Feb-08 14:03
George_George26-Feb-08 14:03 
GeneralRe: basic_string constructor Pin
Rajkumar R26-Feb-08 1:13
Rajkumar R26-Feb-08 1:13 
GeneralRe: basic_string constructor Pin
George_George26-Feb-08 14:04
George_George26-Feb-08 14:04 
GeneralProblem in Closing a file window. Pin
Sanjay K25-Feb-08 23:09
Sanjay K25-Feb-08 23:09 
GeneralRe: Problem in Closing a file window. Pin
ramana.g25-Feb-08 23:33
ramana.g25-Feb-08 23:33 
GeneralRe: Problem in Closing a file window. Pin
Jeet_IT_in25-Feb-08 23:46
Jeet_IT_in25-Feb-08 23:46 

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.