I have a need to create an object to a DLL(vb6) that I created using MS VB6 editor in a classic ASP page.
set obj = Server.CreateObject("ProgID")
Now I was generally under the assumption that the program ID was the projectName.ClassName
That is now the person who was maintaining the code before me seems to have coded. And the application is working.
But when I try the same, IIS is not able to create an object. I did register the Dll and I'm running win 7 64 bit.
Any help is appreciated.
I apologize, I figured out the problem. I had missed giving the iis permission to the read the DLL. Also the DLL was a 32 bit DLL and I had to change the iis settings to accept 32 bit DLLs.
So to answer my own question, the program ID is projectname.classname.
Related
I recently programmed a Windows Form Application on one laptop, however, when I attempt to run the executable on my client's PC it won't open. There are no error messages generated, it just won't open.
The only thing in use that wasn't built into VS2015 was Telerik UI for winforms and the application is a standalone exe.
Any suggestions?
I finally got this sorted a couple of days ago. After a LOT of fiddling about I realised that it was indeed to do with the references. After consulting the Telerik Documentation (as Chris suggested) I realised that, indeed, the dlls were stored in the GAC (something I'd never heard of) and not actually automatically packaged with the software. So I editted the program file options so that they were included and problem solved! Thank You all for your help and sorry the original question was so badly written, I had no idea what data it would have been relevant to include
so my question is relatively simple, can I create VB6 application that references a class in a dll, and then substitute that dll for another at runtime?
Now my intial guess is... no chance in VB6.
So my thoughts turned to a VB.net interop dll. Could I do it in here, and then call the interop dll from the VB?
Again, my guess would be no.... but I'd be happy if someone knew differently.
The only thing that I think would actually work would be DI in .Net, but I'm limited to .net 2, or 3.5 at a big push, so I dont know if that is possible.
So for the background....
I have a dll that a specific site uses, but we dont want to ship that out to everyone. Instead, we want to build a clone dll which just has the interfaces setup so that the VB6 build will complete.
When it gets to the site that needs it, they want to replace the dummy dll, and drop in their version instead.
Note: We do use RegFreeCOM when its gets installed, so I do have the manifest files that I could play around with if needed.
Any ideas would be much appreciated.
Nick
Its a COM dll so its not statically linked to the VB6 exe, so long as the clsids and interface ids are the same in the type library for both DLLs, you can swap them around as you see fit. (If its a VB6 dll this is trivial to do with the 'binary compatibility' build option)
You could also use late binding instead and instead of making a reference directly in your VB6 code, you would create an object and then set that object to an instance.
Examples and information:
MVPS
Microsoft
I have a DLL and its TLB which works in VB6. I added a reference to the DLL and code to use it. The program builds without an error but gives me a runtime error:
The type initializer for "the dll name" threw an exception.
I am guessing I need to register the DLL or something but do not know how to proceed. BTW, both the DLL and TLB are in my project directory.
Any advice is greatly appreciated.
TIA,
John
Thanks for your response Hans. I may not have been clear. I am not programming in VB6. I inherited the DLL (and do not have the source code) and the client wants me to use it in my VB.Net application. I do not have a way to debug the DLL unless I can do that in VS2008.
Thanks,
John
You're going to need to create an Interop layer between your.Net app and the VB DLL.
Take a look at:
http://msdn.microsoft.com/en-us/library/z6tx9dw3(v=vs.85).aspx
I have a 64-bit project(which has to be 64-bit as it is an Outlook 2010/64 bit addin) that needs to interface with another Dll of mine, whose job it is to scrape file metadata out of files using the windows Shell32 dll. Now, as you may of guessed, this is posing compatibility problems as I am crossing that 64/32 bit boundary.
I read an article (ok skimmed it, whatever) and from what I understand, it suggested that I use COM as an intermediary and to bridge this gap. So, My question is, can I build a shim DLL in say VB6 (i know, i know) that would act as my com reference and pass the calls on to my 32-bit dll from my 64-bit addin? Can I do this? Has anyone done this? and most importantly, can someone SHOW me how to do this.
Do I create a VB6 COM Dll, reference my .NET assembly and pass all Public functions out via a similar interface, then reference the VB6 dll in my 64-bit addin? is it just that easy?
Thanks for the sanity check..
Andrew
Not sure that this is a valid programming question ... but is it possible to program infa red using vb.net express (iRDA) Got a programming project in my mind, but none of the coding examples work, IrDAClient never gets recognised
Cheers
It's a valid question but it needs to be a bit more specific. VB.Net can certainly be used to program against IRDA. There is nothing preventing you from using IrDAClient with VB.Net.
We do need to know though what problems you are having? Can you post the samples that are giving you trouble or tell us what errors you are seeing?
EDIT Update to comments
There is nothing that will prevent you from writing a program targeting IRDA from VB Express. What you appear to be missing is a reference to the DLL that contains the IrDA libraries. You'll neeed to add a reference to System.Net.Irda.dll. It will be in the following directory (assuming your programming to Windows CE)
C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE
EDIT2
I may be wrong about the ability of VB express to program against a device project. I don't have any 2008 express builds on my machine to verify right now.
The IrDAClient class is part of the .Net Compact framework. I'm not sure if it's possible to use it on a desktop machine.
You can at least add the reference by searching for the file System.Net.IrDA.dll. On my system it was under: Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE
If it's not present you may be able to download it here: http://msdn.microsoft.com/en-us/netframework/aa497280.aspx