accessing COM Dll from VC ++ Win32 Windows form in VS2008 - visual-c++

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

Related

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

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!

VC++ : Difference between “MFC application” & Win32 Project with "Use MFC" as a Shared DLL/Static Library

Just started learning VC++, and in one of the video tutorial it initially shown and then skipped MFC wizard and started with win32 project and selected the "with Use MFC in a Shared DLL". So i checked the difference between the both (MFC & WIN32) in this link. There it said as "MFC builds upon Win32". Already two project types are there (MFC & WIN32). Then what is the meaning of "Use of MFC" in Win32 Project?
MFC is a library developed on top of Win32.
An MFC project can either link to the MFC static library or require the compiled e executable to run with the MFC dll alongside with it.
Win32 projects do not require MFC and using MFC is optional.

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

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