Discussion:
multiple exe
(too old to reply)
Wilson Thomas
2004-08-04 07:26:35 UTC
Permalink
Thanks for the info. I have created multiple project like main project with
code, all forms in another project and all reports in a third project. But
it does not work as expected.

E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.

DO allreports.exe WITH "emp_list"

Strat up program in report exe is
------
LPARAMETERS cReportName

IF TYPE('cReportName') = "L"
RETURN
ENDIF

cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.

If this way is not possible, any other alternative

Regards

Wilson
Hi,
DLLs created with VFP are not function libraries as you can create them
with
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
to instanciate an OLEPUBLIC class within that dll to access code within
the
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually interact
with the user. If you want your library to visually interact with the
user,
you'll have to compile the secondary project to an EXE or an APP. This
gives
you the possibility to have a completely other design because now you can
have a main startup program or form which starts when you activate the app
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other app-file
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which makes
us
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
would be a great help
rgds
Wilson
Lee Mitchell
2004-08-04 17:50:31 UTC
Permalink
Hi Wilson:

You say "But it does not work as expected." What do you mean? Do you get an
error? Is the wrong data printed? Do you not see the preview window?

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project with
code, all forms in another project and all reports in a third project. But
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create them
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually interact
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you can
have a main startup program or form which starts when you activate the app
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other app-file
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which makes
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Wilson Thomas
2004-08-05 05:35:36 UTC
Permalink
When I execute this command "DO allreports.exe WITH "emp_list"", the program
starts. But I get the error message as the file "emp_list" does not exist.
But this file is added/included in allreports.exe.

Hope it is clear
Post by Lee Mitchell
You say "But it does not work as expected." What do you mean? Do you get an
error? Is the wrong data printed? Do you not see the preview window?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project with
code, all forms in another project and all reports in a third project. But
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create them
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually interact
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you can
have a main startup program or form which starts when you activate the app
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other app-file
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which makes
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Lee Mitchell
2004-08-05 17:56:17 UTC
Permalink
Hi Wilson:

Does this exe work if you call it from the VFP Command window with the
Do... WITH syntax?

Does adding a SYS(2450,1) to the main program of the exe help?

If you exclude the report and place the FRX and FRT files in the same
folder as the allreports.exe does it work?


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
When I execute this command "DO allreports.exe WITH "emp_list"", the program
starts. But I get the error message as the file "emp_list" does not exist.
But this file is added/included in allreports.exe.
Hope it is clear
You say "But it does not work as expected." What do you mean? Do you get an
error? Is the wrong data printed? Do you not see the preview window?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project with
code, all forms in another project and all reports in a third project. But
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create them
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually interact
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you can
have a main startup program or form which starts when you activate the app
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other app-file
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which makes
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Wilson Thomas
2004-08-06 02:21:53 UTC
Permalink
I cannot call Allreports.exe in command window becuase it shares classes and
connection string to database in main.exe

What is this SYS(2450,1). Is that available for VFP6?

I tried to copy file to the same folder, still not locating the file.

If I add reports to main.exe (ie. only one exe for all), it is working fine.

Regards

Wilson
Post by Lee Mitchell
Does this exe work if you call it from the VFP Command window with the
Do... WITH syntax?
Does adding a SYS(2450,1) to the main program of the exe help?
If you exclude the report and place the FRX and FRT files in the same
folder as the allreports.exe does it work?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
When I execute this command "DO allreports.exe WITH "emp_list"", the
program
Post by Wilson Thomas
starts. But I get the error message as the file "emp_list" does not exist.
But this file is added/included in allreports.exe.
Hope it is clear
You say "But it does not work as expected." What do you mean? Do you get
an
Post by Wilson Thomas
error? Is the wrong data printed? Do you not see the preview window?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Wilson Thomas
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project
with
Post by Wilson Thomas
Post by Wilson Thomas
code, all forms in another project and all reports in a third project.
But
Post by Wilson Thomas
Post by Wilson Thomas
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create the
m
Post by Lee Mitchell
Post by Wilson Thomas
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually
interact
Post by Wilson Thomas
Post by Wilson Thomas
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you
can
Post by Wilson Thomas
Post by Wilson Thomas
have a main startup program or form which starts when you activate the
app
Post by Wilson Thomas
Post by Wilson Thomas
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other
app-file
Post by Wilson Thomas
Post by Wilson Thomas
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which
makes
Post by Wilson Thomas
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Lee Mitchell
2004-08-06 17:36:30 UTC
Permalink
Hi Wilson:

No, the SYS(2450) is not available in VFP 6.0. It was added later to
control where an exe looks for file.

I wonder if your problem with reports is related to this problem with
classes in a VFP 6.0 executable.

253879 BUG: Forms Cannot Find Class Library When Calling .Exe File
http://support.microsoft.com/?id=253879


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/

