visual-c++

implement bonjour sdk in visual c++ windows forms application

Hello I have succesfully implemented the bonjour sdk in a visual c++ console app. but when I am trying to implement the same code in a windows forms app (visual c++) I am receiving weird errors probably related to some local heap problem with the bonjour dll. The following assertion in the file dbgheap.c fails: /* * If this ASSERT f...

applying texture have HUGE problem. directx 9 c++

i don't get any errors when i compiile my game the only problem is that it won't apply the texture it will apply a color, i know it is werid. like if texture has two colors white and red than white will be applied. here is my code // Monopoly.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "Monopoly.h...

How to get a pointer to a binary section in MSVC?

I'm writing some code which stores some data structures in a special named binary section. These are all instances of the same struct which are scattered across many C files and are not within scope of each other. By placing them all in the named section I can iterate over all of them. In GCC, I use _attribute_((section(...)) plus some ...

Copy Constructor Being Called on the Wrong Object

I'm currently implementing a copy constructor for a Linked List class. When I create a new instance of the class with another Linked List as a parameter, the constructor is being called for the object I'm passing as the parameter. This is leaving me confused beyond belief. Here is the section necessary to understand what's going on in th...

applying texture another problem directx c++

ok i got everything working. the texture only applys for two sides only of the cube the other sides won't display the correct texture. here is my code // Monopoly.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "Monopoly.h" #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; ...

convert BSTR to wstring

How to convert a char[256] to wstring? update. here is my current code: char testDest[256]; char *p= _com_util::ConvertBSTRToString(url->bstrVal); for (int i = 0; i <= strlen(p); i++) { testDest[i] = p[i]; } // need to convert testDest to wstring to I can pass it to this below function... writeToFile(testDestwstring); ...

Crash in program using OpenMP, x64 only

The program below crashes when I build it in Release x64 (all other configurations run fine). Am I doing it wrong or is it an OpenMP issue? Well-grounded workarounds are highly appreciated. To reproduce build a project (console application) with the code below. Build with /openmp and /GL and (/O1 or /O2 or /Ox) options in Release x64 c...

visual c++ gui app implementing bonjour sdk

does anyone have a simple example on how to use the bonjour sdk with a windows visual c++ form application or a general gui application? as far as i know apple provides examples only for c sharp, java and vb thanks a lot for any help ...

What is the __NULL_IMPORT_DESCRIPTOR good for (MSVC map file)?

I have a map file generated with microsoft visual studio. It contains a relatively big area named __NULL_IMPORT_DESCRIPTOR. What is this good for? It has something to do with linked dlls but I cannot figure out the exact purpose of it. ...

Using a 32 Bit Com Object from a 64 Bit IFilter

I have an IFilter written in Delphi that I'm trying to get working under 64 bit Windows 7 Desktop Search. Due to it being developed in Delphi I can only compile this as a 32 Bit DLL. To work around this I am trying to write a 64bit IFilter Dll in Visual C++ which internally uses my 32Bit IFilter Com Object using the DllSurogate techn...

Discard ALT key press in CMainFrame

I'm having the following code: CMainFrame* pFrame = new CMainFrame; if (!pFrame) return FALSE; m_pMainWnd = pFrame; // create and load the frame with its resources pFrame->LoadFrame(IDR_APP_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); // The one and only window has been initialized, so show and update it pFr...

How to make global value for URL->bstrVal?

I am currently using this function inside my program. void CBar::DocumentComplete(IDispatch *pDisp, VARIANT *URL) How to make the BSTR value inside URL->bstrVal available for the whole program? I need to access the url value from other function. ...

Another way to use continue keyword in C++

Recently we found a "good way" to comment out lines of code by using continue: for(int i=0; i<MAX_NUM; i++){ .... .... //--> about 30 lines of code continue; ....//--> there is about 30 lines of code after continue .... } I scratch my head by asking why the previous developer put the continue keyword inside the intensive loo...

How do I resolve process hanging on CoUnitialize()?

I have a native Visual C++ NT service. When the service is started its thread calls CoInitialize() which attaches the thread to an STA - the service thread uses MSXML through COM interfaces. When the service receives SERVICE_CONTROL_STOP it posts a message in the message queue, then later that message is retrieved and the OnStop() handl...

Resources for Windows Aero Glass and Compositing (DWM)

I am looking for good resources for learning to use the Win32/GDI APIs or whatever supercedes it to draw and paint directly using the Win32 API to a glass form. While I am using Delphi, I tagged this as Delphi or Visual C++. Any code samples and articles that you can find would be appreciated. MSDN articles do not seem to be written a...

Why does calling std::stringstream's good() through a pointer lead to crashes?

I am having problems with a stringstream object. My class has an input stream as a member. I am checking if obj->istream and after thatn if obj->istream->good(). The stream exists but the call to good() crashes. I am in Visual Studio 2005. Any clue? How do I reset an istream? if (soap->is) { if (soap->is->good()) return so...

Visual Studio 2010 - C++ MFC application with Ribbon UI - Transparency in bitmaps

I am playing around with a small MFC-wizard-generated application, in Visual C++ 2010, and I just decided to put my own bitmap into the resources to replace the three-cubes MFC bitmap that shows up in the ribbon UI Application Button, aka the "marble". The original appeared to use black (0,0,0) as a transparency color, but I am unable t...

Visual Studio unable to load necessary dll's to run project

I am trying to run a project in Visual Studio 2010, and for some reason it seems like I can't... the command-line window is closed instantly and the debug info is the following: 'exercise01.exe': Loaded 'E:\e\work spaces\C++ projects\exercise01\Debug\exercise01.exe', Symbols loaded. 'exercise01.exe': Loaded 'C:\WINDOWS\system32\ntdll.dl...

How to generify data for "mov" instruction ?

Hello, I need to understand just 1 single instruction and accordingly I need to generify the things. I need to pass structures (Objects of User Defined Data Types) at runtime using following assembly code. Where Following is User Defined Data Type namely WESContext : typedef struct CWESContext { BSTR UserName; BSTR Mach...

Automated inlining for VC++?

Is there a way to tell the compiler to inline wherever it sees it to be useful? I thought it did this by default, but adding a few inline to my game loop functions improved performance by a good 30%. Thanks ...