Answer Questions
MrOctree Is there a expert to tell me the step needed to upgrade from vc6 to vc 2005?
It is very hard to find some useful information on how to migrating from vc6.0 to vc2005. Is there a expert to tell me the step needed to upgrade from vc6 to vc 2005 I appreciate your help. Please tell me how can I identify which head file is wrong This error is usually caused by mixing old and new PSDK header files. You should use the /showIncludes compiler option to check that all your header files are coming from the same installation. Open project in VS2005 and compile it. You will get a lot of warnings about unsafe string operations which can be deprecated or fixed (it is better to fix them). VC++ 8.0 has more strict type checking, and some code lines can give errors, but fixing is straightforward. For example, ...Show All
RobertMC70 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
mabrouk I am stuck please help
I need to write a program that will calculate the difference between those two days, I am getting those two errors: ------ Build started: Project: compare_2dates, Configuration: Debug Win32 ------ Linking... compare_2dates.obj : error LNK2019: unresolved external symbol "public: class Date __thiscall Date::operator-(class Date const &)const " ( GDate@@QBE AV0@ABV0@@Z) referenced in function "public: int __thiscall Date::GetData2(void)" ( GetData2@Date@@QAEHXZ) compare_2dates.obj : error LNK2019: unresolved external symbol "public: int __thiscall Date::compare(class Date const &)const " ( compare@Date@@QBEHABV1@@Z) referenced in function "public: int __thiscall Date::operator==(clas ...Show All
xlordt Concatenation (sp?) of char* and int types
Hi, is there any way that I can concatenate two variables of type char* and int For example: char* var1="hello"; int var2=3; How can I arrive at "hello3" and store it in a char* format Thanks in advanced. ---Dan You can use sprintf. You might want to use the new secure CRT version though (see http://msdn2.microsoft.com/en-us/library/ce3zzk1k.aspx ) Well, I'm not using VS...I'm using Dev C++. Just for the record. Can you give me example code Thanks. Thank you but I found a different solution: string str="hello"; str.append(3); char* c=const_cast<char*>(str.data()); Thanks anyway. Here is the C ...Show All
SpecialA10 Getting error error LNK2019: unresolved external symbol "int __cdecl
Hi, i have written a function in one dll.i am not able to use the function in another dll.it throws linker error as error LNK2019: unresolved external symbol "int __cdecl function()" if anyone experienced above error pls let me know. Thanks, Ganesh Hi , i have checked both debug and release project settings, both are same.But still i am getting the error. I like to know whether it needs any code changes to be done or by just changing the project setting solves the problem. Thanks, Ganesh 1. Did you added the correct libary 2. Are you sure that the DLL has the same function definition Yes i have added the corr ...Show All
Mark B . StrCopy
Any one can tell me whats de function do StrCpy(not strcpy).MSDN also gives security wanring in its documentation.I want to know details about that function. Why microsoft given security warning regarding that function.Thanx in Advance Hi, if you're referring to this function: http://msdn.microsoft.com/library/default.asp url=/library/en-us/shellcc/platform/shell/reference/shlwapi/string/strcpy.asp then it's a function from the windows API (windows shell) that does the same as strcpy. I never used it but I'm guiding by the place where it's located in msdn: " MSDN Home > MSDN Library > Win32 and COM Development > User Interface > Windows Shell > Windows Shell > Shell Light ...Show All
Jean-Jean Vista "for loop" problem
In code that runs correctly in XP, I have a for loop. 1. for (int nIndex = 0; nIndex < 256; nIndex++) { 2. array[nIndex] = something; ... In Vista, at line 2, nIndex = -856238756375 or something like that, ie. uninitialized. Obviously, this causes a crash. Is this a known bug The best way to avoid speculation is for the original poster to give us a step-by-step reproduction (with a new project) of the problem that leaves out no details, including the version of Vista being run. I installed Build 5728 yesterday and cannot reproduce the problem. I did have problems with crashes related to USB driver. In my VM, I removed the USB port and now ...Show All
Hua-Ying Interop Problem - Managed C++ Wrapper Not Working Properly
I like most people have a couple C++ .lib files that I need to be able to call from C#. Therefore I am writing a managed C++ Wrapper class that has methods to call the functions I need. In the libraries I have several functions (not class functions) that I need to be able to call. When I call one of these functions I get a "Unhandled Exception: System.NullReferenceException: Object Reference not set to an instance of an object at get_customer(CustomerResult*, Int32)" This get_customer method has a prototype of: CustomerResult get_customer(long customer_id) where CustomerResult is just a struct. Can anyone advise on where I am going wrong Thanks for the help. Currently I can only us ...Show All
KerryLW CreateFile and GetVolumeInformation fail
Hi there. I'm trying to get the informations - filesystem name, etc - of disk partition, and if unformatted volume, want to get like "unknown filesystem or unformatted". Also, I want to get the informations of partition which is formatted by linux filesystem and unmounted if linux filesystem driver is running. So I tested simply as follow: #include <stdio.h> #include <Windows.h> #include <Winbase.h> #include "test.h" #define DISK 2 #define PARTITION 3 main() { int i, j; char DevName[256]; int FileSystemFlag; char FileSystemName[64]; int BytesReturned, LastError; HANDLE hdrive; EXT2_PARTITION Ext2Partition; /* open */ ...Show All
sagebrushsag Strange thing about strlen() and strcpy_s()
For example this code is given: baseDNA::baseDNA(const char* l, int r) { label=new char[strlen(l)+1]; cout<<strlen(l)<<' '<<strlen(label)<<endl; // 10 3 strcpy(label,l); rating=r; }; testing sample: baseDNA shirt("portabelly", 8); it executes well, except for the label's new length, it always show 3, there was simlar question before but didn't get the point. Because strcpy is deprecated, the code is beeing rewrited this way: baseDNA::baseDNA(const char* l, int r) { label=new char[strlen(l)+1]; strcpy_s(label,strlen(label),l); rating=r; }; The code is also executed but then windows error encounter. Thank You for answering. You are claiming to ...Show All
Sylvain Arene Platform SDK for GDI+
Hi All, I am having the Problem with executing GDIPlus Supported methods.I had gdiplus.dll in my apllication folder.But surely the application needs gdiplus.h and gdi.lib. i couldn't download it anywhere.Can anybody give me the route to proceed further OS I am using is : Windows 2000 pro . This is the application i wish to execute . #define UNICODE #include <windows.h> #include <gdiplus.h> using namespace Gdiplus; VOID OnPaint(HDC hdc) { Graphics graphics(hdc); Pen pen(Color(255, 0, 0, 255)); graphics.DrawLine(&pen, 0, 0, 200, 100); } LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow) { HWND hWnd; MSG msg; W ...Show All
R.Tutus This code snippet makes no sense...
I've come across some code syntax I've never seen. It compiled, but I don't know how, or what it even does! I've been reading a book about DirectX, and in one of the examples, this little piece of code was present: D3DXMATRIX *D3DXMatrixIdentity(D3DXMATRIX *pout); "D3DXMATRIX" is a type, of course. And "D3DXMatrixIdentity" is a function, of course. Now I don't see how this works. Okay, to break it down, first we have a type, which is D3DXMATRIX, then we have the indirection-operator (which I assume is a pointer), and then we have a function (perhaps a call) with a new D3DXMATRIX (pointer) as it's only parameter. How the heck does this work It isn't just a regular function-call. It isn't a function-call that' ...Show All
Mike Greenway trying to use localtime.....
Hello...I'm trying to have it display the local time of the users location.....It's weird that TickCount is in Environment:: .. but LocalTime is not. How do you get it to get the local time ! Thanks. Include <time.h> There is localtime defined. C++ is case sensitive so be sure to use it all lowercase. You might get a security warning from the compiler. Use localtime_s instead to use a secure version. -- SvenC GetLocalTime returns a void you cannot initialize a string with that and you cannot pass an unintialized pointer to GetLocalTime - well you can, but... Use this instead: SYSTEMTIME st; GetLocalTime(&st); System::String^ s = System::String::Forma ...Show All
N. Farr Reverse Engineering with Visual C++ 2005
Hi there, I've installed VS2005 Professional and Visio Professional 2003 SP2. According to MSDN there should be a way to reverse engineer an existing C++ project: ' From the Project menu point to Visio UML, and then click Reverse Engineer. ' Unfortunately, there is no corresponding menue item at all in VS. Do I have to configure this first Thanks for any advice Artschi Artschi wrote: [...] I've installed VS2005 Professional and Visio Professional 2003 SP2. [...] Maybe Visual Studio 2005 and Visio 2003 cannot be used together Perhaps the UML diagrams of Visio 2003 works with older Visual Studio 2003 only Maybe you should try a newer Visio ...Show All
OniShiro Debug has different memory?
Hi, I am trying to create many instances from one application, but every instances should have different event. So every time I execute my application, one instance will create a new event. I use the following lines: string temp = "A"; while(OpenEvent(EVENT_ALL_ACCESS, FALSE, (LPCWSTR)temp.c_str()) != NULL) { char now = temp.at(temp.size()-1); now ++; temp.at(temp.size()-1) = (char)now; } myEvent = CreateEvent(NULL,TRUE,FALSE,(LPCWSTR)temp.c_str()); It maybe not so effective, but it works well (I execute the output exe multiple times and I get different event for every instance) until when I want to debug the code and I run my visual studio in the DEBUG mode, and then I run the executable and I get the same event as the one ...Show All
