How to make Excel references non-absolute using REGASM32 (early binding) - excel

I have a requirement to create a new installed for an Excel add-in. I've created many of these and this question is not necessarily about the install building process. It is about how to properly reference a .dll in Excel so that it can be referenced on the receiving machine properly.
The Excel add-in references (tools/references) the file ZOPLib.dll (a .net dll of our own design). It references it in C:\folder A. We used REGASM32 to register the .dll and everything works fine on the development machine. Moving the add-in over to a VM I place the ZOPLib.dll in C:\folder B and register it there.
Because the add-in was pointed at C:\folder A, even though I REGASM32 the dll, the addin fails to find it (the dll). I have to REGASM32 /uninstall the dll, REGASM32 register it in C:\folder B and then go into the add-in and tell it that the dll is in C:\folder B.
Why is the link to the dll absolute?
How can I make Excel reference this dll or register it in such a way that the add-in can find it in the new folder?
If I can get the .net developer of this dll to produce it as an activex dll, would that relieve my trouble?
InstallShield does not handle registering dlls that are not activex/ocx because it uses REGSVR32.
Thanks for any help!

Related

accessing COM Dll from VC ++ Win32 Windows form in VS2008

I was trying to use a COM DLL written VC++ in VB 6 with the help of this Article - http://www.codeproject.com/Articles/8745/A-Beginner-tutorial-for-writing-simple-COM-ATL-DLL
I have created the COM Dll as well as VB forms and the project works fine.
Now I am trying to use the same COM dll in a Win32 Windows forms application written in VS2008.
I have created a similar form to that of vb, I have added the reference of COM Dll to the project.
I would like to know how to use the same Get and Put functions in VC++.
Any pointers towards related tutorials or any info on how to do it would be helpful. Thanks in advance

Is there a way to figure out, in retrospect, what features the App Wizard selected for my vc++ 2010 mfc application?

I an a novice VC++ programmer. I like my recent application's exe file but stupidly forgot to note all of the choices that I specified to the Wizard (project "style", shared DLL vs static library, etc). How can I get this information?
The project "style" is MFC Appliction if it generates an exe file. Library projects do not generate an exe file.
Beyond that, choices such as application type and type of menu/ribbon can easily be seen by using the wizard to create a bunch of MFC apps with the various options.

How to patch .NET dll to the GAC using InstallShield QuickPatch?

I'm trying to patch a .NET DLL file using the Quick Patch project of InstallShield. The DLL needs to be registered for COM Interoperation.
When I patch the file, the dll seems to be replaced correctly in the GAC, but when I try to access it from my application I get an error indicating that the application cannot connect to the DLL.
I think that it is not being registered properly for COM interop, but I'm not sure about it.
Any idea of what should I do to make it work?
Thanks,
You probably have to run regasm(it's in .NET framework directory) with correct params to register for com interop. Also the DLL file is usually built with certain COM visible options selected. Been a long time since I dealt with that nightmare though, so can't remember all the details.
http://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.80).aspx

Visual C++ ATL Com registration issue

I have a Visual C++ 6 project that is creating a COM DLL. This is an old project that I have not used in years but I came back to it recently to update some functionality of the DLL. The issue I am having is that when I try to manually register the DLL (using regsvr32) that is created by the project, I get no response whatsoever. It does not say it succeeds and it does not say it fails. I have verified that the DLL is not being added to the registry. I have never seen a situation with regsvr32 when it would not show any confirmation message.
Also, the DLL is set to self-register in the project and when it attempts to do this, it also does not show a message.
I have not touched this project in a long time, but the last time I did touch it, it worked without issue. Now I come back to it, and all of the sudden I am having this problem. It is as if the DLL being created by the Visual C++ project is not compatible with the current version of Windows. I have updated the development software to SP6 but it has not changed the situation.
I ran Depends on regsvr32 when it was pointing to the created DLL, and it shows this message:
LoadLibraryExW("C:\Source32\BIS\Projects\ALFA\DigiPixSvc\DigiPixObj\Debug\DigiPixObj", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The operating system cannot run %1 (182).
Can anyone please tell me why this is happening and what I can do to correct it?
Disclaimer: since I don't have VS 6.0 installed anymore, I'll have to use some Google searches to give you the exact steps for the VC 6.0 dialogs - so some of this information may be inaccurate. I believe it's correct - it's really what you'd do in the current IDE, just for VC 6.0.
Before you go through the trouble of debugging your DLL, make sure you run it through Dependency Walker to verify that all your dependencies are on your machine. Don't run Dependency Walker on regsvr32 - what matters is whether your DLL has its dependencies. If they're missing, regsvr32 won't be able to load the DLL.
To see if your DLL is getting loaded by regsvr32 when you try to register it, you need to debug through the DLLRegisterServer() function and see what happens there - this is one of the 4 entry points a COM DLL must have and regsvr32 calls this function when the DLL is about to be registered. In order to do this, you'll have to set regsvr32 as the startup program of your project and pass the full path to your debug-built DLL as a command-line parameter to regsvr32.
Bring up Project Properties for your project.
Go to the Debug tab.
Make sure the General category is selected.
Enter the full path to regsvr32 in the Executable for debug session textbox.
Enter the full path to the debug version of your DLL in the Program arguments textbox. Make sure you have a PDB file for your DLL so you can see symbol information during debugging.
Put a breakpoint on the first line in DLLRegisterServer(). The code in this function may be long or short, depending on how it was created: generated by a wizard, written by a developer, etc.
Start debugging.
Your breakpoint should be hit and you should be able to step through the registration code and see at which point it fails.

How to make project exe,how to include all runtime dll files

How to include the windows runtime dll files in setup project.
without vc++ 6.0 software in the machine the project must execute.
or give me the hint how to make a the project setup(EXE) in vc++ 6.0 ,i am using create installor,
You can modify the project settings to link statically to the C runtime (I assume this is what you mean when you said windows runtime ?). The static link flags are:
MultiThreaded static linkage (/MT)
MultiThreaded debug static linkage (/MTd)
Sorry, been awhile since I used VC6.0, so I had to check the GUI. You'll find this in project settings, C++ tab, Code Generation combo box, "Use run-time library").
To add to what Cannonade has already said, if you are doing it through Visual Studio, then this can be done through Project Settings->General Page->Use MFC as a static library. This way your created exe will be ready to run on any windows box.

Resources