Click here to Skip to main content
16,004,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: new operator Pin
David Crow26-Aug-05 4:15
David Crow26-Aug-05 4:15 
GeneralRe: new operator Pin
Emilio Garavaglia28-Aug-05 21:01
Emilio Garavaglia28-Aug-05 21:01 
QuestionDate receiver Pin
Ali Tavakol26-Aug-05 3:27
Ali Tavakol26-Aug-05 3:27 
AnswerRe: Date receiver Pin
David Crow26-Aug-05 3:30
David Crow26-Aug-05 3:30 
GeneralRe: Date receiver Pin
Ali Tavakol26-Aug-05 3:41
Ali Tavakol26-Aug-05 3:41 
GeneralRe: Date receiver Pin
David Crow26-Aug-05 3:55
David Crow26-Aug-05 3:55 
GeneralRe: Date receiver Pin
Maximilien26-Aug-05 4:13
Maximilien26-Aug-05 4:13 
Questioncaling conventions Pin
Member 222581226-Aug-05 1:29
Member 222581226-Aug-05 1:29 
I'm trying to use functions from a pascal/delphi .dll file in c++ code.
Functions without or with one parameter seem to work allright. If I try to use the function below, I get the exception error as shown.

Is there a solution to overcome this ?


The code:
-----------
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>

typedef BOOL (*PROC2)(int,int,int,int,int,int);

int _tmain(int argc, _TCHAR* argv[])
{
HINSTANCE hinstLib;
PROC2 DrawLine,DrawGraphic;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;

// Get a handle to the DLL module.
hinstLib = LoadLibrary("Intermec.dll");

// If the handle is valid, try to get the function address.

if (hinstLib != NULL)
{
DrawLine = (PROC2) GetProcAddress(hinstLib,"DrawLine");
// If the function address is valid, call the function.

if (NULL != DrawLine)
{
fRunTimeLinkSuccess = TRUE;
(DrawLine)(1,10,2,10,10,0);
}

// Free the DLL module.
fFreeResult = FreeLibrary(hinstLib);
}

This is the error-message:
--------------------------
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
AnswerRe: caling conventions Pin
Cedric Moonen26-Aug-05 1:55
Cedric Moonen26-Aug-05 1:55 
GeneralRe: caling conventions Pin
toxcct26-Aug-05 2:26
toxcct26-Aug-05 2:26 
GeneralRe: caling conventions Pin
Cedric Moonen26-Aug-05 2:36
Cedric Moonen26-Aug-05 2:36 
GeneralRe: caling conventions Pin
Member 222581226-Aug-05 3:00
Member 222581226-Aug-05 3:00 
GeneralRe: caling conventions Pin
MailtoGops26-Aug-05 3:19
MailtoGops26-Aug-05 3:19 
GeneralRe: caling conventions Pin
David Crow26-Aug-05 3:22
David Crow26-Aug-05 3:22 
QuestionHow to get HWND of my application window ? Pin
Amarelia26-Aug-05 1:08
Amarelia26-Aug-05 1:08 
AnswerRe: How to get HWND of my application window ? Pin
Jack Puppy26-Aug-05 1:41
Jack Puppy26-Aug-05 1:41 
AnswerRe: How to get HWND of my application window ? Pin
MailtoGops26-Aug-05 3:28
MailtoGops26-Aug-05 3:28 
QuestionCmdUpdateUI Pin
Joel Holdsworth26-Aug-05 1:05
Joel Holdsworth26-Aug-05 1:05 
AnswerRe: CmdUpdateUI Pin
Roger Allen26-Aug-05 2:45
Roger Allen26-Aug-05 2:45 
AnswerRe: CmdUpdateUI Pin
David Crow26-Aug-05 3:13
David Crow26-Aug-05 3:13 
GeneralRe: CmdUpdateUI Pin
Joel Holdsworth26-Aug-05 4:39
Joel Holdsworth26-Aug-05 4:39 
GeneralRe: CmdUpdateUI Pin
David Crow26-Aug-05 4:48
David Crow26-Aug-05 4:48 
GeneralRe: CmdUpdateUI Pin
Joel Holdsworth29-Aug-05 22:20
Joel Holdsworth29-Aug-05 22:20 
GeneralRe: CmdUpdateUI Pin
Joel Holdsworth29-Aug-05 23:22
Joel Holdsworth29-Aug-05 23:22 
QuestionDynamically allocated strings Pin
Anonymous26-Aug-05 0:40
Anonymous26-Aug-05 0:40 

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.