Answer Questions
ekkapop CButton Events in MFC?
Hello I just made a little simple app (because I just started last night) that has a button (CButton) with no events and a text box (or CEdit...) and a Static label (CStatic). Now, with that done and working, I'm content (remember, I started last night!) Anyways, my name for CButton is "cb", CEdit is "ce", and CStatic is "cs", all without quotes. Now, I would like so that when cb is pressed, cs will contain the string that was input from ce. How can that be done Please, explain step by step. If you don't want to explain the whole thing, just show me the code, I'll eventually find out. Thank You Keehun Nam Here is my current code: //hello.cpp #include <afxwin.h> // Declare the application class class CHel ...Show All
Jakein2006 Exception handling
I have following observations: 1) Using VC++ 2005, write a C++ code that divides a value by zero. Put this code in try catch block. The catch block is unable to catch the exception. On the other hand, if the same code is written in C#, the exception is caught in the catch block. 2) To futher add to it, VC++ 6.0 is able to catch the same exception which VC++ 2005 cannot, although in the catch(...) block and not the catch(std::exception) block. 3) Other exceptions like index out of bounds are also not caught by catch block in VC++ 2005 while the same is possible in VC#. My questions are: Why the behaviour of VC++ has changed over different versions and how can one catch such exceptions What makes behaviour in VC# different ...Show All
ayeesha MsgBoxs ...
In VB you can make MsgBoxs pop up, can you do this in C++ or do you have to make the msgbox window manually Thxs, the ways you supplied are the ways for extremely custom ones, but I found out about the command: MessageBox::show() Which is a much simpler way, but thanks anyway... :) You have MessageBox function: http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/messagebox.asp and an example: http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/usingdialogboxes.asp Thank you for enlighten us by sh ...Show All
progames25 Im pretty confused, just wont compile
When ever I try to compile I get this message: e:\files\physics\Collision.h(298) : error C2582: 'operator =' function is unavailable in 'IFinder' This error is caused when I try to call create a new IFinder using this code: IterFinder = gcnew IFinder(); I havn't tried to overload any operaters or any thing, as you can see by the class definition: public ref class IFinder { public : IFinder() { // } int test; }; I have tried every thing, changing the class name, declaring it before the class it is used in, in the class it is used in, in a precompiled header. The class it is u ...Show All
Steveinbeloit definition of dllimport function not allowed
wrapi.h ... #include "WRAPIExports.h" ... .... //macros #ifdef WRAPI_EXPORTS #define WRAPI __declspec(dllexport) #else #define WRAPI __declspec(dllimport) #endif ..... HRESULT EnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems); ... .... ////////////////////////////////////////////////////// wrapi.cpp ..... .... ... //exported function implementation WRAPI HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems) { return theApp.EnumerateDevices(ppDeviceList, plItems); } ////////////////////////////////////////////////////////// WRAPIExports.h .... .... #ifdef WRAPI_EXPORTS #define WRAPI __declspec(dllexport) #else #define WRAPI __declspec(dllimport) #endif .... ... //exported functions WRA ...Show All
Jake.K Error in loading DLL with ActiveX object
Hello, I have an ActiveX object, created with ATL, which generates a "Error in loading DLL" message when I try to call one of its method in jscript. E.g. var XSIDial = new ActiveXObject("XSIDial.XSIDialog"); TestCombo = new Array("one", "two", "three"); UseAnim = XSIDial.Combo( "Test for Combo", TestCombo ); I tried in vbscript and it gives the same error. DllGetClassObject gets called and returns the right ActiveX object. The object is compiled with visual 2005 but it used to work with visual 2003. Do you have any idea how I can debug that thanks -mab Is that error on your developer machine or a client If client, did ...Show All
R.Tutus Command line compiler help needed!!!!
I'm trying to compile the below code with the command line compiler but I get a bunch of errors Errors like 'System' is not a class or namespace name Can the command line compiler be used on this type of code #include <stdio.h> #include <stdlib.h> using namespace System::IO; using namespace System::Text::RegularExpressions; void main (void) { int index = 0; String ^line; Regex^ rx = gcnew Regex(",") StreamReader^ sr = gcnew StreamReader(testfile.tif); while ( line = sr->ReadLine() ) { array<int>^ ia = rx->Split(line); } int a=array[index++]; int b=array[index++]; int c=array[index++]; if (a <= 42) { b--; if (c > 1444) c--; } else if (a > 42) { do { a += b; } while (b <= 1000); } ...Show All
rternier What #include<file> is necessary for using namespace System;?
The Visual Studio 2005 MSDN Help Search doesn't explain the prerequisite #include<file> needed before the System namespace can be called, for example, in the case it were needed to execute the following statements: using namespace System; Console::Clear(); Does anyone know this necessarily perchance Thanks. Rightclick on your project in the solution explorer. Select "References..."->"Add new reference..." in .Net tab find System and add it. That's it. System.dll is automatically added to the references by the VS when you creaate a project. Dave, if trying to also use the following code: #include "stdafx.h" #inc ...Show All
KrazyMGA Problem including afxtempl.h in WinForms app
I've created a WinForms app in VC++ 2005, set the project to "Use MFC in a Shared DLL" and "Use CLR support". I then added a "#include <afxtempl.h> in the Form class, as below: #pragma once #include <afxtempl.h> namespace test_afx public ref class Form1 : public System::Windows::Forms::Form When I run it in debug, I'm getting a Debug Assertion Failed error, as below. Program: test_afx.exe File: dbgheap.c Line: 1394 Expression: pUserData!=NULL How should I fix it, so that, the class Form1 can use MFC classes such as CArray Thanks, the Call Stack is shown below. > msvcr80d.dll!_msize_dbg(void * pUserData=0xba3 ...Show All
Ted12893 SP1 - Devenv hanging with 90% CPU - Mem constant - Hang dumps available
Hello, We run an overnight build process (using batch files etc..) that worked fine with VC2005 but since installing SP1 'devenv' is hanging. I've captured a couple of hang dumps of devenv.exe if they are useful to any of the VC developers monitoring this forum. They are rather large though (~60meg each). Here's a snippet of the stack trace sections of both dumps. Many thanks Paul. PS: Is there a better place to post this stuff to If so, please let me know and I'll repost there. ========================================= TRACE 1 . 0 Id: 754.9a0 Suspend: 1 Teb: 7ffdf000 Unfrozen ChildEBP RetAddr Args to Child 0012f9e8 7c822114 77e67143 00000001 0012fa38 ntdll!KiFastSystemCallRet 0012f9ec 77e67143 00000001 0012fa38 ...Show All
Marcus Widerberg Directory select popup window
how can i get a directory select popup window in VC++... also i need to split a pathname into directory and file name ... is tere any function available.... He gave you the answer. What is the problem to google and search for such keywords like SHBrowseForFolder http://www.codeproject.com/shell/cxsbrowsefolder.asp http://www.codeproject.com/cpp/BrowseForFolder.asp I think you should investigate the SHBrowseForFolder and _splitpath functions. thanks viorel... actually i was developing an appln.. in which i should get user choice by displaying a directory select popup window... i couldnt get ur answer ... iam developing my appln by c ...Show All
PhrankBooth running an executable program from the code
i would like to know how to run an executable file from the command line in C++ for example i am writing a code in C++ and i need to execute a program inside my master program . i will be so happy if you send me an example mahmud I'm pretty sure you can use ShellExec() to execute any file from the source. Read up API docs on the use of the function. It's fairly easy to use. See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=667530&SiteID=1 ...Show All
Abualnassr RegistrySettingsProvider
I'm using the RegistrySettingsProvider MSDN example to save settings in my WinForms application, but I have a couple of questions. First, When calling SetPropertyValues(), the app would fail when using SerializedValue. I then added code to check for propval->Deserialized to determine if I should use propval->PropertyValue->ToString() vs. propval->SerializedValue. Why does this happen and why is this not needed in the MSDN example Second, I now have an issue where I can compile and run my code in debug mode, but in release mode I get an unhandled exception of type "System.TypeLoadException". Could not load type "Namespace.RegistrySettingsProvider" from assembly Namespace, Version=1.0.2531.22047, Culture ...Show All
EjazAhmed Delete a certain tree node
hi, now i facing a problem which i do not know how to solve it...:( My binary search tree structures stores a double number in every node, whereby a higher number is appended as right child and a less or equal number is appended as a left child. Now i want to write a function which deletes the node with the highest number in the tree. I started the function as follows: [code] template <class Item> void bst_remove_max(binary_tree_node<Item>*& root_ptr, Item& removed) // Precondition: root_ptr is a root pointer of a non-empty binary // search tree. // Postcondition: The largest item in the binary search tree has been // removed, and root_ptr now points to the root of the new (smaller) // binary search tree. Th ...Show All
TKwin Problem with root/cimv2 namespace.
Hi, I have implemented in the code for wmi. It works just fine for cimv2 workspace and Win32_OperatingSystem class. It is not working for any other class (i need Win32_CDROMDrive) in cimv2 namespace. Not even working for root/wmi namespace. Is there anything else that I need to do Please help. Thanks , Manasi ...Show All
