mchean's Q&A profile
Visual C++ C++ Newbie needs a c++ expert converting bits to bytes
Hello all, I need some C++ experts to help me with a problem I have in converting a PBM file to a PGM file. These files are used to store digital images. The PBM file uses monochrome to display images while the PGM file is a grayscale image. I have written a test program that works somewhat. The problem I have is that the PBM format uses 1 bit to represent a pixel while the PGM format uses 1 byte to represent a pixel. Therefore 1 byte in PBM format represents 8 pixels. I need help in converting those bits to bytes for the PGM format. I am not sure how to achieve this. I have never really had any experience in masking bytes. Here is my code thus far: #include <iostream> #include <fstream> #include <string> using namespace ...Show All
Visual Studio 2008 (Pre-release) Application's Idle time
Hi, How can I know the application's idle time. Can anybody help me Thanks, EW ...Show All
.NET Development thread-safe enumerator
Does the use of yield as shown below create a thread-safe enumerator by any chance IEnumerator<KeyValuePair<TKey,TValue>> IEnumerable<KeyValuePair<TKey,TValue>>.GetEnumerator() { lock (m_innerList.SyncRoot) { // Not thread-safe //return m_innerList.GetEnumerator(); // Is this thread-safe foreach (KeyValuePair kvp in m_innerList) { yield return kvp; } } } No enumerators are, by definition, not thread-safe. Making them thread-safe is actually a difficult task because just because you asked for an enumerator doesn't actually mean you use it. Most enumerators store the "version" of the collection when they are created. The first thing th ...Show All
Smart Device Development Call VB external function from a DLL
Hi, I've developed a C++ DLL that process incoming SMS messages and an EXE VB application that run as a standard program. How can I call a specific function of EXE VB program from the DLL I'm trying to develop an SMS filter that receive only messages that come from a specific phone numbers. DLL (MAPIRule) intercept SMS message, call VB program function that check if the phone number is good and return a value to DLL. Thanks a lot http://msdn2.microsoft.com/en-us/library/843s5s5x.aspx ...Show All
Visual Studio Analyze.exe (2005) crashes
Hi! We are running an analyze (vss 2005) once a week on our database. Since one day analyze.exe crashes with the popup "Microsoft Visual C++ Runtime Library : Runtime Error! ". The last entry in the log-file is "Running advanced reference verification." The database format is v6. We use SourceSafe2005 clients and adminstrator. Our database is very large (5.5gb). Even MS suggests to keep this size smaller, this should not be a reason for the crashing of analyze.exe. Any ideas Thanks in advance. gofur. Could you please open a bug for VSS attaching the minidump file http://connect.microsoft.com/feedback/default.aspx SiteID=210 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. VS2005 Pro
is there a version of XNA Game Studio for c# from visual studuio 2005 as this is the version i have and i dont think having two versions of c# installed would work to well. thank you there isn't a plugin yet for VS pro, but it is comeing with the commercial release of the framework as far as i know. Also haveing C# express and VS.NET Pro works just fine side by side. I interchange with them a lot on my computer. ...Show All
Software Development for Windows Vista CodeCompileUnit question
Hi, I asked this question in the .NET Base Class Library Forum without any reply so far. Maybe someone can help here. I want to be able to create a CodeCompileUnit from source code to be in synch with the Workflow Designer. Using IEventBindingService I can genreate CodeMemberMethods but when I load the generated sources from disk I need a way to re-create the CCU to be in synch. VisualStudio seems to be able to do that. There is an internal class which seems to be able ... Any hint would be very much appreciated. Recreating code compile unit from C# code would mean parsing C# code. This is not possible. The other way to do it would be to compile the workflow when it is loaded, reflect upon the assem ...Show All
.NET Development Problem creating Zip File using Shell32.dll
Hi, I'm trying to create a zip file using the Shell32.dll com component in C#. I believe that the code should work fine in Windows XP & 2003 Server. My test environment is XP and the code works fine. But this does not work in win server 2003. It does not throw any exception as well. Please help me in solving this issue. This is my code: ///There is no issue with this method. this creates a new zip file normally. public bool CreateZip ( string ZipFileName ){ try { //Create an empty zip file byte [] emptyzip = new byte []{ 80 , 75 , 5 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; FileStream fs = File . Create ( ZipFileName ); fs . Write ( empt ...Show All
Visual Studio Microsoft Visual Studio cannot shut down because a modal dialog is active. Close the active dialog and try again.
I am facing this problem most often..When i am in view code of SQL Server Business Intelligense Develpment enviorenment..its stop to open Ctrl F to open the Quick Find message box on key stroke whicle from main menu its opening the same quick find message box ..and though i try to close the project its giving error below.. --------------------------- Microsoft Visual Studio --------------------------- Microsoft Visual Studio cannot shut down because a modal dialog is active. Close the active dialog and try again. I have to manually close the window from TASK MANAGER.. Please look into matter or guide me where i sud put this matter.. I am encountering this problem (only when using VS2005 BI for Reporting Services but ...Show All
SQL Server How to import relations with DTSWizard?
Hello, I have installed the recent version of MSSQLExpress 2005 with the DTSWizard. I was able to import my Access Database successfully into MSSQL. However the keys and relations are not copied over. Is there a way to do that or Do I have to set everything manually Thanks Kave Check this KBA http://support.microsoft.com/kb/237980 about upsizing the access database and that will talk about your need. Review http://support.microsoft.com/kb/285829 too. ...Show All
Visual Basic java in webbrowser
hello, is there any way to enable runnin java script in my browser - and if it is how can i handle them thnx; hi, yeah, im using the webbrowser contorl of .net 2.0. and i don't know what kind of java scripts i want to run fore cuz i'm writing a webbrowser application and don't know all the scripts on the net... :) you know what i mean... thnx; ...Show All
Visual C# Practical use of multithreading???
Hi all, I'm not an expert on threading and to be honest I've not used threads directly before. I have an interesting problem I'm not sure how to tackle. Basically I'm developing a .NETCF2.0 application in C# and have a class that contains an event handler to recieve SMS messages using the PocketOutlook assemblies (API). When a new SMS message is recieved this handler parses it and stores the data within a SQL mobile DB. Now most of this processing is pretty quick but I'm a little concerned about the overhead it will have on the UI thread. My first though was to have another thread handle these events but I cannot find a way of doing this. Basically I want a seperate thread to use the SMS receieved event h ...Show All
Visual C++ Using animated GIF image in Forms
Hi, I'm trying to use an animated gif image in a form within C++/CLI but so far without success. I looked at picturebox control but the image stay still, no animation. I browsed the NET to find any clue to my problem and got a few articles stating the fact that I have to make somekind of class that would rather display one at a time each frame found in my GIF. Any clue or easier way, any example on how to do it Thanks in advance, Stephane Stephane Beauchemin wrote: I'm trying to use an animated gif image in a form within C++/CLI but so far without success. I looked at picturebox control but the image stay still, no animation. Presume you are using VS2005. ...Show All
Visual Studio 2008 (Pre-release) How to arrange items of a ListBox in this way?
Normally, the items of a ListBox is arranged in order. Seems like: Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 But in my situation, I hope the items to be listed in this way: Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 I know it's really strange. But can I make this happen Thanks Hi, Rob and Lee Nice suggestion and good example. Thank you. But it seems that I can not sort the items in different order any more. ...Show All
SQL Server How to Synchronize SQL Server Login SIDs
Hi everyone... On two instances of SQL Server 2005 I am using the same SQL login names, but the SID is different for each one. I would like to synchronize these IDs so that when I restore the production database to the developement database I don't have to remove and re-add the logins. Is there a quick and easy way to do this Thanks, Forch You can create a login with the same SID on the second server using the SDI = sid option on CREATE LOGIN DDL ( http://msdn2.microsoft.com/en-us/library/ms189751.aspx ). -Raul Garcia SDE/T SQL Server Engine ...Show All
