Software Development Network Logo
  • Visual Basic
  • Windows Vista
  • Audio and Video
  • SharePoint Products
  • Visual Studio
  • Windows Forms
  • IE Development
  • .NET Development
  • SQL Server
  • Microsoft ISV
  • VS Team System
  • Visual C++
  • Visual FoxPro
  • Smart Devicet
  • Visual C#

Software Development Network >> Visual C++

Visual C++

New Question

Direct Show Question
Using AFX_MANAGE_STATE
Read access violation when buffer bigger than 2048
Which tables are in an excel file? Using ODBC with CDatabase
Native C++ : Report on what the optimizer has done?
can no longer drag arrow to change next statement to execute in vs05
Slowdown with MSVC memory operations
Smartbridge Alerts
VC.NET Question about Forms
How do VC++ set the Size and 'Topmost' of a console window?

Top Answerers

wsaunders
JoshKorn
glassman324
Jeremy Lew
Pom Figueroa
Sunath
Marek Istvanek
Anatolik
Tom_Liu
Sebastien LEIX
sitemap
Only Title

Answer Questions

  • xRuntime _CrtIsValidHeapPointer() fails on deletion of DLL allocated object

    Hello, I try to bring an interface of a DLL, exporting some methods which take use of STL containers and C++ Standard Library types, to work. I tried to get a minimal non-working example, but every example I can come of in a new project just works as expected, so I hope you may recognize some flaw in the original setup. The DLL is loaded via LoadLibrary(), and a function in the DLL has a declaration like   long foo(std::string& bar); It is called via a function pointer retrieved via GetProcAddress(). Function 'foo' computes some value and simply wants to do 'bar = my_other_string_object'. The calling function does something like   void baz() { string result; if(foo(result)) { throw ...Show All

  • Rups11 C++/CLI - Class assignment

    Hi, I'm currently converting apps from Managed C++ to C++/CLI. So far not so bad except that I'm not so sure about how to convert current operator+ assignment to C++/CLI syntax. In Managed C++, I had the following: CL_Modules* CL_Modules::op_Assign(CL_Modules& Nouv_Module, const CL_Modules& Module_Src) { if(&Nouv_Module != &Module_Src) { Nouv_Module.Collection = Module_Src.Collection; Nouv_Module.Module = Module_Src.Module; Nouv_Module.Fig_Xpos = Module_Src.Fig_Xpos; Nouv_Module.Fig_Ypos = Module_Src.Fig_Ypos; // Copy infos vs graphicspath Nouv_Module.Figure = dynamic_cast<GraphicsPath*>(Module_Src.Figure->Clone()); // Copy array vs Region(s) Nouv_Module.FRegion = dynamic_cast<Rec ...Show All

  • Andrea Montanari Animating with Allegro within VC++ 2005

    G'Day all. After working some time on a code that enables the user to animate a .bmp image on screen using the arrow keys, it has been a story of so close yet so far. After going through and fixing any sytntax errors, my program compiled and linked fine, the window came up with my first animation frame on it but as soon as I went to move it with the arrow keys, 'Bing Bing' ".....Corruption of the Heap , Debug Assertion Failed (file: dbgheap.c), ...runtime to terminate in an unusual way . Now I am lost and getting very frustrated. Can someone please give me any clues as too what the hell is going on !! G'Day Damien. First off, I am really not sure the exact line of code that is causing the error. I will insert the entire code wh ...Show All

  • laserbeam Why is casting needed in this example

    I am a little stuck understanding why casting is needed in the following example (Example taken from MSDN website):- // A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #include <stdio.h> #include <windows.h> typedef int (*MYPROC)(LPTSTR); VOID main(VOID) { HINSTANCE hinstLib; MYPROC ProcAdd; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; // Get a handle to the DLL module. hinstLib = LoadLibrary(TEXT("myputs")); // If the handle is valid, try to get the function address. if (hinstLib != NULL) { ProcAdd = (MYPROC) GetProcAddress(hinstLib, TEXT("myPuts")); // If the function address is valid, call the function. if (NULL != Pr ...Show All

  • tribal C++ in .NET environment

    Hi, How can I know if my C++ project is manneged (i.e. requiers the .NET framework ) or unmanneged (i.e. pure C++ ). Is there a way to set it On and Off I looked for it in the project properties and couldnet find it ... doe any body have a clue Best regards. Yeah, regular C# can have a weird effect on your C++ coding :-) The reverse works too - I had a few occasions of attempting to use gcnew in C# :-) See this project setting: Project > <your project> Properties... > Configuration Properties > General > "Common Language Runtime supported. Regards, SvenC Replace #using <iostream> with #include <iostream&g ...Show All

  • EnterBS Depricated Functions

    Hello I have just now ported my VC 6.0 to Visual Studio 2005. I am facing with some crashes in my application. The place where i am finding this is the depricated functions,specifically now i am facing an error with strcpy. I dont know y it is crashing..can anyone please help me on how do i work with the depricated functions. Thanks & Regards, Ravi Kanth Try the following approach size_t nStrSize = strlen(TabTitle); size_t nBufferSize = nStrSize + 1; // size of string + null character TCITEM tcItem; tcItem.mask = TCIF_TEXT; tcItem.cchTextMax = nBufferSize; tcItem.pszText = new char[nBufferSize]; strncpy_s(tcItem.pszText, nBufferSize, TabTitle, nStrSize); // do whatever with tcItem delete[] tcItem.pszText; Wel ...Show All

  • Chris Marts Command handlers differences (ON_COMMNAD_EX use )

    Hi all , I created a dialog based application in MFC and added one menu item (ID_MENUTEST_MENU1 ) after hitting on that menu only ON_UPDATE_COMMAND_UI andON_COMMAND gets called . i want to know the use of ON_COMMAND_EX and when it gets called CODE: ON_COMMAND(ID_MENUTEST_MENU1 ,OnCommand1) ON_COMMAND_EX(ID_MENUTEST_MENU1 ,OnCommandEx1) ON_UPDATE_COMMAND_UI(ID_MENUTEST_MENU1 ,OnCommandUI1) void CDataExchangeDlg::OnCommand1() { AfxMessageBox("Oncommand1"); } BOOL CDataExchangeDlg::OnCommandEx1(UINT nID) { AfxMessageBox("OnCommandEx1"); return true; } void CDataExchangeDlg::OnCommandUI1(CCmdUI* pCmdUI) { AfxMessageBox("OnCommandUI1"); } Viorel gave you an answer. I just want t ...Show All

  • S.K.Andy Circular dependency in visual c++

    I'm trying to make a game in c++, and it would be nice to be able to use circular dependencies without always having to find some work around (mostly because I'm used to java, and this sort of thing isn't a problem for java). I tried forwarding the declarations of the classes involved, but it didn't work (if you want to see an example http://en.wikipedia.org/wiki/Circular_dependency ). The compiler is giving me some weird errors: 1>C:\Program Files\Microsoft Platform SDK\Include\winnt.h(893) : error C2143: syntax error : missing ',' before 'constant' 1>C:\Program Files\Microsoft Platform SDK\Include\winnt.h(894) : error C2988: unrecognizable template declaration/definition 1>C:\Program Files\Microsoft Platform SDK\Inc ...Show All

  • adorer msvcr80.dll Problem

    Hi there, can someone possibly tell me why Noton WinDoctor is telling me that 10 executables in the .NET Framework 2.0 cannot access the necessary dll file msvcr80.dll I see that the dll exists in the WinSxS directory and I'm running XP pro. I didn't have this problem until I downloaded the 2.0 framework at windows update. Any advice appreciated. Thanks. Naolin This works. Thanks delta579. I am having the same problem... I even uninstalled it.. and it didnt show a problem then I reinstalled the update and it showed up as a problem in the Windoctor again... any ideas as to what is wrong with this update Im sure its a simple fix but I cant seem to get it.. ...Show All

  • mrginger About the C4430 Error

    Hi! I got these 2 function declarations in Visual C++ 2005 Express Edition CODEC_API extern AWC_decodeSwaths(AWC_Tag *tag, AWC_Image *buffer, int regionIndex, int stride, char **ptr, int *copyFunction( void )) ; CODEC_API extern AWC_encodeSwaths(AWC_Tag *tag, AWC_Image *buffer, int *regionIndex, int imageWidth, int imageHeight, int lines, int reuse_flag, int stride, char **ptr, int (*copyFunction)( void ) , int rate_flag, int goalbits); Athough all seems to be ok, the C++ compiler gives me the next error code: C4430: missing type specifier - int assumed. Note: C++ does not support default-int I know It's about the marked code, but i can't solve the problem. I hope someone can help m ...Show All

  • qt1h00 error LNK2005: _main already defined

    I recently installed VC++ 2005 EXP edition. 1) I created a project name Radius and created two new items hello.cpp and area.cpp. 2) area.cpp is the first item and hello.cpp is the second one. 3) When I build the project Radius, I got the error LNK2005: _main already defined in area.obj Can you guide me to fix the compilation error. Thanks GKW82 Here is the piece of code. 1) radius.cpp #include <iostream> /* program to calculate radius of a circle */ void main() { float area, radius; printf( "Radius = " ); scanf( "%f" , &radius); area = 3.14159 * radius * radius; printf( "Area = %f" , area); } 2) h ...Show All

  • Crafty69 Change in behavior of properties from VC7.1 to VC8

    In VC7.1 in the property pages for a project, if I entered a relative path for an include file on the "Additional Include Directories", then the IDE showed valid paths relative to the project file. In VC8, relative paths are all relative to some path in the install directory NOT my project. How can I get the VC7.1 behavior This new behavior is not intuitive. I never place my files relative to the install directory. This seems to be an unpleasant feature in VC8. When will this be fixed So I've been poking around the forums here for an hour or so looking for a resolution to this relative path auto completion issue. Has there been a solution that I cannot ...Show All

  • Shril Pyrrho Trying something new

    Hi all. Im trying something new. Something yesterday gave me an idea that i could use it with more than one source file. So i created 2 source files and 1 header file to do all the including and bridging communication between sources. Here's what i have so far. Source 1 #include "include.h" int main(){ const SIZE = 100; char msg[SIZE]; printf("Enter a file you'd like to read: "); cin.getline(msg,SIZE); if(!msg){ printf("File %s doesnt exist.\n",msg); } else{ printf("Reading file %s",msg); readfile(); } return 0; } Source 2 #include "include.h" void readfile(void){ char buffer[100]={'\0'}; ifstream file("test.txt"); while(file ...Show All

  • Uturn utility(21) : error C2059: syntax error : 'end of file'

    I have worked in C and C++ for a while, but have always made an effort to avoid class templates and especailly the STL. Well now I have found some code that represents a client that would be really useful to me but it uses STL extensively. Anyway I compiled the client and it compiled fine. I then noticed that the client contained two seperate buffers (each is a list<string>) that could be used at the same time, but was only using one mutex to control access to both. Access to wait and release the mutex is controlled through two class methods and the mutex itself is private. Other class functions dealing with the two buffers use a const std::string& to decide which buffer to work on so I changed the class def (.h) as well as th ...Show All

  • Kamii47 Running a very simple Win32 app on a comp without VC++ 2005 Express

    Hi! I have installed VC++ 2005 Express and the Platform SDK according to the instructions on MSDN: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx Compiling and running the following program on the dev computer works like a charm: http://www.winprog.org/tutorial/simple_window.html I then changed to release-mode, turned off debugging in the project properties and copied the .exe to another computer without VC++ 2005 Express on. I pretty much expected problems, so I wasn't very surprised when I got the error message saying that there was something wrong with the program configuration, like the one here: http://forums.microsoft.com/msdn/showpost.aspx postid=23371&siteid=1 I have since then combed this forum and ...Show All

656667686970717273747576777879808182

©2008 Software Development Network

powered by phorum