Visual C++ :: Using COM Without Registering?

Mar 5, 2013

In a C++ project, I need to call a C# created COM object (as a .dll)

Is there a way to use such a COM object without having it be registered in the registry?

The C# COM dll is just a "go between" our C++ code and a .NET library, there's no "COM contract" of any kind, the COM interfaces change each version. The fact it's COM and needs registration is annoying because it makes it hard to have multiple versions of our software installed (needed under some circumstances) and running at the same time.

I'd like a way to not have any registration at all. And just be able to do a LoadLibrary("c:TheRightPathcom.dll") of the right dll and then get going from there.

View 14 Replies


ADVERTISEMENT

Visual C++ :: Error In Registering Windows Class

Jan 28, 2013

The following code it taken from msdn library but it is failing to compile.

the following code has a header where all the variables used here are stored in header App.h.

The following lines are giving trouble:

Code:
DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About);
error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member

Code:
wcex.lpfnWndProc= &App::WndProc;
error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'

There is no context in which this conversion is possible

Here is the complete code:

#include "stdafx.h"
#include "App.h"
App::App(void) {
}
App::~App(void) {

[Code] .....

View 4 Replies View Related

Visual C++ :: Shell (Namespace) Extension Not Registering?

Dec 13, 2012

I have created a Namespace Extension (I hope so) by creating a ATL Project with MFC support as dll in Visual Studio 2010.

Now I have a Implementation of IShellFolder:

Code:
// ILCShellFolder.h: Deklaration von CILCShellFolder
#pragma once
#include "resource.h" // Hauptsymbole
#include "NewNSE_i.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)

[Code] ....

Not any of those IShellFolder Methods is being called... When I attach the explorer.exe process (which I know I can use to debug on other projects, just in case to exclude errors) it tells me that the DLL is not loaded by the explorer.exe process.

View 1 Replies View Related

C++ :: Creating Events And Registering To Them

Mar 16, 2014

I want to build a library using c++ which will serve as an abstraction layer between applications and low-level process. The library will provide some APIs for the applications for some purposes.

For example the low-level process, may send an indication to the library i.e. raise an event, and the library in turns send it to all the applications, which have their registered callbacks to this library.

Any example for the previous scenario in c++ using boost library or the standard library will be perfect in Linux environment? The example that I want is: Generate event from a process and pass it to the library, then let an application register callback to the library.

Initially I know in Linux, I may use signal to send events, but my plan is to have a something more general not tighten to a specific OS.

View 1 Replies View Related

C++ :: Print All Usernames After Registering With Text

Oct 28, 2013

this is my code, the program has to ask for the number of usernames I want to create, then you type the username and password. after you do it 4 times (maximum) it prints (make a button to print the list) the username and password of each

#include <iostream>
#include <fstream>
#include <string>

[Code].....

View 1 Replies View Related

C++ :: Parse Executable Files - Registering Types To Be Used At Runtime

Jul 30, 2014

I'm writing a program that needs to parse executable files. I've got an "executable" base-class, and currently an "elf" class which inherits from it for parsing ELF files, and I will add more parsers (COM, MZ, PE, a.out, MACH-O, whatever) later on.

I want the program to automatically detect which kind of executable it's loading at runtime. It should be easy because every executable format I'm aware of/plan to support starts with a magic number. But because I can't have the parsers not check the file type (what if I re-use the code?), and I don't want to check each file twice (not just for performance, but also because only the ELF parser should know that ELF files start with "x7fELF", etc.) so I've come up with a pretty lazy solution: just try to parse the file with each known parser and have them throw an exception ("exe_type_error") if they can't parse it. If that exception gets thrown, try the next parser; if not, stop.

The remaining problem is how, at runtime, my program will know what parsers are available. I don't want to hard-code it in the main function; instead, I'd like the parsers to "register" themselves as available. That way, if I decide to go down the route of adding new parsers via dynamic linking, I will only have to add an API for dynamic libraries to register their parser, without recompiling any of the main program's code. I also want to do the same thing for another key part of the program (it's a static executable optimizer; it will run a series of "tests" (e.g. "is xor eax, eax faster than mov eax, 0 on this machine?") and optimizations ("if yes, change all mov eax, 0 to xor eax, eax") and I want to load those at runtime too).

View 11 Replies View Related

Visual C++ :: PIC To PC Using MFC Visual Studio Through Serial Communication

May 28, 2014

The project is about reading data from PIC and display the data on the dialogue created by the MFC GUI of Visual studio 2010. There are 4 data need to be displayed (2 weight and 2 angle). the data will be display on the edit control box on the dialogue.

I have try to solve the COMPort and Readdata issues many times, but I'm fail. I have read many sources and implement the source codes... They are never work....

The detail about the issues that I need to solve is clearly mentioned on the main dialogue.cpp. Take a look to an uploaded zip file that I have attached.

View 6 Replies View Related

