Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report form and the world wide web
Message
General information
Forum:
Visual FoxPro
Category:
ActiveVFP
Miscellaneous
Thread ID:
00873522
Message ID:
00873845
Views:
22
Claude,
I got it working with createobject() and I am again very happy.
I still can't get it to work using newobject() but I am going to try not to worry about that for now.
Thanks for your help Claude.

Sincerely,
Einar

>"NEWOBJECT( ) makes it possible for you to create a new class or object without opening a .vcx visual class library or procedure file." Other than this, I think they're interchangeable. IOW, newobject should work as well, but, if it doesn't, go with createobject...
>
>
>>Claude,
>>Thanks for the reply. I will try createobject() when I get back to work tomorrow.
>>Now here is a follow up question: What is the difference between newobject() and createobject()? I have read the help file entries for both but the difference does not seem clear to me (they use the same example, createobject(excel.sheet) and newobject(excel.sheet)).
>>
>>Also could you give me a brief explanation why createobject() would work and newobject() will not work when called from the vfp mtdll? (this might be answered in your answer to my question).
>>
>>Einar
>>
>>>Einar,
>>>Create a COM .Exe server with the "Report Form .. " in it and the PDF stuff. Then, from the vfp mtdll:
>>>
>>>lcFileID=SUBSTR(SYS(2015),3,10)+[.pdf]  && give PDF a temp file name
>>>lcFile=SUBSTR(oProp.AppStartPath,1,ATC([AVFPdemo2],oProp.AppStartPath)+8);
>>>			+[r\pdffiles\]+lcFileID  && full path
>>>oPDF=CREATEOBJECT("PDFrun.AVFPpdf") &&PDFrun is the EXE server,AVFPpdf is the class
>>>oPDF.start(lcFile,NVL(oRequest.Form("Company"),"")) && the START method runs it
>>>lcNewPath=SUBSTR(oProp.ScriptPath,1,ATC([AVFPdemo2],oProp.ScriptPath)+8);
>>>			+[r/pdffiles/]+lcFileID  && URL for created file
>>>oResponse.Redirect(lcNewPath)  && redirect browser to created file
>>>
>>>
>>>>I found this article from M$:
>>>>http://support.microsoft.com/default.aspx?scid=kb;en-us;191639
>>>>So I went ahead and created an exe to handle printing to pdf using a pdf printer driver.
>>>>Now my first attempt was to create a simple exe that accepted two parameters and did the printing based on that. I used the run command from within my ActiveVFP DLL. This worked good.
>>>>Then I started thinking (scary huh) what if I created a class and built it into an exe and used newobject() from within my web DLL. Now I was very happy because it worked great from the command window, but when I tried it from within the web DLL I got the same error as if I would have issued report form. I guess this kinda makes sense to me why it happend but feel free to explain it to me if you know exactly why it happends.
>>>>
>>>>Well anyways my question is: What is the best way to call/run/execute an exe from within the web DLL?
>>>>
>>>>
>>>>
>>>>Thanks,
>>>>Einar
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform