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


ADVERTISEMENT

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

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++ :: 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 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

Visual C++ :: Switch From TXT To RTF During Runtime

May 2, 2015

While running a Doc/View SDI, is there any way to switch from text mode to rtf mode during runtime? Search reveals nothing.

Say I have an editor and I want the app to use text, I can set the ctor as follows.

Code:

CEditorDoc::CEditorDoc() {
// TODO: add one-time construction code here
m_bRTF = FALSE;
}

But once I've done that and compiled the app, while it's running, is there a way for the user (or programmer) to change the mode back to RTF? One solution that occurred to me is to use 2 document classes, but that's a hassle.

View 8 Replies View Related

Visual C++ :: Read And Write XML?

Sep 8, 2013

I receive a telegram in XML format and I need to parse it and send my data in the same format back. My main problem is that I'm not allowed to use any open source software or other 3rd party software except VS2010. I have to write it in C++.

Now my question: is there any good tutorial for such a parser? I was hoping that I could write something which can be used similar to the GEtPrivateProfil-functions which are handy for ini-files.

My XML telegram looks like hat:

Code:
<Tag0 cmdId=“254“ version=“1“ ID=“87951“ action=“doing1“>
<!—comment1 -->
<Tag1 lId=“31“ type=“12“ index=“100“ state=“open“ />
<Tag1 lId=“31“ type=“12“ index=“135“ state=“open" />
<!—comment2 -->
<Tag2 lId=“42“ type=“32“ index=“2“ state=“open" >
<param key=“pos“ value=“center“ />
<param key=“car“ />
</epr>
</Tag0>

I was hoping to find a way to get to know how many tag1 and tag2 are in tag0 and then get for each tag the attributes and sub-tags like param in tag2

View 13 Replies View Related

Visual C++ :: Display Hex In Edit Box?

Sep 24, 2013

I'm trying to take a value from an edit box and display it in the edit box as hex. I'm using this code:

CString buffer;
int intbuf;
m_edit[5]->GetWindowTextA(buffer);
intbuf = atoi(buffer);
buffer.Format("%02X", intbuf);
m_edit[5]->SetWindowTextA(buffer);

If I include the last line of code here I get a stack overflow error. If I don't include it, I can run through the debugger and the buffer CString is converted to hex just like I want, I just can't display it because I get that error.

View 4 Replies View Related

Visual C++ :: Exporting Struct From DLL

Nov 8, 2013

I'm trying to build the gtkmm library using MSVC. One of its source files declares a struct called BuiltinStockID together with some objects of that type - e.g.

Code:
// In the header file:-
namespace Gtk {
struct BuiltinStockID {
const char* id;

[Code] ....

GTKMM_API is obviously _declspec(dllimport) (or export) as appropriate. It seems a bit unusual to use extern in addition GTKMM_API but the code won't compile if I try to exclude it. The actual instantiations are in one of the library's source files- e.g.

Code:
// In a source file
const Gtk::BuiltinStockID APPLY = { GTK_STOCK_APPLY };
const Gtk::BuiltinStockID CANCEL = { GTK_STOCK_CANCEL };
const Gtk::BuiltinStockID OK = { GTK_STOCK_OK };

GTK_STOCK_APPLY etc are simple strings such as "gtk-apply". They mostly refer to image files for the library to load (in this case, for dialog button images) although that's probably not relevant to the problem.

If I run dumpbin /EXPORTS on the built DLL it does seem to have some exported symbols with the names Gtk::Stock::APPLY, Gtk::Stock::CANCEL, Gtk::Stock::OK etc. However, if I write this in one of my own source files:-

Code:
Gtk::BuiltinStockID MyStockID;
MyStockID = Gtk::Stock::CANCEL; // <--- debugger reports <Bad Ptr>
You can see that the Gtk::Stock::CANCEL object is invalid (my debugger reports it as a bad pointer). Likewise, if I try to pass Gtk::Stock::CANCEL as a parameter to a function.

View 13 Replies View Related

Visual C++ :: Updating To New Windows SDK?

Apr 27, 2013

I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.

It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.

I've rebuilt all my libraries, but still no joy.

So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?

The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?

View 11 Replies View Related







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