Answer Questions
danych Operator == implementation for user-defined ref class
In my own ref class I implement a static operator == which takes my ref class as the first parameter type and my ref class as the second parameter type, in order to override reference equality. This works correctly as expected. Now if I implement another operator == which takes my ref class as the first parameter type and a different ref class as the second parameter type, this works correctly except when specifying 'if (myrefclass == nullptr)' in the code. At that point the compiler gives me an error complaining about ambiguity between the two operator == I have implemented for my ref class. Naturally I want only one of the operator == to handle this case, preferable the first of the two. Short of the ugly casting of the nullptr to a ref ...Show All
Daniel Danilin Getting current system time
What is the name of the function in MFC that allows a Windows application to access the system clock I can't find it in the MSDN library. The MSDN library that comes with Visual Studio Professional 2005 does not have any information on MFC!! I used Visual Studio five or six years ago and it had it then. Why did Microsoft take this out Thank you. from the help menu of MSDN ... use "search"... saju wrote: next time please spend somemore time and effort... GetSystemTime is the function you might want to use... When I do a search for "time" on the MSDN library installed locally on my Windows box with the following settings: Lang ...Show All
IvanVC Compile error C2171 when exporting valarray template instantiation with VC2005
Hi, I have code developed on VC6 where I'm exporting a number of STL template instantiations from a dll along the lines of this KB article http://support.microsoft.com/default.aspx scid=http://support.microsoft.com:80/support/kb/articles/Q168/9/58.ASP&NoWebContent=1 to avoid access violations a la this article: http://support.microsoft.com/default.aspx scid=http://support.microsoft.com:80/support/kb/articles/Q172/3/96.ASP&NoWebContent=1 i.e. in my dll I'm exporting valarray<double> using template _declspec(dllexport) class valarray<double>; and then importing and accessing a valarray<double> created in the dll from an exe. This worked fine in VC6. When I try and compile the same code on VC ...Show All
Michael Grau Visual Studio 2005 SP1 Vista (With Patch) Freeze/Crash
I am trying to change the project properties for a project I am working on and whenever I change the option "Character Set" from "Use Unicode Character Set" to "No Set", the IDE freezes and I have to kill it and restart it. I am migrating from a previous version of VS (2003) and without changing this option my code will not compile. I don't want to add in Unicode support because I don't think it is compatible with Win98 is it Even if it is, I would still like to be able to turn this off because I need to sometimes, but at the moment it won't let me and it is a very important option. Thanks guys (and girls), hoping to hear from you soon. BTW Window 98 can support Unicode by M ...Show All
Vladimir Chtepa Calling function from another Form. C++
Hi, I have two forms (implemented using Windows Forms - C++) using the same namespace the main form [FORM1] sets values in [FORM2] which works correctly. FORM1 file therefore includes (#include "FORM2.h”) in the header. But, what I'm trying to do is in the FORM2 file is to call a function which is located in FORM1 [I have included the FORM1 in the file (#include "FORM1.h”). When Form1 first loads it sets a reference to FORM1 in the FORM2 file. However, when I try to call the function (located in FORM1) from FORM2 I simply can’t get it to work. My question therefore is what is the best way to do this Thanks in advance for your help! I have a parent ...Show All
Cosmin Nicolaescu Access to the timezone database
Hi all, is there an API to access the OS's timezone database (like offsets from GMT, DST rules etc.). What timezone names are used, where do I find documentation about it (i.e. the API, not tomezones in general) cheers, aa The Windows timezone data is in the registry. About a decade ago I spent a few days trying to figure it out but since then someone wrote an article in a magazine describing it. Hopefully it has since been documented by Microsoft. So look in the registry; if you can't find it I will look for the registry key. When you find it, you hopefully can search the MSDN to find the documentation or the internet to find the article. A few days ago I was looking in the MySQL web site and saw something about a timezone dat ...Show All
Aaron Sulwer Problem working with #imported excel type library
I am writing a Win32 program that interfaces with various office applications. So far I have successfully written code for Outlook and Word and am trying to do the same for Excel. I am using Office 2003 Professional. I am #importing the XL5EN32.OLB and that appears to work fine (I am also importing the mso.dll). I get the Excel namespace but when I try to create an instance of the application object using: HRESULT hr; try { hr = pExcelApp.CreateInstance( __uuidof(Excel::Application) ); if(FAILED(hr)) return false; } where pExcelApp is declared as: Excel::ApplicationPtr pExcelApp; I get hr = -2147221164 which equates to "Class not registered" This same basic format has worked for obtaining ...Show All
Brandon Bloom How do I Get self filename.
Hi, I'm trying to make a program copy itself, but I need to know the file name, in order to copy it, so I need a way to get the filename cause it might be whatever. if filename is <whatever>.exe, how do I get <whatever> while running Is a way to do that Any info would be greatly appreciated. Thanks. Use GetModuleFileName ( http://msdn.microsoft.com/library/default.asp url=/library/en-us/dllproc/base/getmodulefilename.asp ) with NULL as hModule parameter. awesome!, thank you!! ...Show All
Shobha69358 Creating and deploying a Hello World console application
I recently installed Visual C++ Express Edition on my computer and wrote a simple Hello World program: #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { char c; printf("hello world\n"); c=getchar(); return 0; } The .exe file is huge (it is 5K) and it won't run on my other Windows box that does not have VC++ EE installed on it. Does anybody know if there is a way to create a simple Hello World .exe that can run on any Windows machine Thank you. Are the SxS binaries really necessary just to deploy a Hello World application Is this only on Visual C++ Express Edition, or do the commercial versions remove this limitation ...Show All
Kent Boogaart How to force intellisense update?
Sometimes I press right click and then "go to definition", and it goes to a wrong place. I think this is because intellisense is not update yet. If this is correct, how to force it update Thanks If your intellisense database is corrupt you can delete it and recreate it. Go into the directory that contains your solution and delete the .ncb file. When visual studio starts again, it will recreate the database. Thank you Aarongo, it works fine. Hi Aarongo, Thanks for your answer, I've tried like this many times but cannot force it update. Save all, rebuild all, close VC++ and then reopen again etc. It's not work. It still goes to wrong place when click "Go to definition&q ...Show All
Tom Frey Visual C++ engine is not properly installed
Hi, Can someone help me please, I was working with my Visual Studio 2005. And the next day, It cannot build any project, I am using C++, when press the build menu, I got this error: 1>------ Build started: Project: Gui3, Configuration: Debug Win32 ------ 1>Error: the Visual C++ Project Engine is not properly installed. The build cannot continue. Please repair the Visual Studio installation. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I have tried to uninstall and reinstall 3 times, but the problem remains. Please help me, My project dateline is very soon :( .... Thank you I have just had the same problem and could not find any information on this. So, i just repaired it, attention! m ...Show All
Jenise Reading Certificate received with WinInet with CryptoAPI
Hello, I am using WinInet https to communicate with a server and receive files through a SSL connection. For this a certificate is send to a client from the server. I would like to analyze this certificate at the client side. I read something about CryptoAPI and I was wandering if it would be possible to read certificates send from server using CryptoAPI. thx For such issues, please use the newsgroups at http://msdn.microsoft.com/newsgroups OTP Thanks, Ayman Shoukry VC++ Team ...Show All
mahalax Function not returning for long time....
In my VC++ application I am using some third party library. When I am calling a function from that library some time (not always) it is taking long time to return e.g. 3 to 5 hours and my application is blocking at that point. If I want to wait only for 15 minutes for that function to return otherwise proceed further. How can I archive this Thanks, Amol In that case I think you should contact them for API support. Could you be a bit more specific about what you are tying to do so we could learn more about your problem. What the library is and what it is you want to do Are you using MFC or Win32 etc etc.... This is a win32 application. I am collecting some data from Veritas BackupExec (a backu ...Show All
l_steve_l Intercept the PASTE message
Hi: I want to know how to intercept the event which is generated when the user do : CTRL+X or a paste. I don't find a message like SC_PASTE in the documentation. Is there any message related to the Clipboard Thanks. A.B. You could associate the service with a window station and desktop, then create a message only window to capture the clipboard events, but it may not be such a grand idea. Or rather, it would no longer be much of a service. Hi: I think that the word "Service" is not the appropriate one, I use a systray for my application. I'm developing a small application like "SuperCopier" which intercept the paste, CTRL+X notification in order to create a progress bar for copying data with many functi ...Show All
JacquelineT 'Is' in C++
Hi! In C#, there is a keyword named 'is'. It compares whether one type can be converted into another. Is it possible to do something like this in C++ Thank you Note that you said "type", implying a fundamental type (such as int), without specifying that you were referring to classes. That is what confused people initially. If it were me, I would look in the VC documentation. There probably is a way to determine if a class is derived from another class. It is possible however that there is a different solution to a more general problem. It might be possible to use virtual functions, and if so, then that would be easier and more flexible. You could also do something like ...Show All
