Answer Questions
srjing2 C++/CLI managed code calling methods on unmanaged C++ classes call incorrect functions
Hi, We are doing a transition project where we are wrapping unmanaged C++ code with C++/CLI managed classes. The various methods and properties on a given managed wrapper class are mostly just pass-through calls to the wrapped C++ class. Mostly this works fine. Sometimes, however, the call from the managed code ends up in the wrong C++ function. IOW: void ManagedMethod1( void ) { m_pUnmanagedObject->Func1(); } actually calls pUnmanagedObject->Func20(). So far, it seems that every time this happens, the called method on the UNmanaged C++ class is declared "virtual"; it also seems that the incorrect method that is actually called is also declared virtual. I have tried in one or two situations to change the leg ...Show All
russ_mac template typedef error
#pragma once using namespace System; namespace test { template < typename _uintX> class CTest { public : CTest(); typedef typename _uintX uint_type; void testfunction( typename uint_type value); }; } t emplate < typename _uintX> void test::CTest::testfunction( typename test::CTest<_uintX>::uint_type value){ } I get the below errors when attempting to combile the above. I'm pretty stumped as to what is wrong I'm using vc8. Error 1 error C2955: 'test::CTest' : use of class template requires template argument list c:\documents and settings\rischa\my documents\visual studio 2005\projects\test\test\test.h 25 Error 2 error C2244: 'test::CTest<_uintX ...Show All
Emz21 Debugging release version in VS2005
I am debugging a complicated piece of software which takes quite a long time to run until it reaches the point which I have to investigate. Running debug version from debugger is too slow as it takes up to few hours to run until I get it to the point of the problem. I tried to compile the release version and run it from the debugger. Interestingly I can only see some variables (usually local function ones) in the watch window. The "this" variable for some reason is always shown as NULL. I also can not see values of variables of functions that are deeper in the stack. And finally my debug visualizers do not work. Project properties of debug and release versions seem to be almost the same (obviously _DEBUG directive is missing in r ...Show All
ctsand ComboBox that hides the arrow buton if only one element is in the list
Hello! I need a ComboBox that hides the drop down button if only one or zero elements are in the list and acts/displays itself simply as a textbox. I thought of two ways to do that: 1. Create completely new user control with a textbox, button and listBox 2. Inherit from ComboBox and place a textbox in front of the whole combox if only one/zero element is in the list and hide that textbox if more are in it. For suggestion 1 I would feel like reinventing the wheel and for solution 2 I think it could become hard to think of any possible events, focus, colors,... that would need to be transfered to the textbox. Is there any cleaner solution for this I can't believe that this is a very uncommon wished behavior. Thanks f ...Show All
LouArnold Error in creating Handle for HandleDestroyed
I am trying to create a handle for a custom handle when the window is destroyed I am using the code: this ->HandleDestroyed += gcnew System::EventHandler( this , &cheat::HandleDestroyed); I have this placed in the InitalizeComponent event of my windows form. When the compiler reaches this line it tells me that i need to point to a member function. I think I am doing this wrongly, so could anyone please point me in the right direction. Thanks in advance. :-D I worked out that the event that I acctually want to use is OnClosing(): I am using... this ->OnClosing += gcnew System::EventHandler( this , &cheat::OnClosing); Except that the System::EventHandler class uses a different set of objects to the On ...Show All
comspy "How to use use Excel like table in VC++ MFC Dialog with Combo controls in the excel table"
Dear friends, I have visual C++ 6.0 version. I want to use excel like table in my vc++ Dialog (from CDialog class). The table should contain records and fields which can be added and deleted dynamically. Some of the fields should be combo boxes where in data can be selected. I tried datagrid control activeX control and I was unable to use the datafields as combo boxes. I can migrate to visual studio 2005 if necessary! One more thing, I want to deploy/use my application in machines where office XP is not installed. So the excel like table should work without MS office. Somewhere I read, certainly there are controls. Kindly help me how to do this. Thanks in advance. Regards, Nagesh Hi, Please see the codeproje ...Show All
enric vives Program just quits
I'm am just running simple programs right now. For example the hello world code, but i never get to see if it works or not. After it compiles the black window comes up then it just quits. If i put in another command after like cin then the window stays up and i can see the hello world. What can I do to fix this. Hmm, let's compare our test apps. Mine is: #include <iostream> void main() { std::cout << "Hello World" << std::endl; std::cin.get(); } And that keeps the console until I press <return>. How does your app look like. Might it cause an exception that crashes the app so it never reaches cin.get() -- SvenC You can also put a ...Show All
Tryin2Bgood Arrow Position on a ComboBox
Hi, If the arrow located on the right side of a combobox is desired to move to the left, the only setting I found was to set the RightToLeft property to true. The problem is that this is meant for localization and the languages which start from the right side, not proper for English. What is the best way to move the arrow to the left of the ComboBox . A work around perhaps, to set the properly to true for the combobox, and then to set it false by getting a handle to the listbox part of the control during the runtime Any idea Best Regards, Reza Bemanian You would need to owner draw the combobox and then draw the arrow wherever you want it to be positioned. This should be done by the use of ...Show All
Juvefan how to open a pagemaker file, read only the text from it and write the text on excel sheet using vc++ codings
Hi all, i'm using vc++6.0 version and adobe pagemaker 7.0... i need to open adobe pagemaker files using vc++ codings and i should read only the text from it and i have to write those text on excel sheet using vc++6.0 codings.. i'm using MFC application wizard and dialog based application... can anyone help me to solve this probelm.... ....... I'm afraid what you're asking is project assistance rather than help with a specific problem or bug. In such cases, you should head over to rentacoder.com, or visit a public forum such as codeguru.com or experts-exchange.com. However: If you do have a concrete question with regard to a piece of code you've written, which doesn't behave like you intend or expect it to ...Show All
Tim Rupe How do I make a modal window
I've made a number of windows and I'd like a few of them to be modal (they will appear when different events are triggered and remain open until the user closes them). I am using Win32 and I thought there was a flag like WS_BORDER that I could use. Any suggestions Thanks Folks. Both ways seemed to work. You create modal dialogs by using the DialogBox method ( http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/dialogbox.asp ). A modal window is essentially one that disables its parent window, and enables it when it is closed. If you are not using a dialog box, then you just need to do this yourself and achieve modali ...Show All
Katie446 C++ tutorial
I have downloaded the program Visual C++. and is there is a tutorial for this program. Take a look at the sticky post about recommended books: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=107484&SiteID=1 . Tutorial for which, the IDE or the C++ programming language itself. For the use of the IDE, the help is the way to go, it is quite descriptive. If that doesn't help then look for things in the C++ developer center on the MSDN site. For C++ itself, if you look on the internet there are a few. I think http://www.cprogramming.com and http://www.cplusplus.com are probably the better ones I know of. But they don't beat having a good book on the subject. There is a sticky thread at th ...Show All
Ken Villines Problem with drawing the rectangle
Hi, I have this kind of class: // SplashWnd.cpp : implementation of the CSplashWnd class // ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "CapturePrevWnd.h" #include "Resource.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSplashWnd class CCapturePrevWnd* CCapturePrevWnd::m_pSplashWnd = NULL; CCapturePrevWnd::CCapturePrevWnd() { start.SetPoint(0,0); end.SetPoint(0,0); } CCapturePrevWnd::~CCapturePrevWnd() { // Clear the static ...Show All
yamobe XML Extracting Attributes (Simple Question)
Hi, I have a simple question regarding XML. If I have an XML file in a similar format as seen below, want I want to do is find ‘Product_Number = 1’ get the COLOUR and PRICE but what would be the best way to do this (C++ .NET) and would code loook like < xml version="1.0" encoding="utf-8" > <PRODUCTS> <PRODUCT> <PRODUCT_NUMBER>1</PRODUCT_NUMBER> <COLOUR>Blue</COLOUR> <PRICE>83.40</PRICE> </PRODUCT> <PRODUCT> <PRODUCT_NUMBER>2</PRODUCT_NUMBER> <COLOUR>Yellow</COLOUR> <PRICE>83.21& ...Show All
Walter30140 Marshal MSG Struct CopyMemory
I have two projects one is a managed c#.NET application and the other is a win32 dll. I am trying to pass a MSG structure that was intercepted in global hook filter function in my unmanaged code, back to my managed code. ***Relavant code from managed project. public IntPtr hMsg; public MSG ThisMsg; ... // Pointer that will be sent to the unmanaged dll. hMsg = Marshal.All ...Show All
Krutika Calling VC# dll class/function etc. in VC++
Hi all, I have a managed VC# dll and I am using it in my VC++ code as #using "mcMath.dll". ( And I am not getting any build errors, thanks to the experts in this forum)..Now I want to call the function in the dll .... how do I do that I have tried creating an instance of the VC# class but that gives an error !!! My dll class looks like ... public class Class1 { private bool bTest = false ; ///// <summary> ///// //This is a test method ///// </summary> long Add( long val1, long val2) { return val1 + val2; } /// <summary> /// //This is a test property /// </summary> public bool Extra { get { ...Show All
