Answer Questions
MuscleHead Asked for VC 7.1 libraries when compiling a project in VC 8
Hi folks: I encountered a problem when I was compiling a VC++ 8 project convered from .NET 2003 in Visual Studio 2005. When the process came down to link stage, the VS 2005 IDE asked for some version 7 VS libraries such as "mfc71.lib", "mfcs71.lib", "libc.lib", etc, which are not included in VS 2005. Could anybody provide any hints for cracking this problem. Thanks a lot in advance. Jason You'll have to link to one or more of the Leda libraries. Project + properties, Linker, Input, Additional dependencies = WhateverLedaLibrary.lib Yeah, that's an ugly fix. What were the unresolved external symbols Did you mean that the problem can't resolved ...Show All
CarmenM Help: Syntax for handle to subset of a managed array
I'm having trouble with the C++ syntax for managed arrays. The definitions are as follows: array<whcar_t> ^buf1, ^buf2; //Create two managed pointers to managed arrays of wchar_t type. buf1 = gcnew array<wchar_t> (10); //Instantiate 10 element array of wchar_t type. buf2= buf1[5] //Here I want to make buf2 point to element 5 of buf1 The following don't work: buf2=buf1[5]; //Conversion error wchar_t to array<wchar_t>^ buf2=(array<wchar_t>^)buf1[5]; //Conversion error wchar_t to array<wchar_t>^ What am I missing There is no such thing as a subset of a managed array. That's because you cannot have a handle that points to the midlle of another gc allocated object, ...Show All
Yoramkr Compiling a program in a program
What files should be in the same folder as the vcvarsall.bat and mspdb80.dll in order to get this program to create another program Here's the actual code: #include <iostream> #include <string> #include <fstream> #include <cstdlib> using namespace std; //works fine except for the compiling int main(){ ofstream fout( "newprogram.cpp" ); if (fout.is_open()){ fout<< "#include <iostream>\n" ; fout<< "#include <conio.h>\n" ; fout<< "using namespace std;\n" ; fout<< "int main(){\n" ; fout<< "int a = 23;\n" ; fout<< "cout<<a;\n" ; ...Show All
AlexBB A link error - LNK2019
Here is my program structure: #include "my_sub1.h" int main(...) { sub_fun(...); ... } The delcaration and definition of "sub_fun" function was saved in separated files -"my_sub.h" and "my_sub.cpp". But when I bulit it, though passed complie but failed in linkage: -------------------------------------------------------------------- Linking... main.obj : error LNK2019: unresolved external symbol "double __cdecl sub_fun(...) referenced in function _main. --------------------------------------------------------------------- Anyone tell me where am i wrong Yes, I modified my project that added all related source files. ...Show All
Farhad Tasharofi 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
cdun2 CRichEditCtrl Problem
Hi, This is done in VC++ MFC I have created a vector vector<CRichEditCtrl*>RichEditBox; CRichEditCtrl *r1 = new CRichEditCtrl; r1->Create(WS_CHILD|WS_VISIBLE|ES_AUTOVSCROLL, CRect(x1,y1,x2,y2), p, 1); r1->SetEventMask(ENM_CHANGE | ENM_SELCHANGE ); RichEditBox.push_back(r1); With the above code I get n cricheditboxes on a window . How do I navigate within these boxes using Up Down Arrow Keys Pritha Hi, I think you can use "TabOrder" property of these controls, so you can navigate them by "Tab" key. If you want to use up and down arrow you must receive a "KeyPress" message and then set focus on CRichEditBox control. Regards. Pritha, as I s ...Show All
pyeung Reinstalling VC++ 2005 - New machine
Hi, This week, I acquired a new computer. Before I erase former computer, I installed and configured my development environment. No problems except when I tried to install and configure Visual Studio 2005. Everything went OK except the fact that after successfully compiling a sample C++ application, I cannot run it... I even tried to run a few C++ applications (.exe) I made in the past (out of VC++ 2005 environment on former computer), directly from Windows explorer, and I cannot run them either... Seems something is missing... I compared programs installed between my former machine and my new machine and the only difference I could see  ...Show All
chiraj CaseSensitive Keyboard Hook
Hi, i made a programm. it displays the entered keys in a console window. But all letters are in "caps lock"! How can i prevent that eg. if i enter: aBcDeFg it displays: ABCDEFG [code] __declspec(dllexport) LRESULT CALLBACK KeyEvent (int nCode,WPARAM wParam,LPARAM lParam) { if ((nCode == HC_ACTION) && ((wParam == WM_SYSKEYDOWN) || (wParam == WM_KEYDOWN))) { KBDLLHOOKSTRUCT hooked = *((KBDLLHOOKSTRUCT*)lParam); DWORD dwMsg = 1; dwMsg += hooked.scanCode << 16; dwMsg += hooked.flags << 24; char key[16]; GetKeyNameText(dwMsg,key,15); std::cout << key; } return CallNextHookEx(hKeyHook,nCode,wParam,lParam); } [/code] uhmm... is there ...Show All
Shrek.NET Compiler Crash
OK I know I shouldn't have written it, it was a result of some slow responses on the machine that a class name got replaced by a bracket, and I;ve thrown away a lot of unnecessary stuff however:make a file containing typedef struct {} (; And the compiler will crash. .Net 2005, I haven't tried it on 2003 or Team System. BTW I saw another "compiler crash" thread http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=323623&SiteID=1 That referred the submitter to http://lab.msdn.microsoft.com/productfeedback/default.aspx So I went there - and ended up back here. Andy Andy Champ wrote: Still, if Corporate Microsoft's view of a report that someone raises saying that they (MS)&nbs ...Show All
maryz create a child window that is join side by side to parent window
Hi, i do not know whether is this the way to ask this question. i am actually creating a window extension in IE. And i am required to create another window that will be join side by side to IE (even on resize) i have saw it somewhere b4 that it is possible but i do not know how to. PLease help as it is my final year project Thanks Regards Roy hi Viorel..i have look through the page.. thanks for the advice given. and yes i am developing COM objects, however, i am creating a new application window that will attach to the IE Explorer. Actually, the whole story is that 1)i will create a toolbar button 2) On click the toolbar button, another window appears and attach itself t ...Show All
Reid Williams Compiling sourcecode written in vc++ 1.52 in vc++6.0
Hello every body. I am quite new to vc++ arena. I have an application written in vc++ version 1.52 ( very old version 16 bit Dos ) and the application is deployed in client machines. Is it possible to compile the same source code in VC++ 6.0 Or I have to compile the source code in vc++ 1.52 only to give patches to the user I am getting lots of compilation errors. I would appriciate if anybody can guide me. Thanks in advance Martin thanks a lot for your assistance, I modified some code and replaced some include files and now most of the errors vanished. If I give a patch which is recompiled in vc++ 6.0 will it be compatable with the existing application written in vc 1.52 Would greatly appriciate if you can provi ...Show All
mfeo RightClick on CListCtrl and application hangs if clicked out of application
i am using a list on a child dialog which is a CListCtrl object. If i RightClick on that list and click out of application, the application hangs and does not respond. the message is 135 on which it hangs.. It works well if i am in the application. how can i solve this the right click code sample is here: void CScanWizard2Dlg::OnNMRclickList(NMHDR *pNMHDR, LRESULT *pResult) { //*pResult = 0; //get selected item POSITION pos = m_listCategories.GetFirstSelectedItemPosition(); if (pos) { CMenu menu; //load context menu VERIFY(menu.LoadMenu(IDR_MENU_SELECT)); CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); POINT point; ::GetCursorPos(&point); TrackPopupMenu(p ...Show All
Kohl.Mike Changing Static properties.. Is this impossible?
Hi there.. I have been trying for days now to change the property of visible on a static text control in my application to false during runtime. I have researched this and researched this, and even posted on Expert Exchange, but no one seems to know how to do this.... I'll post the answer I was given on EE.com, and hopefully someone here will know more about it. I have only been programming in C++ for a week now, so forgive me if this is a stupid question.... I have several static text controls setup in my application (DirectX pong game) to report various stats that assisted me in creating the game and diagnosing troubles that may arise setup in a console.rc resource in my project. These are displayed in a control panel beneath the ...Show All
jschroeder GDI+ problem
Hello all. I have some strange problem with displaying images through GDI+. I use the following code: case WM_PAINT: HDC hdc; PAINTSTRUCT ps; hdc = BeginPaint( hwnd , &ps); Graphics graphics(hdc); // here goes some painting... EndPaint( hwnd , &ps); return 0 ; The problem is that after executing that painting, there is no immediate effect on a window. I have to, for example, minimize and restore my window if I want to see the painting effect. What could be wrong with that code Thanks in advice for any suggestions. Best regards. Thanks for reply - it is a solution :-) Window painting / repainting is onl ...Show All
TheSilverHammer How do you set the name of a thread in C++?
This is something that I've been able to do in linux development, but I have not figureed it out in Visual C++. I've noticed that the thread list contains names, however they are always the same and I cannot seem to find the way to name them. This is not an MFC application. Currently, I'm using _beginthreadex to create the thread. That looks promissing... I can use it to set the name of the caller thread, but when I try to set it using the ID returned by CreateThread, it does not seem to work. Any ideas If you've got sufficient access to the other thread, which you should have after spawning it with CreateThread, I don't know why it could fail. You're absolutely certain that the ID is correct As an alternative you could const ...Show All
