Click here to Skip to main content
15,902,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A funny thing happened to me. Who can explain? Pin
Anand Paranjpe14-May-04 0:37
Anand Paranjpe14-May-04 0:37 
AnswerRe: A funny thing happened to me. Who can explain? Pin
Anand Paranjpe14-May-04 0:34
Anand Paranjpe14-May-04 0:34 
GeneralSharing violation error when loading a DLL Pin
DaFrawg13-May-04 1:08
DaFrawg13-May-04 1:08 
GeneralRe: Sharing violation error when loading a DLL Pin
bikram singh13-May-04 5:28
bikram singh13-May-04 5:28 
GeneralRe: Sharing violation error when loading a DLL Pin
DaFrawg23-May-04 22:45
DaFrawg23-May-04 22:45 
GeneralCapture Video from tv Tunner card Pin
Anonymous13-May-04 1:03
Anonymous13-May-04 1:03 
GeneralRe: Capture Video from tv Tunner card Pin
marcosvpp13-May-04 5:00
marcosvpp13-May-04 5:00 
GeneralESP error calling DLL exported function... Pin
Chris Ulliott13-May-04 0:54
Chris Ulliott13-May-04 0:54 
Hi All,

Ive created a bare Win32 DLL. Ive exported a function and can get the functions address with no problems in my calling application.

My problem is after the DLL function is called I get the message "The value of ESP was not properly saved across a function call".

My code is...

DLL HEADER
---------------
#ifdef JDEDXMLPARSER_EXPORTS
#define JDEDXMLPARSER_API __declspec(dllexport)
#else
#define JDEDXMLPARSER_API __declspec(dllimport)
#endif

// This class is exported from the jdedXMLParser.dll
class JDEDXMLPARSER_API CJdedXMLParser {
public:
CJdedXMLParser(void);
dllAddFile(TCHAR* szFile);
// TODO: add your methods here.
};

// This integer is exported
extern JDEDXMLPARSER_API int nJdedXMLParser;
// This function is exported
JDEDXMLPARSER_API AddFile(TCHAR * sz);



DLL CPP
----------
JDEDXMLPARSER_API AddFile(TCHAR *sz)
{
MessageBox(NULL, sz, L"", 0);
//parser.dllAddFile(szFile);
}


CALLING THE DLL
----------------------
// Globals
typedef (WINAPI* AddFile)(TCHAR *sz);
AddFile _AddFile;

void CUnicodeTestDlg::OnBegin()
{
HMODULE m_lib;
TCHAR * szTable = _T("F0101");

m_lib = LoadLibrary(_T("jdedXMLParser.dll"));

_AddFile = (AddFile) GetProcAddress(m_lib, "?AddFile@@YAHPAG@Z");

_AddFile(szTable);
}

When I call _AddFile I get MY message box from the DLL function followed by the system error ESP message. Does anyone know what I am doing wrong here?

I dont have a .def file as im not sure how to link it in and use it so I am using the FULL function name.

Thanks in advance for any help.

Kind Regards,

Chris

GeneralRe: ESP error calling DLL exported function... Pin
Justin Cooke13-May-04 4:19
Justin Cooke13-May-04 4:19 
GeneralRe: ESP error calling DLL exported function... Pin
bikram singh13-May-04 5:13
bikram singh13-May-04 5:13 
GeneralDrawThemeText Pin
Steve Thresher13-May-04 0:53
Steve Thresher13-May-04 0:53 
GeneralNetwork I/O models Pin
Rickard Andersson2012-May-04 23:51
Rickard Andersson2012-May-04 23:51 
GeneralRe: Network I/O models Pin
Mike Dimmick13-May-04 3:27
Mike Dimmick13-May-04 3:27 
GeneralInstead a dialog I want to appear 3 buttons Pin
Filomela12-May-04 23:30
Filomela12-May-04 23:30 
GeneralRe: Instead a dialog I want to appear 3 buttons Pin
nguyenvhn13-May-04 1:50
nguyenvhn13-May-04 1:50 
GeneralRe: Instead a dialog I want to appear 3 buttons Pin
Filomela13-May-04 21:42
Filomela13-May-04 21:42 
GeneralRe: Instead a dialog I want to appear 3 buttons Pin
nguyenvhn13-May-04 22:41
nguyenvhn13-May-04 22:41 
GeneralTerminate a Named Program Pin
sweep12312-May-04 23:27
sweep12312-May-04 23:27 
GeneralRe: Terminate a Named Program Pin
Milton Karimbekallil12-May-04 23:56
Milton Karimbekallil12-May-04 23:56 
GeneralRe: Terminate a Named Program Pin
sweep12313-May-04 2:51
sweep12313-May-04 2:51 
GeneralRe: Terminate a Named Program Pin
jmkhael13-May-04 4:55
jmkhael13-May-04 4:55 
GeneralRe: Terminate a Named Program Pin
sweep12313-May-04 5:57
sweep12313-May-04 5:57 
GeneralKeeping variables in memory Pin
V.12-May-04 23:14
professionalV.12-May-04 23:14 
GeneralRe: Keeping variables in memory Pin
jmkhael13-May-04 2:22
jmkhael13-May-04 2:22 
GeneralRe: Keeping variables in memory Pin
Joe Woodbury13-May-04 9:15
professionalJoe Woodbury13-May-04 9:15 

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.