Click here to Skip to main content
15,867,308 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Access to Locigal Drives under Vista Pin
Bram van Kampen18-Aug-09 11:01
Bram van Kampen18-Aug-09 11:01 
GeneralRe: Access to Locigal Drives under Vista Pin
Bram van Kampen18-Aug-09 14:35
Bram van Kampen18-Aug-09 14:35 
GeneralRe: Access to Locigal Drives under Vista Pin
Michael Dunn18-Aug-09 16:20
sitebuilderMichael Dunn18-Aug-09 16:20 
GeneralRe: Access to Locigal Drives under Vista Pin
Bram van Kampen23-Aug-09 13:39
Bram van Kampen23-Aug-09 13:39 
AnswerRe: Access to Locigal Drives under Vista Pin
bob1697217-Aug-09 17:32
bob1697217-Aug-09 17:32 
QuestionImporting a class from a DLL with a different name Pin
Code-o-mat17-Aug-09 11:48
Code-o-mat17-Aug-09 11:48 
AnswerRe: Importing a class from a DLL with a different name Pin
Bram van Kampen17-Aug-09 14:09
Bram van Kampen17-Aug-09 14:09 
GeneralRe: Importing a class from a DLL with a different name Pin
Code-o-mat17-Aug-09 21:10
Code-o-mat17-Aug-09 21:10 
Thanks!

Thought i try to explain what i thought of doing. I am writing a DLL and when i tried to use std::basic_string in it i got two unresolved external symbols, _String_base::Xlen and _String_base::Xran. I googled around quite a bit and found out some usefull things, however, the possible solutions i found (reorder the include directories e.g.) either did not make any difference or i did not like them. Mostly people hit this when migrating a project from VS2003 to VS2005 and up, however, i am simply writing a program (not migrating anything) in VS2003 and chanhing to a different VS version is not an option right now.
So, what i have found out is that the problem is caused by mismatching calling conventions. The header file (xstring.h i believe) declares the 2 methods as __thiscall, that is, they are two member methods of __Basic_string, however, the library or DLL (am not sure which here) exports these as static, __stdcall methods, thus, they "can't find each other". So i thought, i could maybe implement the __thiscall versions in my code and in them call the __stdcall versions and live happily ever after. But how i would gain access to the __stdcall versions i don't know, if i could have tricked the system by importing the class with a different name from the DLL (since __Basic_string is already declared i can't use that, and i do not wish to modify xstring.h since that would be ugly at least) i could have declared in this class the __stdcall versions and then call them from the __thiscall versions.
Now i am wondering if i could write a lib file i can link to which imports the right class from the DLL (with the __stdcall versions), exposes two methods for Xran and Xlen (which call their static class member counterparts) and then in my program i could call these in the implementations of the __thiscall versions.
There might be a very simple solution for this which i have simply missed or do not (yet) have enough knowledge (as i said, exporting/importing classes in DLLs is still new to me) to realize and i am re-inventing the wheel.

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <

GeneralRe: Importing a class from a DLL with a different name Pin
Bram van Kampen18-Aug-09 0:07
Bram van Kampen18-Aug-09 0:07 
AnswerRe: Importing a class from a DLL with a different name Pin
KarstenK19-Aug-09 3:25
mveKarstenK19-Aug-09 3:25 
GeneralRe: Importing a class from a DLL with a different name Pin
Code-o-mat19-Aug-09 5:32
Code-o-mat19-Aug-09 5:32 
QuestionHooking a api function using jmp instruction implent Pin
jhon cage17-Aug-09 9:37
jhon cage17-Aug-09 9:37 
AnswerRe: Hooking a api function using jmp instruction implent Pin
Bram van Kampen17-Aug-09 14:26
Bram van Kampen17-Aug-09 14:26 
QuestionCreateFile problem Pin
birajendu17-Aug-09 4:38
birajendu17-Aug-09 4:38 
AnswerRe: CreateFile problem Pin
Ahmed Charfeddine17-Aug-09 4:50
Ahmed Charfeddine17-Aug-09 4:50 
AnswerRe: CreateFile problem Pin
David Crow17-Aug-09 4:58
David Crow17-Aug-09 4:58 
GeneralRe: CreateFile problem Pin
birajendu17-Aug-09 6:49
birajendu17-Aug-09 6:49 
QuestionBest place to call GdiplusStartup in an MFC MDI Application Pin
bob1697217-Aug-09 4:25
bob1697217-Aug-09 4:25 
AnswerRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
Randor 17-Aug-09 4:38
professional Randor 17-Aug-09 4:38 
GeneralRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
bob1697217-Aug-09 5:10
bob1697217-Aug-09 5:10 
GeneralRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
bob1697217-Aug-09 7:28
bob1697217-Aug-09 7:28 
AnswerRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
Stuart Dootson17-Aug-09 6:06
professionalStuart Dootson17-Aug-09 6:06 
GeneralRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
bob1697217-Aug-09 7:24
bob1697217-Aug-09 7:24 
AnswerRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
Joe Woodbury17-Aug-09 6:11
professionalJoe Woodbury17-Aug-09 6:11 
GeneralRe: Best place to call GdiplusStartup in an MFC MDI Application Pin
bob1697217-Aug-09 7:33
bob1697217-Aug-09 7:33 

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.