Issues with VB6 FDFToolkit on a VB6 (not .net) application - vba

Started a new job where I'm working on all sorts of legacy apps - I came across one which is a VB6 (not .net) one. Its using Adobes old FDFtoolkit (again, not the one found at fdftoolkit.net) which can only be registered on a server.
Problem is, sometime over the past few years the FDF to PDF converter stopped working.
My issue, I'm pretty sure its a .dll issue - on the server FDFTK.dll and FDFACX.dll are in the Windows/SysWOW64 folder.
I don't know if their location is incoherent with where the legacy application is looking. When I'm in Visual Basic 6 (the IDE) it looks for references in the Windows\system32 folder.
Any thoughts? I ask because I don't have direct access to the server so its slow going to 'guess and check' lots of options.
EDIT: Also the server holding the .dll is a windows server 2003 (however the server passing it the fdf is a windows server 2008)
Its like a puzzle!

On 64 bit systems Windows secretly redirects calls of 32 bit programs from system32 to syswow64.
VB6 is 32 bit, everything needs to be 32 bit.
The only thing you can really do is reregister the dll. Most but not all com dlls self register.
Note using 32 bit tools.
c:\windows\syswow64\regsvr32 c:\windows\syswow64\dllname.dll

Related

Automating MS Word in Server 2012 R2

Firstly, please don't reply with the generic advice not to automate Word on a server or a link to the MS web page on "how to automate word on a server if you really must". I am aware of this.
I have a process which runs as a Windows service and uses .Net OLE interop to automate Office (mostly just Open and SaveAs). This code has worked reliably for 8 years on literally hundreds of servers using many combinations of Windows and Office versions, both 32 and 64 bit, so I am happy that the mechanism is reliable. So far...
With Server 2012 R2, it works with PowerPoint and Excel but fails trying to open a word document:
System.Runtime.InteropServices.COMException (0x800A16A0):
The file appears to be corrupted.
at Microsoft.Office.Interop.Word.Documents.Open...
My observations so far which may or may not be relevant:
fails on all documents
works fine in Windows 8.1
the same problem has happened both on a customer site and in our test environment, so is unlikely to be purely environmental
my application is using .Net 3.5
the code is linked against the 2003 Interop assemblies (obviously later office versions are supported by assembly binding redirection)
we have tried it with office 2013 both 32 and 64 bit with the same results, but not tried earlier versions of office
it fails whether the service is running as LocalSystem or as a standard user account
if we run the service process in the foreground (i.e. literally double-clicking on the executable) the problem does not happen
Obviously I still have things to investigate but interested to hear if anyone else has seen this specific problem even if you haven't solved it. Please note there are many difficulties and problems with office automation so unless your symptoms are very similar to mine, you probably don't have the same problem.
Same issues here but got this fully resolved now.
I have a Word 2013 in combination with Windows 2012 R2 Server running in a service process which does everything I want without the need of a interactive session to be started. I use this to convert documents to PDF files. Inside the Windows service I host a WCF service.
Create folders: (replace System32 with Syswow64 depending of you use x86 or x64 bit edition)
C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌he
C:\Windows\System32\config\systemprofile\Desktop
Last and most important step!
Start - run - dcomcnfg.exe
Open properties -> Component Services - DCOM Config - Microsoft Word 97 - 2003 Document (Note that the version is not mentioned here but that does not matter Office 2013 will use this as DCOM config)
Open tab Identity. Configure the run as a the local Administrator account. I did some tests Word 2013 will work just fine even if no interactive session is started for the user.
We(My Company) are currently facing the same problem, it is pretty much a carbon copy of your problem. We have completed extensive testing around this area and I am now in talks with MS support engineer trying to find a work around.
Unfortunately this is something they don't want us doing, I think they have tightened security on the Windows Server 2012 to stop people from doing this.
What we have tried which should help you:
Server 2012 | Word 2007 | Failed
Server 2012 | Word 2010 | Failed
Server 2012 | Word 2013 | Failed
Client 8.1 | Word 2013 | Failed
Our problem stems from the fact we are running word with a user who isn't associated with the LOCAL system user(i.e. the type of user you have when you are logged into the machine) Windows will just not allow this to happen anymore.
Myself and the MS Engineer are working on "Fooling" windows into thinking it is running Word as a local service, however the MS Engineer said it was a long shot at best and so far everything we have tried has resulted in failure. It's not looking good.
Sorry I don't have an answer for you, but I suppose its good know you are not alone?
I had the same problem with MsOffice 2010 (32bits) and Windows Server 2012R2 (64bits). Word, Excel, Powerpoint don't work with localAdmin.
I created the folder C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌​he like Andy did and it now work perfectly !
Thanks Andy :)
My service use MS Word for data merging and concatenations functions.
I'm using Word 2016 on Windows Server 2012 R2 .
My log says that Word is opened but when the document is opened is throwed an error.
I've first created all the 4 folder suggested:
C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌​he
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌​he
C:\Windows\SysWOW64\config\systemprofile\Desktop
Only after creating the last directory the problem was solved.
I've not used DCOM config; my application use an user account with administration priviledges; there was no need to use LocalSystem account with "interaction with desktop" options.
Thank you.
We had a working solution for this for quite some time. However the solution broke when we tried to install it on a fully updated 2012 RTM R2 Server. On a 2016 Server we don't see this issue.
In order to make it work again on Windows 2012 R2 Server and also in a none interactive desktop environment:
Follow these steps!:
Actions to solve the issue on a Windows 2012 Sever R2 which is fully updated by Windows update:
Start - Run - mmc comexp.msc /32
Expand: Component Services – Computers – My Computer – DCOM Config
Search for: Microsoft Word 97 – 2003 Document
RMC – Properties – Go to tab: Identity
Set from “The launching user” to “This user”.
Use a “local Administrator account” which has once singed in to the server machine and has opened Word at least once in an interactive desktop.
Last step: REBOOT THE SERVER! And use a new document name to test your solution again.
Like known and said in the other answers these folder need to be created and accessible by the calling user (local system) normally or the user you configure in the prev steps.
C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌he C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWow64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌he C:\Windows\SysWow64\config\systemprofile\Desktop
Thanks for all the help OP and contributors. After creating the INetCache folder it worked out for me. I have done the following to get everything working without an active session(WS2012 R2 / MS Office 2013 64x):
Create a local admin user and log in to setup any printers(printing to file) as well as default word options.
Point the DCOM config identity to the local admin user created.
Create the following file :C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCac‌​he
For some machines you need to run " mmc comexp.msc /32 " to set the DCOM setting for MS Word. I found that we needed to do this when 32 bit version of Word was installed only.
I've just been going nuts to sort this and have tried numerous solutions. I finally resolved this by changing the Identity to "This User". I then used the account that my app pool ran under and also had to add this user the "Administrators" group..
Phew... hope this helps someone too.

