Answer Questions
mario.muja Editing Array of string values from CSV file
I'm new at this so please bear with me. I have a CSV file that contains about 500 rows and 50 columns. I need to keep all the rows but only keep columns 1,2,3,4,6,7. I've opened the CSV and stored each row as a single element in a one-dimensional array. What I need to do now is search through those array elements and remove everything except column 1,2,3,4,6,7. Am I approaching this problem correctly If so, how do I proceed I'm stuck. Thank you very much einaros. That's exactly what I need. Can you recommend a good book or site that contains information about this particular issue I'm new at this here at work and I need to get up to speed quickly. Try Console::WriteLine(t ...Show All
infomax Recursive function call issue
I have the following incomplete recursive function: String* all_files(String* sDir)[] { String* f[] = Directory::GetFiles(sDir); int numFiles = f->get_Length(); String* d[] = Directory::GetDirectories(sDir); int numDirs = d->get_Length(); for (int j=0; j < numDirs; j++) { all_files(d[j]); } return files; } The above is supposed to return the full list of files in sDir. What it does successfully is going through every single file in sDir (including the files in sub-directories). What it doesn't is returning what it is supposed to return: an array containing the full path of all the files in sDir. The variable "files" is undefined because I wasn't sure where would be the best place to define it. Btw the ...Show All
Kirt C. Network Programming
Hi guys, I have to work in Visual studio 6.0 . I am new to Visual C++ programming. I am working on a project that requires communication between PC and Microcontroller. I have to built a TCP/IP stack in microcontroller. I think my Microcontroller would be a server. I don't know what i have to do on PC side. Do i need to implement TCP/IP protocol on PC side as well OR I should work with STREAM SOCKETS OR DATAGRAM SOCKETS. What kinds of library packages should I use to achieve this. Winsock (windows socket 2), CSocket or other I found much information on the net but I don't know which method is gd for me. Bye You can use Winsock. If your client app uses MFC, you could also use the MFC socket classes (like ...Show All
Roxanne163 Napster Visual C++ Runtime Error
When starting Napster I now get an Error that says Microsoft Visual C++ Runtime Library Runtime Error Program E:\Program Files\Napster.exe The application has requester Napster to terminate in an unusual way. I have contacted Napster and re-installed it along with updating Media Player 10 and in line with other mentions on these forums I have deleted Google toolbar and Mozilla Firefox. I have AVG free and Zone Alarm as firewall and antivirus and i am running XP student with SP2. I have also deleted DivX video software and Itunes and run spyware tools, MS update and Ccleaner. I still get the above error. Can anybody suggest what has happened or what I may do to get Napster working again. Thanks Tony ...Show All
Gulden LNK2019 with template destructor/constructor
I am having trouble linking a very compilable program. I have a class (defined in its own header/source files) called cScript. It inherits (publically) a template class cResource< class Type > (also defined in its own header/source files). When I try and link the program I get the following build log. do they have to be written into the header file... I want to keep the definitions seperate from the implementaion. Is there another way The implementations of the cResource template class methods need to be available to the cScript class. The linker doesn't take care of that, write them in the header file that declares the template as inline methods. Well I tried to mark the functions of ...Show All
MaxL Is the function printf thread safe?
Hi, Is the function "printf" thread safe Visual studio 2005/2003 C++ compiler. We are seeing random crashes in a multithreaded environment mostly in printf and are trying to investigate in this. - Kedar The problem for the crasher was our linking to non-multithreaded version of libraries. Our build script should have set USE_LIBCMT flag but was missing this for some reason. You can find more about this on MSDN Sorry about being lazy and updating this immediately. Hope this provides help to someone whose code crashes in printf for no reason ;) Thanks einaros. - Kedar Thanks einaros. Why does MSDN not mention the fact that printf is th ...Show All
jam66 Get System Date and Time
Hi all, Can anyone plz help me how to get the System date(dd:mm:yyyy) n time(hh:mm:ss:miilisec) in Managed C++ without using the DateTime class regards, Kish Did you tried SYSTEMTIME . if not have a look in MSDN thanx try this time_t now = time(); // get current time as an integer struct tm* tm = localtime(&now); // convert time to structure // now just do whatever you want with the structure // see strftime() or just printf() or have a look on the Following Link http://www.codeguru.com/forum/showpost.php p=1301560&postcount=8 Thanx Is it possible to get the date and time(hh:mm:ss:milisec) by using PerformanceCounter coz by using struct tm *newtime; we r having some performance issue ...Show All
DongMT Resize main window of an application
Hello, While resizing the main window, say reducing the size by mouse, I want that the window size cannot be further reduced when it comes to a minimum value. The application is developed using VC++ 2005 and MFC. Please tell me how I can do it. Once i posted the same inside my blog You can see the post here Restrict Window Sizing Taken from the post To accomplish the same, you may need to override OnSize message Here’s a sample snippet to do the same. const LONG MIN_WIDTH = 500; // Minimum width const LONG MIN_HEIGHT = 300; // Minimum Height void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect) { // Set the minimum size if width going to be less than minimum width if ((pRect->right - pRect->left) <= MIN_W ...Show All
Dmitry Pavlov Platform SDK atl libs
For the lack of a better forum (I was looking for a PSDK forum), I ask here. Why are ATL libs included for AMD64 platform in the PSDK (SRV2003R2), but not for IA64 and x86 platforms There is PSDK\lib\amd64\atlmfc\atl.lib and PSDK\lib\amd64\atlmfc\atlamd64.lib, but no such libs for IA64 and x86. I am looking for some library that exports AllocStdCallThunk. you don't need a lib to use ATL from the Platform SDK. Just follow steps 1 to 4 here: http://www.codeproject.com/wtl/WTLExpress.asp It does Why doesn't my answer satisfy you You see, unlike VS2005, only the x86 compiler and libs shipped with the earlier versions of VS so they put them into the PSDK so ...Show All
markand LNK2005 in debug mode only(VS2005)
I am encountering error LNK2005 when I am building my DLL. The queer thing bout this is that this happens only in the debug mode while it runs fine in release mode. I have attached the linker options for both debug and release modes. Release Mode: /VERBOSE /OUT:"..\..\..\Bin\Release/man.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Release\man.dll.intermediate.manifest" /DEF:"..\man.def" /DEBUG /PDB:"..\Release\man.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /IMPLIB:".\Release\man.lib" /MACHINE:X86 /ERRORREPORT:PROMPT Setupapi.lib Shlwapi.lib \msi.lib ..\..\..\Libraries\base\release\base.lib ..\..\..\Libraries\func\Release\func.lib ".\release\ceg_vs80 ...Show All
Chris Beiter - MSFT Can't link a managed wrapper (mixed managed/native) assembly to a static lib???
Unless I'm missing something, this seems like a fairly major limitation... I have a mixed manage and native "wrapper" assembly project that wraps a third party's static library. We do not have a DLL version of the third party library, just the .lib. In VS 2003 with managed extensions for C++, the project compiled and linked fine. Now, after having converted all the managed extension stuff to C++/CLI, I have it all compiling. However, it does not link because of multiply defined symbols (LNK2005 error). It appears the static library had linked (statically) to libcmt.lib When linking my project I get 20 or so linker errors like this: libcmt.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR80D.dll) My ...Show All
khawaja Help with chars
Hi again, i has question about chars sequence. if i has char sequence like that: "{\k25}mi{\k16}a{\k19}ge{\k17}ta {\k17}yo{\k17}" and i want return me only 25 16 19 17 17 17, in other words only what after k in each {} how can i do that thanks. Hi, you have to build a simple parser that would return those numbers. Example: #include <iostream> #include <string> #include <vector> using namespace std; void main() { string s = "{\\k25}mi{\\k16}a{\\k19}ge{\\k17}ta {\\k17}yo{\\k17}"; // our string vector<string> vec; // holds the values // go through every ocurrence of "\\k" size_t index = s.f ...Show All
JennyMQuinn bug in wingdi.h ?
Hello, could someone verify this is bug : #define GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8)) Atleast for me it throws runtime-check-error when used. """ Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example: char c = (i & 0xFF); Changing the code in this way will not affect the quality of the resulting optimized code. """ Change to #define C_GetGValue(rgb) (LOBYTE(((WORD)(rgb&0xFFFF)) >> 8)) helps, so it seems like a small bug in headers to me. I wouldn't like to spam the Microsoft Connect with this th ough... Regards, Mar ...Show All
Kailai CreateCompatibleBitmap failing
On a test Windows XP machine with 5 monitors (Overall desktop bounding box is 3328x2048), I create a bitmap that will span the entire display. Normally this works fine. However, if several applications are open (in particular multiple instances of IE7 on certain web sites), the call to CreateCompatibleBitmap(hdc, 3328, 2048) fails and returns NULL. GetLastError in this case returns 0 (NoError). Is there a limit to the total amount of bitmap space that the system can allocate Is it normal for CreateCompatibleBitmap to fail with no error code Anyone have any ideas on how to work around this, or is there a system setting that can allow more memory to be dedicated to bitmaps Modified my code so that ...Show All
Daticus Platform SDK atl libs
For the lack of a better forum (I was looking for a PSDK forum), I ask here. Why are ATL libs included for AMD64 platform in the PSDK (SRV2003R2), but not for IA64 and x86 platforms There is PSDK\lib\amd64\atlmfc\atl.lib and PSDK\lib\amd64\atlmfc\atlamd64.lib, but no such libs for IA64 and x86. I am looking for some library that exports AllocStdCallThunk. Thanks for the replies. I am aware of the workarounds for the problem. The libraries, for example, are also included in the DDK. My question was about the inconsistency - libraries for AMD64, but not for x86/IA64. The question still remains open. you don't need a lib to use ATL from the Platform SDK. Just ...Show All
