mimic visual C or Delphi DLL to PB

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by marlo.

Hi all, anyone here knows how mimic Delphi or Visual C code to PB.Exist any doc about that? Thanks

south south america
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by marlo.

Here some of the Visual C code:

#include //Include data definitions
#include //Standard library - used for type conversions.
#include //String utilities.

const BYTE ACTIONPARAM_NONE = 0;
const BYTE ACTIONPARAM_ALPHA = 1;

typedef char* pCharArray[MaxActionParams];
typedef void(__stdcall *AddActionProcType)(int IDNum,char* Name, char* Hint,char Params[]/*,BYTE NumParams*/);
typedef void(__stdcall *AddFileProcType)(char*,bool AddFlag);
typedef void(__stdcall *GetVarProcType)(char* VarName, char*& Value);
typedef void(__stdcall *SetVarProcType)(char* VarName, char* Value);
typedef void(__stdcall *PlayActionProcType)(char*);
typedef bool(__stdcall *InterfaceProcType)(int InterfaceID,char* Data);
typedef void(__stdcall *dllHandlerProcType)(int Reason);

AddActionProcType xnbAddAction;
AddFileProcType nbAddFile;
GetVarProcType nbGetVar;
SetVarProcType nbSetVar;
PlayActionProcType nbPlayAction;
InterfaceProcType nbInterface;
HWND nbWinHandle;

bool __declspec(dllexport) __stdcall nbEditAction(int IDNum, pCharArray& Params);
bool __declspec(dllexport) __stdcall nbExecAction(int IDNum, pCharArray& Params);
void __declspec(dllexport) __stdcall nbMessage(int MsgCode, int Reserved);
void __declspec(dllexport) __stdcall nbInitPlugIn(HWND WinHandle, char*& PlugInTitle, char*& PlugInPublisher, char*& PlugInHint);
void __declspec(dllexport) __stdcall nbRegisterScriptProcessor(PlayActionProcType PlayActionProc);

if(S!=NULL){GlobalFree(HGLOBAL(S));}
S=NULL;

void SetStr(char*& Dest,char* Source){
int slngth=0;while(Source[slngth]){slngth++;}
if(Dest!=NULL){GlobalFree(HGLOBAL(Dest));}
Dest=(char*)(GlobalAlloc(GMEM_FIXED,slngth+1));
strcpy(Dest,Source);


bool __declspec(dllexport) __stdcall nbEditAction(int IDNum, pCharArray& Params)

Well, its enough, if anybody can help, really thanks.


south south america
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Bye,

El_Choni

Edited by - El_Choni on 05 May 2002 04:59:11

Edited by - El_Choni on 05 May 2002 11:32:46
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by marlo.

te agradezco choni!

south south america
Post Reply