Delphi DLL won't run w/ Delphi or BP7 but runs with VB and Word6

re: Delphi DLL won't run w/ Delphi or BP7  but runs with VB and Word6  

Hi all.

I've been having a real weird problem with Delphi.
Bascially, I wrote a Delphi DLL to do DDE stuff
which I was calling from elsewhere.
However, due to the problems, I've stripped out the DDE stuff
and the problems are still occuring.

Anyway, the symptoms for calling the JLX.DLL are on a W4W machine:
  1 when called from Delphi Test program(JLTEST) - nothing happens
  2 when Delphi Test program is run from the IDE I get a
    "can't step over unit" or the second time "Cant create windows
    processes error 15"
  3 when called from a BP7 exe (JLTEST2) - nothing happens
  4 when called from a VB3 program - works - although sometimes the DLL
doesn't
    unload.
  5 when called from MS word 6a works.

I tested a Win95 machine too. 1 and 3 *work* on the win95 machine.

Any clues or ideas anyone?
(Source included below for reference)
This is driving me nuts.

Thanx for any help!
Javy Llora
8)

btw I'm running Delphi.exe 1188864, 25-Apr-95 8:00

Quote
>>> JLX.DPR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Library Jlx;
{$F+}
uses
  WinTypes, Winprocs,
  Jlunit1 in 'JLUNIT1.PAS' {Form1};
{$R *.RES}
exports
 Zlinktest2;
begin
 MessageBox(0,'Hello','Hello',MB_OK);
end.
Quote
>>> JLUNIT1.PAS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

unit Jlunit1;
{$F+}
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, DdeMan;
type
  TForm1 = class(TForm)
    DdeClientConv1: TDdeClientConv;
    DdeClientItem1: TDdeClientItem;
    Label1: TLabel;
    procedure DdeClientItem1Change(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
  Res: String;

  procedure zlinktest2; export;
implementation
{$R *.DFM}
var
 count: Integer;
procedure TForm1.DdeClientItem1Change(Sender: TObject);
begin
 inc(count);
 label1.caption := DDEClientItem1.Text;
 ShowMessage('Change text=<' +DDEClientItem1.Text + '> '+IntToStr(Count) );
 Res:= DDEClientItem1.Text;
 if Res <> '' then
 begin
 Application.Terminate;
 end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ShowMessage('Result was <' + Res + '>');
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
  count := 0;
  DDEClientITem1.DDEItem := '';
  DDEClientConv1.SetLink('OM','DDE');
  If NOT DDEClientConv1.OpenLink Then
    ShowMessage('Could not open link!');
  Application.ProcessMessages;
  If NOT DDEClientConv1.PokeData('txtOBJCD','') THEN
    Showmessage('Coult not poke!');
  Application.ProcessMessages;
  DDEClientITem1.DDEItem := 'txtOBJCD';
  Application.ProcessMessages;
  DDEClientConv1.ExecuteMacro('OBJLOOKUP',True);
  WHILE DDEClientConv1.WaitStat DO
    Application.ProcessMessages;
end;

procedure zlinktest2;
begin
 showmessage('link2');
end;

begin
end.

Quote
>>> JLTEST.DPR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

{ Delphi test program }
program Jltest;
uses
  Dialogs,Forms,
  Jltestu in 'JLTESTU.PAS' {Form1};
{$R *.RES}
begin
  Application.CreateForm(TForm1, Form1);
  showmessage('loaded');
  Application.Run;
end.
Quote
>>> JLTESTU.PAS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

unit Jltestu;
{$F+}
interface
uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
function  zLinkTest(A:PChar):Boolean; external 'JLX';
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
  Showmessage('Hello');
  zLinkTest('Boo');
  Showmessage('Bye');
end;

begin
end.

Quote
>>> JLTEST2.PAS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

{BP7}
PROGRAM jltest2;
USES wincrt;
{$F+}
PROCEDURE zLinkTest2; external 'JLX';
BEGIN
 writeln('hello');
 readln;
 writeln('begin');
 zLinkTest2;
 writeln('end');
END.

Quote

   __   / \        | Javy Llora  (-:
  /  \_|    \      | Golden 3 Technology
 /         -->*<-- | j...@ozemail.com.au
|              )   | 100251,336 CompuServe
 \     __     /    | 61-7-38492370 Voice
  \__ /  \__/      | 61-7-38492375 Fax