COM+ component slower on 64 bit server

I have just migrated ASP website and COM+ component from old server to new 64 bit win 2012 server. But One of the functionality where we upload the file onto the server has become very slow. We have used SoftArtison's FileUp assembly.
Same website and component deployed on winxp takes 1 minute to upload the file, and on win 2012 64 bit server about 20 minutes. On winxp FileUp assembly used is older version.
I have just ran out of ideas as on what to do and what could be cause.
Thanks. But the issue was not related to SoftArtisans FileUp. The issue was regarding the COM+ VB component. Actually I have found the root cause. There was high level string manipulation (split, substring, trim, append, concat) happening while generation of XML and VB does not have StringBuilder, so this was using up lot of memory and consuming time as well. I have moved the XML generation logic to .Net Comvisible dll, deploying the same in GAC and calling dll from VB code. And it is working very quickly now.

How to use Modi without installing 2003 office web

I use modi to do OCR.
Then I want to install the same program on my webserver. Obviously you can't install microsoft 2003 on hostgator hosting.
The problem is, of course, the program need to refer to modi.dll.
I saw several files here:
Interop.MODI.dll (what is this file anyway a wrapper)?
MDIVWCTL.DLL this seems to be the real .dll
In my program if I tried to add reference to mdivwctl.dll I got this error:
A reference to 'D:\business\shared\dropbox\Dropbox\badgers\dotNet\Thumbnailer\WebApplication1\MDIVWCTL.DLL' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
My programmer can add that but only in his computer.
Basically I want the dll to function by itself without registering, etc.
How to achieve that? How do I upload the program to windows shared hosting using asp?
I have a Desktop based application that is using MODI for OCR. At the time of writing the application, 4 months ago, I did some good amount of research into this area. I gave up after a while and just installed the free Sharepoint 2007 which includes MDIVWCTL.DLL. It does not seem likely that you can surpass the requirements of the assembly, it might have references to other components.

VB.NET Windows 7 64bit Write File in C:\Windows\System32

I'm having a massive problem trying to write a file into the c:\windows\system32 directory. The code works fine on 32 bit machines, however does not work on 64 bit machines.
My user account is an administrator on the machine, and even right clicking and choosing to run the app as administrator does not solve the issue.
When writing the file, no exception is thrown, but the file is not written.
I have read various posts regarding adding an app.manifest file containing the requestedExecutionLevel node to my solution, but as yet am unable to get this to work. I have a feeling this may be because I'm using vb.net rather than c#.net
Has anybody encountered this issue before? I'd be delighted if somebody could provide an example VS2010 VB.Net project with a correctly configured app.manifest file as I'm a little unsure whether my attempts at setting this up are correct.
(also, this is not a malicious app I am writing, I'm working on a version control app for our team and need to be able to interface with IIS files held in c:\windows\system32\inetsrv\config).
Thanks
David
Maybe the file is written under UAC Virtualization and located under C:\Users\Username\AppData\Local\VirtualStore\Windows\System32
Windows Blog - Tips on what is going on behind the scenes.
TechNet - Look under Data Redirection
Under Local Sercurity Policies there is the following option which controls UAC Virtualization.

Looking for a working VBscript to pull back the Office 2010 Key

I work for a service provider and have custom VBscripts on all our supported machines that report back the machines Windows and Office keys. We found that since Office 2010 the method to return keys hasn't worked. From Googling I have found many scripts for Office 2010 but none of them seem to work. What I am looking for is a script that gets the Product Name and Product Key for Office 2010 and puts them into a variable (or two).
I have looked everywhere and googled till my fingers are bleeding but none of the ones I have found have worked. They either return nothing or the wrong key on multiple machines.
From your post it sounds like the scripts you downloaded works on some machines, but not on others, is that correct? If so, I'd check if this might be due to 32bit vs 64bit since there are some differences in registry access. If this is the case you might be able to use the scripts you've found, but just adjust them to look in different location depending on OS.
Otherwise, if you'd be able to use an external executable, then there are plenty of tools on the internet to do this, this one says that they have a command line interface (I've not tried it), that you might be able to automate from your script.
Otherwise I'd suggest downloading Process Monitor and have that running logging any writes to the registry while you install and register a copy of Office 2010 on the various versions of Windows that you support, this should give you the registry location, and then you could hopefully find the decryption algorithm somewhere.