in reply to Possible or am I dreaming for Perl made dlls

This looks like a Microsoft Windows C/C++ program header file. Presumably there is also a main program that goes with this header. Why do you want to interface this to Perl?

metadoktor

"The doktor is in."

  • Comment on Re: Possible or am I dreaming for Perl made dlls

Replies are listed 'Best First'.
Re: Re: Possible or am I dreaming for Perl made dlls
by Anonymous Monk on Feb 14, 2002 at 11:27 UTC
    This header file is interface between botcore.exe which source is not published cause the author wants keep some things in secret. Anyway the author has published this header file for other programmers so they could change the behavior of the corebot.exe.
    I try clarify this more..
    There are 4 files:
    botcore.exe <-- source not available.
    behaviors.ini <-- contains the name of compiled behavior dll file
    bot.h <-- the published header file
    botbehavior.cpp <-- C++ file which is compiled to dll. This file also includes the bot.h file
    Bot.h presents how programmer may do their own behaviors for the botcore.exe. Bot.h does not need to exsist as long ht behavior code is compiled to dll and it contains following:
    // this is the only function a behavior has to implement: // extern "C" __declspec (dllexport) void CALLBACK BOT_Cmd(BOTCMD *bc) +;
    botcore.exe is calling this callback function every 10 ms
    +----------------+ |botcore.exe | +-----+ |CORE | <-->| ini | name of dll +-------------|--+ +-----+ |Bot.h | | -- | BotCMD | | | +-------------|--+ | <-- Any Bot programmer may change |behavior.dll | | if only code is compiled into DLL | CODE | -- and it exports BOT_Cmd function +----------------+
    Like I said I am not any good with C pluss I know I could do lot of nice new bots if all these things could be done just using Perl. ...Sorry my clumsy english, I hope you figured out the proplem...
      Looks like you'll probably have to spend some $$$ to get the tool necessary to do this (i.e. PerlCtrl to create a Perl DLL), otherwise you're probably out of luck. See ActiveState's reference on creating Perl DLLs

      metadoktor

      "The doktor is in."

        Ok sounds reasonable, but could it be done so that the dll made by C++, calls the perl script by passing all the data it gets in *bc pointer variable and viceversa ?
        This way I don't need to figure out how to compile dlls from the perl scripts.
        --------------+ corebot.exe | ------|-------+ ------|-------+ C made API for the Perl script Small.dll | <-Maps BOTCMD *bc pointer to perl Table ? ------+-------+ and then calls Perl script | DATA v +--------------+ |Perl programm | +--------------+