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 7089141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:53:09+00:00 2026-05-28T07:53:09+00:00

I’m loading a libmysql.dll and want to connect to a db. When calling the

  • 0

I’m loading a libmysql.dll and want to connect to a db. When calling the mysql_real_connect i get a buffer overflow error. Why? Code:

#include <iostream>
#include <string.h>
#include <windows.h>
#include <cstdlib>
#include <stdio.h>
#include "mysql.h"

using namespace std;
// Definition des Types der DLL-Funktion, die verwendet werden soll
typedef int (*BinaryFunction_c) (int,string,string,string,string,int,int,int) ;
typedef int (*BinaryFunction_i) (int) ;

int main (void) 
{
    BinaryFunction_i    m_init  ;
    BinaryFunction_c    m_connect ;
    BOOL              fFreeResult ;
    int sqlinit;
    int connid;

    // DLL Datei laden
    HINSTANCE         hinstLib = LoadLibrary("./libmysql.dll");



    if (hinstLib != NULL)
    {
        // Die Einsprungadresse abfragen
        m_init = (BinaryFunction_i) GetProcAddress (hinstLib, "mysql_init") ;

        // Die Funktion aufrufen
        if ( m_init != NULL )
        {
            sqlinit = (*m_init) (NULL); 
            cout << dec << "m_init: " << m_init << endl;
        }
        else
        {
            cout << "fehler beim init" << endl;
        }

        //connect
        m_connect = (BinaryFunction_c) GetProcAddress (hinstLib, "mysql_real_connect");
        // Die Funktion aufrufen
        if ( m_connect != NULL )
        {
            connid= (*m_connect) (sqlinit, "192.168.1.2", "cashbot", "eck1234", "cashbot", 3306, NULL, 0);
            cout << "connid: " << connid << endl;
        }
        else
        {
            cout << "fehler beim connect" << endl;
        }

        // Die DLL-Datei wieder entladen
        fFreeResult = FreeLibrary (hinstLib) ;
    }

    return 0;
}
  • 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-28T07:53:09+00:00Added an answer on May 28, 2026 at 7:53 am

    OK, the problem was that the 64 bit win7 searches for the 64-bit version of the libmysql.dll in the SysWOW64 folder and this dll does not work with a 32 programm!

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
i want to parse a xhtml file and display in UITableView. what is the

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.