visual-c++

Insert data into postgreSQL with ODBC using c++

送分小仙女□ 提交于 2020-05-24 07:28:29
问题 I successfully establish the connection but no data is inserted and SQLExecDirect() returns -2. Please correct my code as I am using ODBC & PostgreSQL for the first time . { SQLRETURN result; SQLHENV envHandle; SQLHDBC conHandle; SQLHSTMT hstmt; SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &envHandle); SQLSetEnvAttr(envHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC2, 0); SQLAllocHandle(SQL_HANDLE_DBC, envHandle, &conHandle); result = SQLConnect(conHandle, dsn, SQL_NTS, username,

Insert data into postgreSQL with ODBC using c++

孤街浪徒 提交于 2020-05-24 07:28:00
问题 I successfully establish the connection but no data is inserted and SQLExecDirect() returns -2. Please correct my code as I am using ODBC & PostgreSQL for the first time . { SQLRETURN result; SQLHENV envHandle; SQLHDBC conHandle; SQLHSTMT hstmt; SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &envHandle); SQLSetEnvAttr(envHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC2, 0); SQLAllocHandle(SQL_HANDLE_DBC, envHandle, &conHandle); result = SQLConnect(conHandle, dsn, SQL_NTS, username,

List USB drive letters in VC++ [closed]

泪湿孤枕 提交于 2020-05-18 01:47:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I want to list USB drives in my machine. How to do it in VC++. Can u give a sample code. 回答1: I don't think you're going to get anybody to write the code for you: you're a programmer, that's (presumably) your job . However, you can start with GetLogicalDriveStrings and

List USB drive letters in VC++ [closed]

坚强是说给别人听的谎言 提交于 2020-05-18 01:47:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I want to list USB drives in my machine. How to do it in VC++. Can u give a sample code. 回答1: I don't think you're going to get anybody to write the code for you: you're a programmer, that's (presumably) your job . However, you can start with GetLogicalDriveStrings and

List USB drive letters in VC++ [closed]

我怕爱的太早我们不能终老 提交于 2020-05-18 01:46:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I want to list USB drives in my machine. How to do it in VC++. Can u give a sample code. 回答1: I don't think you're going to get anybody to write the code for you: you're a programmer, that's (presumably) your job . However, you can start with GetLogicalDriveStrings and

Tracing all functions in my program

白昼怎懂夜的黑 提交于 2020-05-17 06:19:08
问题 Like the title says, I want to trace ALL functions calls in my application (from inside). I tried using "_penter" but I get either a recursion limit reached error or an access violation when I try to prevent the recursion. Is there any way to achieve this ? Update What I tried: extern "C" { void __declspec(naked) _cdecl _penter() { _asm { push eax push ecx push edx mov ecx, [esp + 0Ch] push ecx mov ecx, offset Context::Instance call Context::addFrame pop edx pop ecx pop eax ret } } class

What is the difference between IDispatch and IUnkown in COM? [closed]

纵饮孤独 提交于 2020-05-14 13:54:46
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

What is the difference between IDispatch and IUnkown in COM? [closed]

混江龙づ霸主 提交于 2020-05-14 13:54:01
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

Can't reference a library project (DLL) because .lib file is missing

雨燕双飞 提交于 2020-05-11 05:37:05
问题 I'm trying to start a C++ game engine project. I don't have much knowledge of dll's and lib's but figured the engine itself would be a dll and I would have separate dll projects such as renderer, input, etc that would be used by the engine and the engine dll would be used by the game. I seem to have the engine project referenced fine in the demo.exe project(by adding a reference and adding the path to additional include directories) but when trying to add a reference to a renderer dll project

“Escape” and “Clobber” equivalent in MSVC

时光怂恿深爱的人放手 提交于 2020-05-09 19:33:25
问题 In Chandler Carruth's CppCon 2015 talk he introduces two magical functions for defeating the optimizer without any extra performance penalties. For reference, here are the functions (using GNU-style inline assembly): void escape(void* p) { asm volatile("" : : "g"(p) : "memory"); } void clobber() { asm volatile("" : : : "memory"); } It works on any compiler which supports GNU-style inline assembly (GCC, Clang, Intel's compiler, possibly others). However, he mentions it doesn't work in MSVC.