visual-c++

Is there any way to get Delphi to read other debug formats?

When I'm debugging something in Delphi and there's a system library in the stack trace, I've got the name of the library and the function that's being called into. Unfortunately, this doesn't seem to apply to any other external DLLs. I've got one that was compiled in Visual C++ 2005, and any time it gives me any sort of trouble, I have...

C# equivalent of this C++ code

Hello, Is there any C# equivalent of the code below? HRESULT hr; ActiveXSite* pSite; pSite = CAxWindowlessHost<CMainDlg>::CreateControlSite(L"AgControl.AgControl", NULL, IDC_AGCONTROL1); if ( pSite != NULL ) { // disable right-click! pSite->SetAllowRClick(false); // set moniker URL CCom...

visual c++ enum (CloseReason)

When I write the following: private: System::Void queue_FormClosing( System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) { if(e->CloseReason!=CloseReason::FormOwnerClosing) e->Cancel=true; } I get this error: ###\queue.h(153) : error C2039: 'FormOwnerClosing' : is not a member of 'System::Windows:...

C++ struct alignment question

I have a predefined struct (actually several) where variables span across 32-bit word boundary. In Linux (and Windows using GCC) I am able to get my structs to pack to the correct size using 'attribute((packed))'. However I cannot get it to work the same way using VC++ and #pragma pack. Using GCC this returns a correct size of 6 bytes...

OpenAL: How to free the memory malloced by alutLoadMemoryFromFileImage ?

Hi ! I use alutLoadMemoryFromFileImage to convert a wav file that lies in memory to data that can be used in OpenAL. The docu says, the returned data is only malloced and can simply be freed afterwards, but when I try that, my application crashes. Can someone explain this to me or show me an example of how to use alutLoadMemoryFromFile...

How to avoid CListCtrl items to be partially visible?

I have a resizeable CListCtrl and I want to avoid any item being displayed partially, ever. For example: I want Item 9 to not be displayed in this case. Is there a flag or method for this? How would you go about solving this issue? I tried the following and it was no good: void CMyCListCtrl::OnEndScrolling() { int iCount = this...

TaskDialog always on top in Visual C++

Is there a way to make a TaskDialog always on top (ie, system modal)? I've checked the TaskDialogConfig structure (http://msdn.microsoft.com/en-us/library/bb787473%28VS.85%29.aspx), but I'm not having any luck. Anyone know how to do it or if it's possible? ...

API or command to check if "Fast user switching" enabled on XP

Hello All, I am working on a installer, it should check FUS (Fast user switching) is enabled or not on the XP system. If FUS is enabled then installer should exit, otherwise perform the actual installation. My question is there any command line utility (or API) to check if FUS is enabled on XP? Thanks.. ...

How to detect a CListCtrl selection change?

I want to execute some code when the user selects a row in a CListCtrl (report view, I don't care about the other viewing modes). How do I catch this event? is there some message I can map or a method like "OnSelectionChanged" or something like that? ...

Mixing c# and vc++

I've got a code snippet of c# that I've been trying to translate into vc++, but I'm having some difficulties. So, I'm wondering if it is possible or advisable to mix c# and vc++; that is to say, can I call my c# function from vc++ and vice-versa. If so, are there tricks to it? If, not, why? ...

Writing to a Serial (Com) Port in Visual C++

I have a device that is connected on port COM4, (115200 baud, 8-N-1). Based on examples I found here I'm opening the port with: Keyboard_Handle=CreateFile("\\\\.\\COM4",GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL); if(GetLastError() !=0 || Keyboard_Handle == INVALID_HANDLE_VALU...

Is it possible to prevent an RAII-style class from being instantiated "anonymously"?

Suppose I have an RAII-style C++ class: class StateSaver { public: StateSaver(int i) { saveState(); } ~StateSaver() { restoreState(); } }; ...to be used like so in my code: void Manipulate() { StateSaver save(1); // ...do stuff that modifies state } ...the goal being to enter some state, do stuff, then leave that sta...

Vc++ Error :Node is not a class or namespace

My Node.h is class Node{ private: int x; int y; public: Node(); Node(int x, int y); void setXX( int x); ..... } In Node.cpp I am doing: #include "Node.h" #include "stdafx.h" Node:: Node(){} Node:: Node(int x, int y){ this->x = x; this->y =y; } void Node::setXX(int x){ this->x = x;...

How to make the ToolTip appear in the foreground of the floating CPaneDialog?

Does anybody has a hint for the following problem? I have a derived class from CPaneDialog, it contains just one button. I want to show a tooltip if the mouse is over it. For this I use CMFCToolTipCtrl: // Create the ToolTip control. m_ToolTip.Create(this, TTS_ALWAYSTIP | TTS_NOPREFIX); m_ToolTip.Activate(TRUE); CMFCToolTipInfo params...

What might cause SHChangeNotifyRegister to fail on windows mobile?

SHChangeNotifyEntry changeentry = new SHChangeNotifyEntry(); changeentry.pIdl = GetPidlFromFolderID(this.Handle, CSIDL.CSIDL_DESKTOP); changeentry.Recursively = true; uint notifyid = SHChangeNotifyRegister( this.Handle, SHCNF.SHCNF_PATHA , SHCNE.SHCNE_ALLEVENTS, ...

My sample app is getting crash while registering to Filechangeinfo notification

public partial class Form1 : Form { [DllImport("coredll.dll")] static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong); [DllImport("coredll.dll")] static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("coredll.dll")] public static exte...

How do I add Unicode support to a CRichEditCtrl?

My application used to use an MFC CEdit control and we had no problems with wide character (Unicode) strings. After switching to a CRichEditCtrl, it seems that Unicode is no longer supported. Chinese characters become "??" and so forth. I have read that CRichEditCtrl uses RichEdit* under the hood and I have played around with trying to c...

Why the UI keep flicker ?

I have a project which have three dialog, Let's say A, B, C. And A contain B & C, B contains C. They all are inherited from a DialogBase class and have a setBitmap function to set a background image. And I have add the relationship that every time drag on C, B will drag as well. and B is a transparent dialog! When onLbuttonDown is trig...

How to generate pdb files for parallel builds?

We are seeking ideas on resolving a problem with linking/pdb generation when running multiple devenv.com using Visual Studio 2005. We are getting the following intermittently errors when doing parallel builds using devenv.com. I.e. when the following get run at the same time on the same build server: devenv.com master.sln /build "Relea...

LNK2019 Error,String collision due to migration from vs-2003 to vs-2008

Hi All vc++ Masters, I am migrating my vs-2003 code to vs-2008(on vista machine)...I have the compilation successfully.But i am getting the compilation errors in the debug mode... I think It should be issue of multiple string datatypes in my project like: MFC Cstring, DblString datatype, char *. It might be mismatch of MFC/ATL Cstring...