Visual C++ :: Cannot Seem To Set Var

Nov 8, 2012

What I'm trying to do is get the selected folder value put into my dirlocation var.

Code:
private void dirLocation_Click(object sender, EventArgs e) {
FolderBrowserDialog fdb = new FolderBrowserDialog();
fdb.Description ="Please choose the directory your .rlt files are located in";
if (fdb.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
dirLocation = fdb.SelectedPath;
}

Is this how you do it? I keep getting an error like Cannot implicitly convert type 'type' to 'type.

View 5 Replies View Related

C++ ::  How To Use QT With Visual Studio

Aug 15, 2014

I heard that you can't use it with express, but that doesn't seem right... Can you use it with Codeblocks, at least? I just hate the Qt Creator IDE. I don't like the UI... all I want to do is code Qt. I don't care much for the GUI editors.

View 10 Replies View Related

Visual C++ :: Create MFC OCX Using DLL

Aug 28, 2014

I am trying to create a OCX from a C++ dll., Here's the scenario I have a C++ dll and this dll needs to be called in VB.net program my boss want's me to create an OCX out of this.

C++ dll and use it in a VB.net class library, apparently I have created an OCX but it requires a form but the VB.net program is a class library.

View 5 Replies View Related

Visual C++ :: How To Convert IP To Hex

Sep 27, 2012

I don`t known how to convert IP to hex .

In this link [URL] .... . I see hex IP : Hex IP 0x462a1779

I want to convert IP "70.42.23.121" to "0x462a1779"

Code:
#include <winsock.h>
#include <windows.h>
#include <stdio.h>
UINT32 ip_to_hex(UINT32 ip_add) {
UINT32 ip_hex;
//code convert ip to hex
return ip_hex;

[Code[ ....

And this is result : 7b 1e 80 and a , not 0a

Further i think we must separate each octect by a (dot) . , Then convert decimal to hex.

View 6 Replies View Related

Visual C++ :: Value Of Pointers

Feb 5, 2013

I'm trying to figure out the value of pointers after the following code snippet

Code:
int s[8] ;
int *iptr1, *iptr2 ;
int **iptr3 ;
for (int i = 0 ; i < 8 ; i++)
s[i] = 7 - i ;

[Code] ....

I need to find what the value of iptr1, iptr2, and iptr3 are after the code is executed.

View 3 Replies View Related

Visual C++ :: OpenCV In MFC App?

Feb 5, 2014

I have a C++ app that uses OpenCV. Currently i am statically linking the OpenCV libs into my app. This is adding an extra overhead of 6+ MB.

i would like to remove some of the features that i am not using in OpenCV. The features am using are,

Capture frames from Webcam.

Face detection.

Image formats (JPEG, PNG).

Image rotation & resizing.

Is it possible to remove other features and trim down the libs?

My C++ app is developed in Visual Studio 2012.

View 1 Replies View Related

Visual C++ :: Using CSplitButton In VC6?

Dec 5, 2013

Is there any chance to use CSplitButton in VC6 ?

I had tried to use something appropriate founded on CP, but they are using DrawItem, and I had problems with windows style, and I had tried to make myself one, overriding OnPaint, but I front with flickering (I put the sample below)... so, I wonder if I could get (from somewhere) CSplitButton and add to my project ... if you say that I could, can you provide me the CSplitButton source code ? I mean, only .cpp implementation file ...

View 1 Replies View Related

Visual C++ :: How To Register ATL Exe COM

Apr 4, 2013

I created an EXE COM server with ATL.

and from the client (DLL COM with ATL) i want to create an instance of the EXE (CreateInstance(CLSID of the EXE)).

how do i register the exe so that i know the path to the com server.

View 2 Replies View Related

Visual C++ :: Map With Two Key Values?

Mar 29, 2013

I have an assignment where I need to go through all the files in a folder. For each file I need to know each unique file extension, how many files for each unique file extension, and the total size for each unique file extension. I have to be able to sort through this using either the file extension or the total size of the file extension. The first thing I thought of using was a map. This will keep track of each unique file extension and the amount of times that file extension was found. How do I now associate the total size of the file extension to my map? So for example I need the output to be something like this:

Using file extension for sort
.cpp : 1 : 3400
.exe : 3 : 3455600
.mp4 : 25 : 200000404

Using total file extension size for sort
.mp4 : 25 : 200000404
.exe : 3 : 3455600
.cpp : 1 : 3400

Here is the code I have so far:

Code:
#include <iostream>
#include <filesystem>
#include <map>

[Code]...

I was thinking of somehow using a class to implement this, but don't know how to go about doing that. A

View 1 Replies View Related

Visual C++ :: What To Do With OnNewDocument

Nov 29, 2012

I got a program from somebody. He had its initialization to run his program but never bothered to save the data for later use. Now I wanted to add the New, Open, Save, and Close to it, so I add OnNewDocument ahead of his program. It crashed every time I ran it.

Shall I include his initialization in the OnNewDocument? If I can not separate the initialization part from his code, e.g., they come in as dll, what shall do?

View 7 Replies View Related

Visual C++ :: How To Use C# With Excel

Jan 2, 2013

Is it possible to create an app that can be saved on my desktop that can be used with an excel file that is saved on my desktop? I have opened VS 2010 and I have created a form design that has a button for every sheet name in my excel file. All of the sheet names are hidden with the exception of one. When a button is pressed on the c# form, I would like for that sheet to be shown in excel. Then once the updates have been made to that sheet in excel, I want a button to be at the top of the excel worksheet that will hide that worksheet again and return to the form c# form...can that be done?

View 2 Replies View Related

Visual C++ :: Compiling On X86 CPU?

Apr 30, 2015

I'm compiling some open source code (originally written for Linux / gcc) which uses the following line to determine if a particular section is being compiled for an x86 processor:-

Code:
#if ( defined(__x86_64__) || defined(__i386__) )

neither of those seems to be defined by my ageing compiler (VC++ 8.0). What would be the equivalent for building with VC8 ?

View 6 Replies View Related

Visual C++ :: How To Set Focus After Using Alt Tab

May 22, 2014

Using mfc I have an application where I'm not allowed to use a mouse and alt+tab will be regularly used. Using alt+tab to come back to my application kills the focus in the view. Once my application comes back to the foreground how can I set the view as the focus?

View 3 Replies View Related

Visual C++ :: Lib Using OLE DB Template

Mar 19, 2013

My question contains two projects that are under the same solution.

Project_1: I have created a dll where I use inside the project, OLE Db Template. In the project, I use this code.

class MyClass {
public:
LONG _value1;
SHORT_value2;
BEGIN_COLUMN_MAP(Accessor)

[Code] .....

Project_2: Is a project testing the Project_1.

- I want to call one of the exported functions.
- In Linker/Addional Dependencies, I have added the .lib
- In Linker/Additional Libray Directories, I have added the directory where is the lib.
- In C/C++/General/Additional Include Directories, I have added the directory on project 1. I did that because I want to #include a header in Project_1. But, when I do that, I get:

Error1error C3646: 'COLUMN_ENTRY' : unknown override specifier
Error2error C2059: syntax error : 'constant'
Error3error C3646: 'COLUMN_ENTRY' : unknown override specifier

I have done it several time with other projects, but the first time with OLE DB Template. atl90.dll is registered.

View 1 Replies View Related

C++ :: Visual Studio Linker

Jan 4, 2013

I wrote a routine in one C++ file and I decided to break it up into some smaller more manageable C++ files. When I copied the variables out of the first one and into the new smaller file (same solution), everything compiles fine but I get a ton of linker errors saying the variables have already been defined in another (the previous) file. Using Visual Studio 2008.

View 5 Replies View Related

Visual C++ :: Add To Listbox Thread

Feb 15, 2015

Startthread get called to launch to update list box.

a)is it the only way to pass string to the PostMessage?. my concern is that allocate using new in each iteration each time slows it down a bit.

b)does OnAddToListBox look memory leak free?.

c)What is the best way handle m_pThread at the end?. Any way to improve it?.

Code:
UINT CMyDlg::Dump(LPVOID lparam) {
HWND *pHndl = static_cast<HWND *>(lparam);
char buffer[200];
for (int i = 0; i < 100; i++) {
sprintf_s(buf,"user %d, data %s",i, "Connected");

[Code] ....

View 8 Replies View Related

Visual C++ :: Insert JPEG In CPP

Sep 27, 2012

I'm very good with hmtl now i want develop with C++ i need to insert jpeg into .cpp and insert movie flash in file .h ....

View 14 Replies View Related

Visual C++ :: Getting Rid Of (Save Changes To Untitled)?

Oct 10, 2013

I have tried everything I can think of to get rid of the 'Save changes to Untitled?' message box that appears every time my SDI split app tries to load a new file. The problem is that the message appears inappropriately, both when no previous document has been loaded or should exist, and even after File / New has been envoked. I have attached a small demo program to demo the problem. Inspecting the SpVwTrDoc.cpp NewDocument and OnOpenDocument, and elsewhere, you will see that using SetModifiedFlag(FALSE); has no effect.

View 10 Replies View Related

Visual C++ :: How To Use Watch When Using Singleton

Aug 24, 2014

I have code like this:

Code:
if (S::I().File.isDirectory(arg, S::I().Stat.workingPath)) {
// find out if there is -r option after 1st argument to join files
src_temp.join = true;
S::I().Stat.getRegEx = true;
}

The S is singleton class and I() returns instance of Singleton; there is a Stat object too. When I debug (line by line) I would like to see what values are in the Stat object. Is it possible to do it using Watch panel in Visual Studio 2010?

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved