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

well the thing is i am having a scheduled script that checks some changes
I am having some serious pathing issues with a website that I am creating.
I'm having some strange issues with decoding an XML snippet, contained with a cookie,
I keep on having these same two problems. I have been trying to use
I'm having an issue where I get an error that says... Uncaught TypeError: Object
I decided to modify some code today, and encountered an error that doesn't make
I'm working on an ASP.NET MVC 3 application and having some issues. I've got
I am having some issues surrounding the calling of a generic method. In the
I'm having some issues installing Rails. I have no experience with Ruby on Rails
I'm building a monitor app and am having some threading issues. I have, using

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.