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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:24:36+00:00 2026-06-03T03:24:36+00:00

I’ve been at this for some time now. I need a basic IRC Ping

  • 0

I’ve been at this for some time now. I need a basic IRC Ping Pong function to return the the proper response when the IRC server pings. I changed the name of the function get() to something else and I’m still getting the error. I thought perhaps the function name get() was already defined in one of the includes or something else.

#include "stdafx.h"
#include "Ping_Pong.h"
#include <iostream>
#include <ws2tcpip.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

CWinApp theApp;

#define MT4_EXPFUNC __declspec(dllexport)
#pragma comment(lib, "Ws2_32.lib")

class MT4_EXPFUNC IRC {

private:
    char buf[513];
    char rbuf[513];
    char sbuf[513];
    char *tok;
    int recv_bytes;
    int irc_socket;
    struct addrinfo hints;
    struct addrinfo *results;
public:
    char *nick, *user, *host, *chan, *type, *mesg;
    int irc_connect(const char *host, const char *port, const char *nick);
    void socket_err(const char* err_string);
    //int join(const char *channel);

This is the name of the function in question

    int __stdcall get();

    char *check(const char* test_str);
    char *pop_arg(char **save_ptr);
    int init_comarg();
    int say(const char *channel, const char *message);
    int sayf(const char *channel, const char *message, ...);
    int mode(const char *channel, const char *mode, char *target);
    //void die();

};

And this is the function I’m having a problem with.

MT4_EXPFUNC int __stdcall IRC::get()
    {


    memset(rbuf, 0, 513);
    recv_bytes = recv(irc_socket, rbuf, sizeof(rbuf), 0);
    if (recv_bytes <= 0) {
        return -1;
    }
    std::cout << rbuf;
    // Auto-Respond to PING messages.
    if (rbuf[0] == 'P' && rbuf[1] == 'I') {
        tok = strtok(rbuf, "PING :");
        sprintf(buf, "PONG %s", tok-1 );
        send(irc_socket, buf, strlen(buf), 0);
        std::cout << buf;
        memset(buf, 0, 513);
    }
    if ( strstr(rbuf, "PRIVMSG")) {
        memcpy(sbuf, rbuf, 513);
        nick = strtok(sbuf, "!") + 1;
        user = strtok(NULL, "@");
        host = strtok(NULL, " ");
        type = strtok(NULL, " ") - 1;
        chan = strtok(NULL, " ");
        mesg = strtok(NULL, ":");
    }
    return 1;
    }
  • 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-06-03T03:24:38+00:00Added an answer on June 3, 2026 at 3:24 am

    In the tutorial linked below, a .def file was suggested with the following code:

    Library "Ping_Pong"
    Export   get
    

    I removed the .def and it worked.

    http://www.xpworx.com/metatrader-mql-articles/mql4-articles/create-your-own-metatrader-extension-dll.php

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.