Answer Questions
wycleft Visual C++ 2005 Express Edition: Where can I find msdev.exe ?
Hi, I am a newbie to visual c++ environment. I am trying to build some code from a command line environment. The documentation for the build refers to msdev.exe which I cannot seem to locate on my machine. Could someone please let me know where this is available If it is not shipped as part of Visual C++ express edition, please let me know that as well. The following is the list of software that is installed on my machine: - Visual C++ 2005 Express Edition - Microsoft .Net Framework 2.0 - Microsoft Platform SDK for Windows Server 2003 R2. If there is a package available that I need to install, please let me know. Thank you for your help and time. Regards, -- Nachi The name is now DEVENV.EXE ...Show All
susantez Timer stops after a while
I have an MFC application using 5 system timers with the following time-out values: 10 minutes 1 second 0.5 second 0.1 second 0.01 second It seems that all timers stop generating WM_TIMER after the program runs for a few days and everything else of the program works fine. Has anyone ever seen this kind of problem Am I using too many timers draining too much system resorce I have just combined the 0.5 second timer with 0.1 second timer into one to see if this helps. Since this is not a C++ language or compiler question I would suggest you ask this question in one of the MSDN discussion groups. Kernels is probably the best match. http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.pub ...Show All
Radith returning string from vc++ Dll to VB
Dear All, i want to return string value from vc++ dll to vb6.0. i am getting integer as return values successfully, but when i change it to string it gives error as The instruction at 'any Memory location' referenced memory at "any other memory location", The memory could not be written. my vb side function call is Private Declare Function process_func Lib "good.dll" () As String and in vc++, the function return type is CString. Pls guide me how to do it Thanks and Regards Munish Gupta this should help you: http://www.codeproject.com/string/bstrsproject1.asp A CString is a MFC thing; VB does not know what a CString is. You ...Show All
Jimname How do I activate the console and the GUI at the same time?
Hello comunity. How can I show the console and the GUI (Forms) at the same time .. it's for debug propouses.. Thanks. Thanks about the interest Peter, and thanks to the last sir to answer. That's SubSystem option works fine for debug. Best Regards You can build a CLR console application which spawns the windows you want. In your project properties under Linker, set the SubSystem to Console. Then the console app can instantiate your forms. Whenever I need some debug info during the execution of a GUI application, I use the following code: HANDLE hConsole; //Global variable //During software startup AllocConsole() hConsole = Ge ...Show All
Price Brattin How do I copy a class instance with a vector of instances of it's own type?
#ifndef _NODE_H_ #define _NODE_H_ #include "point.h" #include <vector> using namespace std; class node { public : node(); ~node(); point node_position; bool operator == ( const node &) const ; point grid_position; bool walkable; bool grid_exit; vector<node> neighbors; }; #endif In the above code I need the vector of nodes to properly be copied when I use the assigment operator and on the surface it appears to work just fine with the default copy constructor provided by the VC++ compiler. In usage I used the vector of nodes to find other instances of type node in a vector of nodes. However, the vector of nodes ...Show All
GT_MSDN 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
MurrayLang Hashtable in C++
Hi, I need to use a hashtable in C++. Apparently there isn't one, so I tried to use the hashtable in the System.Collections. After enabling the /clr in the solution explorer I can use a hashtable within functions, but not globably, which is my need. If i try to declare the hastable globaly it gives me this error: Error 1 error C3145: 'hs' : global or static variable may not have managed type 'System::Collections::Hashtable' Anyone know a way around this or of a different hashtable class that I can use thanks, that works great! can you give me an example of using the hash_map, say with a string as the key and the value ...Show All
itznfb How do VC++ set the Size and 'Topmost' of a console window?
I looked up MSDN and found the API function ' SetConsoleWindowInfo ' ,which can resize,according to MSDN, the size and position of a console window, however,I tried it and found it doesn't work at all.I don't understand why the API doesn't work on my PC(IDE: VC++ 6.0 OS:WinXP SP2). Some books says the API function, SetWindowPos ,can changes Z order of a child, pop-up, or top-level window.I want to set the console window as the topmost window,so I use the API function ,but I don't know how to get the handle of a console window,I tried to get a console handle by the sentence, consoleHnd = GetStdHandle(STD_OUTPUT_HANDLE); Unfortunately,I got the following error message: error: argument of type "HANDLE" is incompatible ...Show All
wenxincao Problem With Code (Unsure)
Hello, Im kind of new to C++ programming. I was trying to compile this off a web tutorial. Here is the errors: 1>------ Build started: Project: DirectX_001, Configuration: Debug Win32 ------ 1>Linking... 1>DirectX_001.obj : error LNK2019: unresolved external symbol __imp__PostMessageW@16 referenced in function _WinMain@16 1>DirectX_001.obj : error LNK2019: unresolved external symbol __imp__GetAsyncKeyState@4 referenced in function _WinMain@16 1>DirectX_001.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _WinMain@16 1>DirectX_001.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 1>DirectX_001.obj : error LNK2019: ...Show All
Zafar Ullah Weird "Goto" statement
I was reading an article entitled "The Case for Virtual Register Machines," where it had this code snippet: typedef void *Inst; void engine() { static Bytecode program[] = { iadd /* ... */ }; Bytecode *ip; Inst dispatch_table = { &&nop, &&aload_null, .... }; int *sp; goto dispatch_table[*ip]; iadd: dest = ip[1]; s1 = ip[2]; s2 = ip[3]; reg[dest]=reg[s1]+reg[s2]; ip+=4; goto dispatch_table[*ip]; } I've never seen "goto" used that way. I thought it could only be used for jumping to labels. Anyone know what this is about You are correct: neither Standard C++ nor Standard C supports syntax like this - they only support goto label. Having said that I have seen syntax like this i ...Show All
H. G&#248;ttig count the number of occurences of an item in a binary search tree
hi, i am currently implementing a binary search tree which stores double numbers in his nodes. now i want to write a function which counts the number of occurences of a specific item. i tried it in that way: [code] template <class Item> typename bag<Item>::size_type bag<Item>::count(const Item& target) const { size_type answer = 0; binary_tree_node<Item> *cursor; cursor = root_ptr; /* STUDENT WORK */ while(cursor != NULL) { if(cursor->data() > entry) cursor=cursor->right(); else if (cursor->data() < entry) cursor = cursor->left(); else if(cursor->data() == target) ++answer; } return answer; } [/code] Is that the right way or ...Show All
Brazzle fwrite in binary mode
I have a binary file that i am reading in an array and then after doing some processing i want to write it into a new binary file. The reading and the processing is working fine but writing back is not working. FILE *fptr; FILE *fptr2; unsigned short *ds; unsigned short *ds2; fptr = fopen( "C:\\abc.dat" , "rb" ); fptr2 = fopen( "C:\\abs2.dat" , "wb" ); fread(( void *)ds, totalSize, sizeof ( unsigned short ), fptr); // total size is the size of the data and is correct processds(ds, ds2); // ds is processed and copied into ds2 and works fine fwrite(ds2, sizeof ( unsigned shor ...Show All
jwraith Where shall I ask the quesiton about C? E.g. Question about how to generate different random numbers...
Dear all, I had one question about generating different random numbers. One piece of my code is as follows. Actually, because of the limited time, I don't think it can work. Its principle or algorithm is only to guarantee different values between generated values border upon/nearby. However, how to guarantee the value is different with all the previous ones, not only the border upon value. void initRandom() { int i,j = 0; for (i = 0; i < 100; i++) { random_numbers = rand() % 100; // Get random number. // Try to compare the value with previous ones. for (j = i; j==0 ; j--) { if (random_numbers[j] != random_numbers[j-1]) { break; } else { random_numbers[j] = rand() % 100; } } } } Do yo ...Show All
SQL2K5 VC.NET Question about Forms
I apologize ahead of time for asking a question that may be very simple to answer but I am new to C++ and .NET programming. I am trying to create an application that will have 2 forms. Form1 is the main form of the application and Form2 is the options dialog. I have tried to search MSDN and Google but have been unsucessful in my attempts (probably due to bad wording of my searches). I have a button with the following code: private: System::Void button1_Click(System::Object * sender, System::EventArgs * e) { &n ...Show All
aaks Hot to retrieve the date and and time of a system??
Dear all, Any one can remind me on how to retrieve the Date, Time or Datetime of a system using stndard C++ and wich header file should I use. I am using win32 C++ with Visual C++ 2005 express edition on windows xp Regards Bassam What would I use instead of tm_year to output time and date [edit] I got it working, but I can't get it to print them all on the same line : #include <ctime> #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { time_t t; time(&t); // get the current time tm *ptm = localtime(&t); // convert to local time cout << ptm->tm_hour<< endl; cout << ptm->tm_min<< endl; cout << ptm->tm_sec&l ...Show All
