visual-c++

null reference exception in richtextbox

hai. am writing dll for capture port pockets(like tcp sniffer) in vc++.in this application using thread for retrive pockets continuesly.and have event for send data to c# application. in c# appliaction receive that pocket data and put richtextbox and store that data to .txt file from richtextbox every 10 seconds and clear textbox. its...

Should the caller initialize "out" parameters?

Many Win32 API functions have parameters specified to be "out". For example, GetIconInfo() description says about the second parameter that The function fills in the structure's members. This implies that the function doesn't ever read the original values stored in the "out" parameter - only changes them - and therefore the caller is fr...

Any reason to use SecureZeroMemory() instead of memset() or ZeroMemory() when security is not an issue?

This MSND article says SecureZeroMemory() is good for cases when sensitive data stored in memory for a while should be for sure overwritten as soon as possible when no longer needed. Answers to this SO question explain why this can make a difference. Now is there any sence in using SecureZeroMemory() for initializing just every memory b...

VS DataBreakpoints: difference between C and C++

hello, when you set a databreakpoint in MSVS, then you put in the address and the number of bytes and finally it lets you choose betwenn "C" and "C++". this last part i dont know what it is about? what is the difference of picking C and C++ in this situation? thanks! ...

Unsupported rpcns4.dll messages in VS 2008 on windows server 2008

I've been developing a small in house application in C++ to access data from a vendor through a windows only API. I've developed this application in visual studio 2008 on windows XP (actually in a windows XP VM but whatever) and in testing on this system it runs fine. Now I'm deploying to a windows server 2008 standard system, and if I r...

How to add MFC support to existing Win32 C++ Project?

Hi, I am creating a C++ application which uses Qt to create the GUI. However, I need to use a third party library which relies on MFC (for CString's, etc). Is there anyway to add MFC to my application to allow me to use this library or do I need to rewrite it myself? I saw this question, but it doesn't tell me how to add MFC manually t...

How to write a service with Visual C++ Express 2008?

The express editions of Visual C++ lack a template for creating Windows services. However, I heard somewhere that it could still be done. How would I go about doing this? ...

How to simulate a member reference tracking variable in C++/CLI?

This is going to be a really goofy question but is it possible to do the following in C++/CLI? // C++/CLI public ref class Managed { public: array<double>^ m_data; Managed(array<double>^% data) : m_data(data) { } void bar(int x) { System::Array::Resize(m_data, x); ...

C++ SQLDriverConnect API

Hi, I am using visual studio 2008 and sql server 2008 for developing application(SQL server is in my system). I need to fetch some fields from the database. I am using the SQLDriverConnect API to connect to the database. If I use the "SQL_DRIVER_PROMPT" I will get pop window to select the data source. I don't want this window to appear...

How to replace a string between two substrings in a string in VC++/MFC?

Say I have a CString object strMain="AAAABBCCCCCCDDBBCCCCCCDDDAA"; I also have two smaller strings, say strSmall1="BB"; strSmall2="DD"; Now, I want to replace all occurence of strings which occur between strSmall1("BB") and strSmall2("DD") in strMain, with say "KKKKKKK" Is there a way to do it without Regex. I cannot use regex as adding...

Develop a Remote Desktop View software with tunneling VPN.

Hi, All I have to develop a remote desktop view software with tunneling just as team viewer. I am using Visual C++ for this, can some one guide me how to go about implement tunneling. ...

Starting Development for Google Chrome....Getting Started Issues!

Our organization has decided that my project will be developed for internal use with the Google Chrome browser. So yesterday I started looking around the internet for just how I would go about doing that. I found the WebKit.org development tool and have been trying to install it using the instructions found here: http://webkit.org/buil...

Emulating pass by ref in C++/CLI without using tracking reference (%)?

I want to emulate the following method: ref class Something{ void foo(array<double>^% data) { data = gcnew array<double>(10); } }; Such that, the caller's array gets modified/created. Nevertheless, there are some constrains: foo cannot use ref/out/% nor any additional parameters. the actual parameter of foo has to be ...

How can i compare queues in cpp ?

hi there i need to compare the size of 10 queues and determine the least one in size to insert the next element in creating normal if statements will take A LOT of cases so is there any way to do it using a queue of queue for example or an array of queues ? note : i will need to compare my queues based on 2 separate things in 2 situat...

C: Passing Struct to a Function doesn't result in a call by value operation

Hello! I have the following problem with a program which I wrote in Visual C++ and I hope that anyone can help me please: typedef struct spielfeld { int ** Matrix; int height; int width; Walker walker; Verlauf history; } Spielfeld; void show(Spielfeld fieldToShow); //Prototype of the Function where I have this ...

Why can't a Visual C++ interface contain operators?

As per the MSDN doc on __interface, a Visual C++ interface "Cannot contain constructors, destructors, or operators." Why can't an interface contain an operator? Is there that much of a difference between a get method that returns a reference: SomeType& Get(WORD wIndex); and the overloaded indexer operator? SomeType& operator[](WORD ...

Why does the C++ linker require the library files during a build, even though I am dynamically linking?

I have a C++ executable and I'm dynamically linking against several libraries (Boost, Xerces-c and custom libs). I understand why I would require the .lib/.a files if I choose to statically link against these libraries (relevant SO question here). However, why do I need to provide the corresponding .lib/.so library files when linking m...

Reference for VC9 C++ Language Extensions

Is there a reference somewhere concerning all the C++ extensions the VC9 (SP1) compiler has? Examples would be the __declspec stuff, variadic macros and the compiler intrinsics, although there are also some less noticeable ones like being able to have template function specialisations at class scope, whereas apparently the standard say...

how to avoid the command window when a vc project file is executed

Hello, I have a question regarding Visual C++. While executing a Visual c++ project file, the application runs and along with that, a command window gets opened. It normally disappears as soon as the application running is done. I am not sure if that command window could be avoided when the application runs. Thanks, Krishna ...

ArcSDK.h Not Found in Default Path

By default, it should be at ..\include\CPPAPI. But on my machine this folder doesn't even exist, only 'CatIDs' and 'GridIDs' folders reside in \include. I've installed ArcGIS Desktop 9.3 and its VC++ SDK. I am new to ArcGIS and LiDAR, I've got LAS file and corresponding text version, all I need to do is to convert txt file to shp file....