AlucardHellSing's Q&A profile
Visual C++ Memory corruption and leaks in AtlIPersistPropertyBag_Load
The VS2005 atlcom.h attempts to fix some of problems in AtlIPersistPropertyBag_Load that were present in VS2003, but only makes it fail in a different way. The first problem occurs when BSTR properties are being enumerated - the CComVariant used in the loop isn't being cleared before being overwritten with the next property - fine for UI4's but not for BSTR's. The new version calls var.Clear() to deal with this, however does not take account of the fact that (after releasing the data) VariantClear only resets the type - the value field is still set to the old released value: var.Clear(); var.vt = pMap .vt; void * pData = ( void *) (pMap .dwOffsetData + (DWORD_PTR)pThis); HRESULT hr = pPropBag->Read(pMap .szDesc, &var, p ...Show All
Visual Studio MSDN Library for Visual Studio Team Edition for Database Professionals (December 2006)
hi, i just want to ask if this update on msdn library will work on VS 2005 standard and pro editions or just VS 2005 team system edition tnx It works with Visual Studio 2005 Standard and Pro as well as the Team System version. If you already have the MSDN Library that came with Standard or Pro then this library will perform an upgrade to that version of the Library. If you do not have one of those libraries it will perform a fresh install. ...Show All
Visual Basic SendKeys.Send("{ptrsc}")
this command is taking a lot of time to execute can u help me why Maybe becuase the printscreen {ptrsc} is still not implimented: http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemwindowsformssendkeysclasstopic.asp PRINT SCREEN {PRTSC} (reserved for future use) See this thread for more info: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=644666&SiteID=1 ...Show All
Visual Studio error MSB4018: The "GenerateResource" task failed unexpectedly
I have a Smart Device application that is generating the following errror when I attempt to build. I would appreciate any feedback in how to debug this error, or what might be a typical cause of this problem. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1616,9): error MSB4018: The "GenerateResource" task failed unexpectedly. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1616,9): error MSB4018: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1616,9): error MSB4018: at Microsoft.Build.Shared.ExceptionHandling.RethrowUnlessFileIO(Exception e) C:\WINDO ...Show All
.NET Development How to pass the command to the other executable file?
Hi, I'd like to make a gnuplot to load a file and do some commands in the file. I would like to use C#. I found that I could use in C#: Process.Start("wgnuplot.exe"); to call and run gnuplot, but I don't know how to pass the command for the gnuplot. The command I'd like to pass to gnuplot is: load 'command.gp' where command.gp contains some commands for the gnuplot. There are qestions: Is it possible to pass the command to the other executable file If it is possible, how to do it Thank you very much, Komomomo I think the original poster is trying to get command input from a file. GNUPLOT when executed has its own command line for input so from a dos prompt it might look like this. ...Show All
.NET Development EncryptedXml.DecryptDocument() method has thrown a exception "Bad Data."
Hi! I just copy code from Microsoft http://msdn2.microsoft.com/en-us/library/ms229746.aspx and http://msdn2.microsoft.com/en-us/library/ms229919.aspx articles with small modification because the original code of encoding has a bug ( The Decrypt method doesn't work, because the decrypted key info never makes it to the file. It is a bug. The fix is very simple: In Encrypt() method move code line: edElement.KeyInfo.AddClause( New KeyInfoEncryptedKey(ek)) after all of the encryption key elements are defined, right before this line: edElement.CipherData.CipherValue = encryptedElement ) Now, I have 2 applications: A windows form application which encodes an xml file ...Show All
Visual C++ VC8 program writing to cout much slower than VC6 program
hi, I have the following piece of code in a program compiled using both VC8 and VC6. the only difference in the code is the deprecated iostream header. it basically just writes out a bunch of numbers to cout. I compiled and ran the programs on the same computer (P4 - 2Ghz, 1GB RAM) the VC6 program takes less than 3 seconds to go through that bit of code whereas the VC8 program takes almost 16 seconds ! can someone tell me why this is so is this common i tried the VC6 program with both single threaded, multi-threaded and multi-threaded dll . i tried the VC8 program with multi-threaded and multi-threaded dll. in all cases, the performance was the same. the VC8 version is MUCH slower. thanks, Julian. VC6 version: #include &q ...Show All
Visual C# Which type in C# is equivalent to C++ HResult?
Hi, everyone. I have this kind of problem. On faculty i got to make an example of OPC HDA server with async reading. Also, only thing i got is specification of OPC standards. Now, i have trouble. I have OPC Core components exe file, which i instaled. When i create my file which implement, let say, IOPCCommon interface, i imported required dll file, which provide necessary interface. For one of methods i got next thing. public void GetErrorString(int dwError, out string ppString) { throw new Exception("The method or operation is not implemented."); } In specification is said that this method returns HResult HRESULT GetErrorString( [in] HRESULT dwError, [out, string] LPWSTR *ppString ); How should i implement ...Show All
.NET Development button clicks event and Page_Load
Hi, I'm creating controls on the fly that I'm adding to a Table control on a WebPage. I'm adding labels, textboxes, buttons, comboboxs, etc. What the software needs to do is, once the user has filled all the info, either add new fields to fill in a new section under the current one or save and exit. First of all, I don't understand why Page_Load is called after a Button click and before my click event fires. Plus, I have some variables defined globally in my main CodeBehind file for the web page. Even though, on the first call to Page_Load I set these, they are all null the next time around. Second, I "beautified" my code today and now, the Page_Load gest called but my click event never fires. Why Here's the first ...Show All
Visual Basic Accessing registry using VB2005
Hi, I want to search for the installed software via registry. I don't know what should be exact path where i can locate the installed software in registry or what will be the keys which will help me to search all the installed software on the specific system. Please help me out. I think that searching the registry is easier. Just check if the key exists or not. With the application path you still need to decide which part of the path is the company name. And also there it is possible that you don't have a company name. Geert Geert Verhoeven Consultant @ Ausy Belgium My Personal Blog ...Show All
Windows Forms Render a Questionaire as Win Form from XML file? (C#)
Hi, Apologies if this if the wrong place to ask this... I am investigating the possibility of creating a windows forms-based questionnaire which is rendered entirely from an XML file. The scenario is that a sales operative could download an meeting agenda as an XML file. This could then be opened during a customer visit and used to render every section and element on the form, allowing them to input their answers to each question and any notes before saving the data back into the XML agenda file. Each completed XML agenda file would then be uploaded to the account management system when the sales operative returns to their office and saved to the accounts system. We have investigated web services and other ways of doing this, but this is t ...Show All
SQL Server Parameterized Expression
I am trying to write an expression based on a parameter for a text box. If I write it without the parameter it works fine, but when I add the parameter, the expression evaluates as just text. My dataset contains a field called "PeakSessions" I have a parameter called "chrt", type string, containing the value "PeakSessions". =Fields!PeakSessions.Value <= Works fine. Displays the PeakSession data. ="Fields!" & Parameters!chrt.Value & ".Value" This parameterized version evaluates to: Fields!PeakSessions.Value. So it seems the parameter resolved correctly, but my expression is being evaluated as text. What am I doing wrong SQL 2005 Reports Services, SP1, Standard Edit ...Show All
Windows Forms Cannot get the tooltip balloon to show on a listviewitem
I have multiple controls on a windows Form and I get the balloon for all my labels but I always get the standard rectangular box for listviewitems. Is there any way to get around this the listview view mode is set at details if that helps thanks in advance I forgot to reset the showtooltipitem at False and it now works. But still some flickering like you said. I also put the " string toolTipString = it.ToolTipText;" inside the if (it!=null) because it gave me an exception. Besides the flickering, it works great. A lot of work for nothing though. If only it was standard. Thanks ...Show All
SQL Server How to see the query run on my server?
Is there a way to view the exact queries sent to my server For example, suppose someone is running a report whose SQL query I would like to see, but it's not available to me for some reason. Would I be able to find a record of the incoming query Kiitos! in SQL Server 2005, you can use d ynamic management views and functions to view the executing query sys.dm_exec_requests sys.dm_exec_sql_text ...Show All
Visual Basic How do I copy bitmap data to a buffer?
I have an application that displays some images using PictureBox. There is a requirement to toggle between colour and monochrome or grey-scale versions of the image, so I've created a class derived from PictureBox that contains extra bitmaps that hold the various versions of the image, and then when the user switches between them, I just assign the relevant bitmap to the PictureBox. When the image is first loaded, the application generates the monochrome and grey-scale versions from the loaded colour version. This is where the problem lies. For each version of the image, I make a clone of the original, and then loop through X and Y, using GetPixel and SetPixel to change the colour based on a conversion formula. That also works ok, b ...Show All