*-- VFP8 HAS ARRIVED!! --*
Read about all the new features of VFP8 here:
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
Purchase VFP8 here:
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
I cannot call Allreports.exe in command window becuase it shares classes and
connection string to database in main.exe
What is this SYS(2450,1). Is that available for VFP6?
I tried to copy file to the same folder, still not locating the file.
If I add reports to main.exe (ie. only one exe for all), it is working fine.
Regards
Wilson
Does this exe work if you call it from the VFP Command window with the
Do... WITH syntax?
Does adding a SYS(2450,1) to the main program of the exe help?
If you exclude the report and place the FRX and FRT files in the same
folder as the allreports.exe does it work?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
When I execute this command "DO allreports.exe WITH "emp_list"", the
program
Post by Wilson Thomas
starts. But I get the error message as the file "emp_list" does not exist.
But this file is added/included in allreports.exe.
Hope it is clear
You say "But it does not work as expected." What do you mean? Do you get
an
Post by Wilson Thomas
error? Is the wrong data printed? Do you not see the preview window?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Wilson Thomas
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project
with
Post by Wilson Thomas
Post by Wilson Thomas
code, all forms in another project and all reports in a third project.
But
Post by Wilson Thomas
Post by Wilson Thomas
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create the
m
Post by Wilson Thomas
Post by Wilson Thomas
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually
interact
Post by Wilson Thomas
Post by Wilson Thomas
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you
can
Post by Wilson Thomas
Post by Wilson Thomas
have a main startup program or form which starts when you activate the
app
Post by Wilson Thomas
Post by Wilson Thomas
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other
app-file
Post by Wilson Thomas
Post by Wilson Thomas
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which
makes
Post by Wilson Thomas
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Sietse Wijnker
2004-08-06 06:40:35 UTC
Permalink
Hi Wilson,

You're calling the emp_list report from the allreports.exe. Is the report
included in the allreports program?
Have you tried a ?FILE("emp_list.frx") in the program to check if it can
find the file?
Also print out the SET("PATH"), just to be sure...

Other debugging-tip:
-Try to call the report-start-program from your development environment with
the correct environment set up.

HTH,
Sietse Wijnker
Post by Wilson Thomas
When I execute this command "DO allreports.exe WITH "emp_list"", the program
starts. But I get the error message as the file "emp_list" does not exist.
But this file is added/included in allreports.exe.
Hope it is clear
Post by Lee Mitchell
You say "But it does not work as expected." What do you mean? Do you get
an
Post by Lee Mitchell
error? Is the wrong data printed? Do you not see the preview window?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Post by Lee Mitchell
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 Public Beta Now Available!! --*
Download the VFP9 beta here: http://msdn.microsoft.com/vfoxpro/
*-- VFP8 HAS ARRIVED!! --*
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by Wilson Thomas
Thanks for the info. I have created multiple project like main project
with
Post by Lee Mitchell
Post by Wilson Thomas
code, all forms in another project and all reports in a third project.
But
Post by Lee Mitchell
Post by Wilson Thomas
it does not work as expected.
E.g., to print a report "emp_list" report, I pass the parameter from the
main program to the report exe, which contain a start up program and all
reports included.
DO allreports.exe WITH "emp_list"
Strat up program in report exe is
------
LPARAMETERS cReportName
IF TYPE('cReportName') = "L"
RETURN
ENDIF
cReportName = ".\reports\" + ALLTRIM(cReportName)
REPORT FORM &cReportName PREVIEW
--------
Any help would be appreciated.
If this way is not possible, any other alternative
Regards
Wilson
Hi,
DLLs created with VFP are not function libraries as you can create them
with
Post by Wilson Thomas
f.i. C++. The dll files in VFP are COM-components (single-or
multi-threaded). This means that when you create a DLL with VFP you'll
have
Post by Wilson Thomas
to instanciate an OLEPUBLIC class within that dll to access code within
the
Post by Wilson Thomas
library.
FI
DEFINE CLASS SayHello AS Custom OLEPUBLIC
PROCEDURE SayHello(cString)
STRTOFILE(cString, "log.txt")
ENDPROC
ENDDEFINE
Save the following code to SayHello.prg and compile the dll using
BUILD PROJECT SayHello FROM SayHello.prg
BUILD DLL SayHello.dll FROM SayHello
in the command window (BTW. I'm using a single threaded dll here, to
create
Post by Wilson Thomas
a multithreaded dll use BUILD MTDLL)
There's a good piece of info in the VFP help on 'Creating Automation
Servers'
Problem you'll find is that COM-components in DLL CAN'T visually
interact
Post by Lee Mitchell
Post by Wilson Thomas
with the user. If you want your library to visually interact with the
user,
Post by Wilson Thomas
you'll have to compile the secondary project to an EXE or an APP. This
gives
Post by Wilson Thomas
you the possibility to have a completely other design because now you
can
Post by Lee Mitchell
Post by Wilson Thomas
have a main startup program or form which starts when you activate the
app
Post by Lee Mitchell
Post by Wilson Thomas
or exe (do 2ndappfile.exe)
You can also use SET CLASSLIB to refer to a classlib in the other
app-file
Post by Lee Mitchell
Post by Wilson Thomas
HTH,
Sietse Wijnker
I am using VFP 6. My EXE file is getting bigger and bigger, which
makes
Post by Lee Mitchell
us
Post by Wilson Thomas
hard to send file via email for support. So we have decided to use DLL
projects for easy support.
To test functioning of DLL's I have created a small project with a
function
to display "Hello World" and used the following command to call, but
giver
Post by Wilson Thomas
error "Cannot fing the entry point SayHello in the dll".
This is the program
-----------
SayHello() && Calling the function
FUNCTION SayHello
=MESSAGEBOX("Hello World 123")
ENDFUNC
-----------
Command issued is
--------------
declare SayHello in test1.dll
?sayHello() **** gives error *****
---------------
Any help would be appreciated.
If anyone can forward a small project like this to demo dll function,
that
Post by Wilson Thomas
would be a great help
rgds
Wilson
Loading...