To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 8998
8997  |  8999
Subject: 
Re: Minifig Generator Plugin for LDDesignPad Version 1.6
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 26 Jun 2003 18:56:09 GMT
Viewed: 
1311 times
  
In lugnet.cad, Orion Pobursky wrote:
I decided to take a break from working on other projects and finally
revamp my Minifig plugin.

I do plan to release the source for this plugin as soon as I
finalize my DATTools Delphi component library

Hey, cool.  Is there a linux port in the works?

Questions, Comments, Requests, Complaints, Gripes, Moans, Bug
Reports, Flames, Death Threats: Email me or post them here on
LUGNET.

I have questions.  I think these plugins are pretty cool, so would
it be OK to use them as plugins for the LEDIT mode in ldglite?  I did
a quick and dirty feasibility test and it looks doable.  For my test
I tried to  see what it would take to launch the minifig plugin and
get me some minifig data to paste into ldglite.  It seems to work
if I run it from the lddp directory.  I take it this is because it
looks for "plugins\minipart.dat", or does it use the lddp path from
the registry?  I was thinking for my nefarious purposes, I could make
a plugin directory off the LDRAW directory and install the plugin
stuff there.  Any thoughts on this?

Don

Test code follows:

#include <windows.h>
#include <stdio.h>
#include <string.h>

typedef void WINAPI (TLDDPCallBack) (char *strCBCompleteText, char
*strCBSelText);

//*****************************************************************************
//define a funtion type
typedef void WINAPI __declspec(dllimport) (CALLBACK *PLUGIN_INFO)(unsigned char
CaseID, char *buffer, unsigned char maxlength);

//declare an instance of this function type
PLUGIN_INFO  Plugin_Info;

//*****************************************************************************
//define a funtion type
typedef void WINAPI __declspec(dllexport) (CALLBACK *PROCESS_TEXT)(unsigned char
*CompleteText, unsigned char *SelText, unsigned long *SelStart, unsigned long
*SelLength, unsigned long *CursoRow, unsigned long *CursorColum, TLDDPCallBack
myCallback);

//declare an instance of this function type
PROCESS_TEXT  ProcessText;

//*****************************************************************************
//DLL handle
HANDLE   hTME=NULL;

char buffer[256];

//*****************************************************************************
void WINAPI myCallBack (char *strCBCompleteText, char *strCBSelText)
{
  printf("myCallBack(\"%s\"\n\n\"%s\"\n",strCBCompleteText, strCBSelText);
}

//*****************************************************************************
int main()
{
  unsigned char CompleteText[100] = "";
  unsigned char SelText[100] = "";
  unsigned long SelStart = 0;
  unsigned long SelLength = 0;
  unsigned long CursoRow = 0;
  unsigned long CursorColum = 0;

  //ensure we are where the DLL will be found
  //SetCurrentDirectory(szDLLInThisDirectory);

  //load up the DLL
  hTME=LoadLibrary("Plugins\\PluginMinifig.dll");
  if (hTME!=NULL)
  {
    //get the function we want and lock to our function pointer
    Plugin_Info = (PLUGIN_INFO) GetProcAddress(hTME,"Plugin_Info");

    //error check
    if(Plugin_Info == NULL)
    {
      printf("Plugin_Info == NULL\n");
      //iError=GetLastError();
    }
    else
    {
      printf("Plugin_Info != NULL\n");
      strcpy(buffer, "nothing here");

      Plugin_Info('\1', buffer, 100);
      printf("Plugin_Info(1) = %s\n", buffer);

      Plugin_Info('\2', buffer, 100);
      printf("Plugin_Info(2) = %s\n", buffer);

      Plugin_Info('\3', buffer, 100);
      printf("Plugin_Info(3) = %s\n", buffer);

      Plugin_Info('\4', buffer, 100);
      printf("Plugin_Info(4) = %s\n", buffer);

      Plugin_Info('\5', buffer, 100);
      printf("Plugin_Info(5) = %s\n", buffer);

      Plugin_Info('\6', buffer, 100);
      printf("Plugin_Info(6) = %s\n", buffer);
    }

    //get the function we want and lock to our function pointer
    ProcessText = (PROCESS_TEXT) GetProcAddress(hTME,"ProcessText");

    //error check
    if(ProcessText == NULL)
    {
      printf("ProcessText == NULL\n");
      //iError=GetLastError();
    }
    else
    {
      printf("ProcessText != NULL\n");
      strcpy(buffer, "");

      ProcessText(CompleteText, SelText, &SelStart, &SelLength, &CursoRow,
&CursorColum, myCallBack);
    }

    //free library after use
    FreeLibrary(hTME);
  }
}



Message has 1 Reply:
  Re: Minifig Generator Plugin for LDDesignPad Version 1.6
 
(...) Unfortunately no. The component library I used for rendering, GLScene, is only available for Windows. Though I read that they were think of proting to Kylix. As soon as they relase a stable version, I'll work on it (...) I love for you to use (...) (21 years ago, 26-Jun-03, to lugnet.cad.dev)

Message is in Reply To:
  Minifig Generator Plugin for LDDesignPad Version 1.6
 
I decided to take a break from working on other projects and finally revamp my Minifig plugin. New in this version: Added support for the upcoming LDDP.ini file Improved Color edit boxes Added ability to change preview window background color (...) (21 years ago, 22-Jun-03, to lugnet.cad, lugnet.announce, FTX)

10 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR