Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NEWOBJECT bug...
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00641141
Message ID:
00641149
Views:
25
Try to change .PRG to .FXP

>I have an application consisting of multiple executables. Here are the major ones:
>
>**Interface tier executables
>InterfaceManager.exe
>Interface.exe
>ServiceInterface.exe
>
>**Middle tier executables
>Service.exe
>ServiceManager.exe
>ServiceNavigator.exe
>
>The application is designed to run in two modes:
>1) Standard - all executables are on the client workstation.
>2) DCOM - Middle tier executables run on Windows2000 server.
>
>
>IF APP_DCOMMODE
>  THIS.oServiceManager = CREATEOBJECTEX("ServiceManager.Service_Manager","DataDealer.bdsoftware.com","")
>ELSE
>  IF APP_LOADEXECUTABLE
>    THIS.oServiceManager = NEWOBJECT("Service_Manager","ServiceManager.exe")
>  ELSE
>    THIS.oServiceManager = NEWOBJECT("Service_Manager","c:\main_ServiceManager.prg")
>  ENDIF
>ENDIF
>
>
>The above works fine.
>
>Now I created another project to compile all classes into one executable. Since the program containing "Service_Manager" class would no longer be SET MAIN I needed to add the program file name to the NEWOBJECT(). This, I thought would work fine because the program will always be the same "main_ServiceManager.prg" regardless of the executable it is in. I then created a constant EXE_SERVICEMANAGER that I set to the appropriate executable for the build. Here's the code:
>
>
>IF APP_DCOMMODE
>  THIS.oServiceManager = CREATEOBJECTEX("ServiceManager.Service_Manager","DataDealer.bdsoftware.com","")
>ELSE
>  IF APP_LOADEXECUTABLE
>    THIS.oServiceManager = NEWOBJECT("Service_Manager","main_ServiceManager.prg",EXE_SERVICEMANAGER)
>  ELSE
>    THIS.oServiceManager = NEWOBJECT("Service_Manager","c:\main_ServiceManager.prg")
>  ENDIF
>ENDIF
>
>
>The NEWOBJECT call errors saying, "File 'main_servicemanager.prg' does not exist."
>
>Well it does exist in the executable. I've tested various combinations and this appears to be a legitimate BUG.
>
>Errors - "File 'main_servicemanager.prg' does not exist."
>
>loService = NEWOBJECT('AppService_manager','main_servicemanager.prg','ServiceManager.exe')
>
>
>Works with a visual library:
>
>loService = NEWOBJECT('interface_container','_interface.vcx','Interface.exe')
>
>
>Works when program is SET MAIN in a project
>
>loService = NEWOBJECT('Service_manager','ServiceManager.exe')
>
>
>Works without executable
>
>loService = NEWOBJECT('Service_manager','c:\main_servicemanager.prg')
>
>
>I think I can get around it be adding SET PROCEDURE in the SET MAIN program. Of coarse this adds more changes required to move from one mode to another which sucks.
>
>My beef is things this apparent NOT working as documented. To me it seems if someone took the time to document a function they would also make sure the function performs as the document states.
>
>Does this frustrate anyone else?
>
>Will
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform