visual-c++

cannot convert from 'System::String __gc *' to 'std::basic_string<_Elem,_Traits,_Ax>'

I want to read a value from a textbox control on form into a basic_string type variable. I am getting error in the following line of code. writing code in VC++. std::string my_string = textBox1->Text->ToString(); please tell me how can I type cast it to std:string type. ...

Who's using MFC's VERIFY Macro?

To think ... there I have been happily programming in an MFC riddled environment for years, using ASSERT() whenever it seemed OK and just today I (was) stumbled upon the VERIFY Macro: http://msdn.microsoft.com/en-us/library/fcatwy09%28v=VS.71%29.aspx It's basically the same as ASSERT() except the expression will not be removed in releas...

How to compare managed and unmanaged Strings?

I have an application that uses managed System::String in the UI elements, but then refers to un-managed (read: legacy) code for the more complex computation. Additionally, there is not a consistent encoding for the strings - managed strings can be either regular "strings" or Unicode L"strings" and un-managed strings come in all of char...

Mix GFortran/MSVC objects when linking: undefined reference to _chkstk

Trying to compile Xfoil and plotlib The fortran files are compiled with MinGW gfortran 4.5.0, and I compiled W32win.c with MSVC (2008/15.00). During linking with GCC I receive error: ../plotlib/libPlt.a(W32win.o):(.text+0x1469): undefined reference to `_chkstk' ../plotlib/libPlt.a(W32win.o):(.text+0x1509): undefined reference to `_c...

Triangular c++ edge calculation

I have been working on this source code, but nothing seems to go right. A revised source code would be extremely appreciated, or at least a visual solution to my errors. Here is the following problem: Write a program that reads three edges for a triangle and determines whether the input is valid. The input is valid if the sum of any tw...

Mixed mode assembly not loading symbol for native C++ pdbs

Hello, I am working with mixed mode assemblies in C++/CLI. All managed mode assemblies pdb's get loaded when successfully in mixed mode assembly. But native dll's pdb's not getting loaded even no information shown of native pdb in Modules pane (i.e in VS Debug->Windows->Modules). Note: I am using native dll and calling its exported fu...

Is it possible to force a function not to be inlined?

I want to force a little function not to be compiled as inline function even if it's very simple. I think this is useful for debug purpose. Is there any keyword to do this? ...

error LNK2019: unresolved external symbol SHInitExtraControls referenced????

Hi How can i resolve this error: Error 1 error LNK2019: unresolved external symbol SHInitExtraControls referenced in function "public: virtual int __cdecl CTestApp::InitInstance(void)" (?InitInstance@CTestApp@@UAAHXZ) Test.obj thanks ...

How do you use SECURITY_ATTRIBUTES with CreateProcess()?

Greetings! When I try to use GetThreadContext() on a thread that I've started with CreateProcess(), I receive an error of 998: ERROR_NOACCESS You can find a contrived but functional code example of this problem here: http://pastebin.com/tamDhYza Based on the MSDN article regarding "Thread Security and Access Rights", my assumption is...

Add YAAF to the Microsoft Visual C++ search directories

Hi , I am completely new to working on MS Visual Studio. I am trying to install new framework where in the installation guide tells me "Add YAAF to the Microsoft Visual C++ search directories" YAAF i suppose is the directory over here that i have got. But does not mention how do i do it. Could anybody please help? ...

Building C++ CLR app for Platform Toolset v90 in VS2010 requires Visual Studio 2008

I've got a shiny new laptop with the latest Dev tools installed such as Visual Studio 2010. Now I've got a task to build a C++ CLR app targeting the 2.0 runtime (this is well outside my comfort zone). So I've specifed the v90 Platform Toolset but when I build I get:- error MSB8010: Specified platform toolset (v90) requires Visual S...

WDK (Windows Driver Kit) and VC++ headers problem

Hi, I'm trying to read from an USB HID device, I know how to do it in C# using DLLImport hid.dll, but I want to do it from C++, this way I don't have to declare all the structures, etc, and just include the headers files. So I downloaded the WDK and then when including the headers files and linking the libraries I'm getting a lot of er...

Getting error message from CStdioFile::Open()?

If CStdioFile::Open fails, I want to be able to report the cause of the error. However, it appears as though it never throws an exception. Also, when I try the following: CStdioFile file; CFileException exc; bool bSuccess = (file.Open(_T("FileDNE"), _O_RDONLY, &exc) == TRUE); ASSERT_FALSE(bSuccess); CString err; exc.GetErrorMessage(e...

How do I build libmySQL ?

I aim to integrate libmySQL into my executable instead of using libmySQL.dll. I use VC++ 2008 @ Windows Vista. I've downloaded "mysql-connector-c-noinstall-6.0.2-win32-vs2005.zip" from http://dev.mysql.com/downloads/connector/c/ It contains only ".h" files with declarations. Where is the implementation code (".c" files)? As said, I wi...

Is there a way to use java to execute a series of command line

Hi, I'm looking for a way to compile visual studio c++ project in java. I know it's a bit strange to do it this way. but I'm doing a evolutionary algorithms. So Java is creating c++ code and compile it in Java not c++. I just need to automate it, so I don't have to copy the c++ code and paste it in .NET and click compile it. So I'm lo...

C++ shift from Unix to Visual Studio in Windows

Hi Everybody, I am a professional working for a software firm.In my past company basically i was working on C & C++ on unix.Now i suddenly shifted to C++ on Windows and i feel like i am in a completely different world.Basically i am working on a very big application which was totally written in C++.To keep it simple ,i dont have the so...

change icon for TBBUTTONINFO

How to change icon for TBBUTTONINFO to my own icon? TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; inf.iImage = 1; // <---- currently this number points to IE's icons. SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); Help me :( ...

gSoap compilation with c++

I'm trying to get a simple example working using gSoap, for VS2008. I've done the following: wsdl2h -o Init.h http://myservices/InitalisationService.asmx?WSDL And then this: soapcpp2 -I "C:\3pSDK\gsoap-2.7\gsoap\import" -i -C -limport Init.h which produces many files. My project folder looks like this: // generated files Init.h ...

get chuncked data from http server in C++

hi, i want to connect to a http server(something like google.com) and get data from it with chuncked property and then merge chuncked data together. ...

C/C++: duplicate main() loop in many threads

I have this "interesting" problem. I have this legacy code that looks like int main() { while(true) { doSomething(); } } I would like to duplicate that doSomething() in many threads, so that now main() would look like int main() { runManyThreads(threadEntry) } void threadEntry() { while(true) { doSomething(); } } ...