Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4125786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:54:55+00:00 2026-05-20T23:54:55+00:00

Well, i am having some issues with an error that i don’t understand. These

  • 0

Well, i am having some issues with an error that i don’t understand.

These are the two related files:

Inside DLLExporter:

#ifdef LOGGER_EXPORTS
    #define LOGGER_API __declspec(dllexport) __stdcall
#else
    #define LOGGER_API __declspec(dllimport) __stdcall
#endif

typedef long (CALLBACK *LPFNTIMER)( void );

// Exported Functions
bool LOGGER_API Initialize( std::string filename, bool ShowConsole = true );
bool LOGGER_API Release( void );
bool LOGGER_API SetTimer( LPFNTIMER );

bool LOGGER_API Initialize(std::string filename, bool ShowConsole)
{
    [...]
}

bool LOGGER_API Release()
{
    [...]
}

bool LOGGER_API SetTimer(LPFNTIMER fn)
{
    [...]
}

inside DLLExporter.def

LIBRARY DLLExporter.dll
EXPORTS
    Initialize
    Release
    SetTimer 

inside DLLImporter:

typedef long (__stdcall *LPFNTIMER)( void );

typedef bool (__stdcall *LPFNINITIALIZER)( string, bool );
typedef bool (__stdcall *LPFNTIMERSETUP)( LPFNTIMER );
typedef bool (__stdcall *LPFNRELEASER)( void );

[...]


long __stdcall TimerFunc()
{
    return 0;
}

[...]

if (g_DLLExporter == NULL)
    return false;

LogInit = (LPFNINITIALIZER)GetProcAddress(g_DLLExporter, "Initialize");
LogRelease = (LPFNRELEASER)GetProcAddress(g_DLLExporter, "Release");
LogTimer = (LPFNTIMERSETUP)GetProcAddress(g_DLLExporter, "SetTimer");

if ( LogInit == NULL || LogRelease == NULL || LogTimer == NULL)
    return false;

if (!LogInit("test.log", true))
    return false;

if (!LogRelease())
    return false;

if (!LogTimer(TimerFunc))
    return false;

This code runs all the way through to the LogTimer call which fails, with the Run-Time Check Failure #0 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.

I have already noted the __stdcall issues reported elsewhere, but as you can see above i have that included, and i even forced the __stdcall calling convention in the project properties (MSVS 2010). Any thoughts as to why i would get the error only on the timer function and not on the init or release functions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:54:55+00:00Added an answer on May 20, 2026 at 11:54 pm

    Just thinking, perhaps if you call LogTimer() before LogRelease()?

    And what about passing the proper parameters to Initialize and SetTimer?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some 64-bit issues. Here's the scoop: I have 32-bit COM exe (written
I am trying to integrate some new code I wrote for programmatically interacting with
I've currently got a BaseController class that inherits from System.Web.Mvc.Controller . On that class
We have a ten-year-old ASP application that we are considering planning an update for.
I'm trying to build my first app on CodeIgniter. This is also my first
I'm trying to build my first app on CodeIgniter. This is also my first
I'm working on a web application written in Java using the Tapestry 5.1.0.5 framework.
I've kind of asked this question before - What does JVM flag CMSClassUnloadingEnabled actually
Updated question to reflect answers and my research Thanks casablanca and wallyk for answering.
Possible Duplicate: Working with large numbers in PHP. I run a completely useless Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.