jdang's Q&A profile
Visual Basic A simple query about Left Shift (<<)
Dim A As Byte () = New Byte () {231, 3} Call Test(A, 0) Private Function Test( ByVal Array As Byte (), ByVal StartAddress As Integer ) As Integer Dim A As Integer = Array(StartAddress + 1) << 8 Dim b As Integer = A << 8 Dim c As Integer = 231 Dim d As Integer = A Or c Stop End Function When the function Stops, the variables equal the following: A = 3 b = 768 c = 231 d = 231 3 << 8 = 768, but Array(StartAddress + 1) << 8 does not equal 768. Even though Array(StartAddress + 1) = 3. Why is this Also, is there anyway to view the code for System.Bitconverter to see how it's done Thank you, Troy L The reason is because you are shifting too man ...Show All
Internet Explorer Development Develop Activex to call from JScript
I want to develop an ActiveX so that I can access it from the JScript. I know there is a method CreateActivex() in JScript. Do I have to add special interfaces for my activex, in order to use this method. Thanks The only interface required is IDispatch , which is so ubiquitous it goes without saying. Don't forget that COM objects and ActiveX controls must be registered as Safe for Scripting or IE will complain when you try to instantiate the control from script in an HTML page. It's easy to do this in the registry, but a robust control will also implement IObjectSafety to encode the author's intent. And, if you plan to use the control widely or distribute it publicly, you certainly should sign the control after you have f ...Show All
Windows Forms Windows Forms Progress/Status Bar
Hi, I need to implement a progress bar along with a status bar. I need to show the progress and at the same time i need to change the contents of the status bar dynamically based on what script is being executed. Some thing like : Processing Script1................. Processing Script2................. etc Can any body tell me the best way to acheive this Also i need to know if i can use a regular label control as a status bar Thanks Mahesh If you're preforming a lengthy operation you'll want to make sure you perform the processing on a background thread or the form will not be able update (defeating the purpose of a progress bar and a status bar...). Easiest ...Show All
Visual C++ Help comparing strings
I am trying to make a magic 8 ball program I cannot figure out how to compare strings here is my code #include <iostream> #include <cstring> #include <windows.h> using namespace std; int compare(string question); void cases(int num_coord); int main () { string question; cout <<"Ask the magical 8 ball!!!"<<endl; Sleep(600); cout <<"What is your question:"<<endl; cin >>question; int num_coord = compare(question); cases (num_coord); } int compare(string question) { int num_coord; if (question == "does") { num_coord = 1; } else if (question == "when") { num_coord = 2; } else if (question == &qu ...Show All
Windows Forms Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'
I have created a new test project and when I add a reference to my application project I get the following error message: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0' What can cause this Chris Holland Perfect. I doubt I ever would have figured this out for myself. Your contribution is VERY much appreciated. Tthank you. ...Show All
.NET Development Open DataReader associated with this Command
SqlConnection conn = new SqlConnection("Data Source=server;Initial Catalog=db;Persist Security Info=True;User ID=xxx;Password=xxx"); public Form1() { InitializeComponent(); this .conn.Open(); this .GetConn(); //Creates first reader this.GetConn(); //when I try to create second reader it throws exception } &nb ...Show All
Visual C# How do I rename the administrator on a given machine via c#(System.Management?)
I've found a few bread crumbs, but i have not as of yet figured this out.. here's what i know. You're supposed to be able to do it using WMI via win32_useraccount.Rename, You can call WMI stuff in c# via System.Management. What I need is how to tie those two pieces of information togther to allow me to make the changes. Can anyone help Give me a few more breadcrumbs to follow Thanks, Eric- I figured out how to do this using renuser.exe... it's pretty simple the hardest part is finding a copy of renuser.exe. I found it on the Korean verison of the english site that everyone links to. http://www.ntfaq.co.kr/download/renuser.zip Eric- ...Show All
Visual C++ Regular expressions for VC6?
Hello Comunity, i read about ATL Class Library that they habve an functions for regular expressions in VC6, if this is true, where can i download this library, please post an link(url) for me! With best regards Mirsad Concerning Boost on VC6, this thread just came up: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=703421&SiteID=1 VC6 didn't use Boost as a test suite, and Boost probably never targeted VC6. Brian ...Show All
Visual C++ Cache
I need to read MUICache, but I can't find any information on this sorry for newb question Franz Bear wrote: I need to read MUICache, but I can't find any information on this sorry for newb question It is a registry key. It's found at HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache This MSDN article shows how to read registry data http://msdn2.microsoft.com/en-us/library/df4afx57.aspx Regards Sahir ...Show All
Windows Forms Don’t passa to next row
Hi, I have a form with datagridview and I am using DataAdapter Insertcommand, SelectCommand, UpdateCommand and Deletecommand with SQL stored procedures. I would like to know how do I do to keep the focus on the same row that I edited and not pass to next row. There are some property for this Thanks ...Show All
SQL Server Odd FMTONLY statements
Hi, I recently started using ADO for connecting to a remote SQL Server from Delphi. Prior to this I used BDE (Borland Database Engine). I noticed that all SQL communication seemed slow – only half the speed of using BDE! I ran a trace using the Profiler (from MS SQL Server) and noticed that ADO generated roughly twice the amount of traffic compared to BDE. Every SQL statement (SELECT, INSERT and UPDATE) send from my application was preceded by the exact same statement encapsulated in ‘SET FMTONLY ON/OFF’. -Example Start- SET FMTONLY ON SELECT * FROM TabelVersion SET FMTONLY OFF SELECT * FROM TabelVersion -Example End- Why are these odd statements being passed to the server ...Show All
Windows Forms Cell BackColor change on edit
hi, I have an editable datagrid in my app. When the user edits a cell i would like the backcolor of that cell to change.This is to be done so that the user can easily review the changes before submitting them to the database Will i need to override PaintText . any inputs to point me in the right direction would be appreciated (Using 1.1 Winform DataGrid) thanks Rohan Wali You can change the back of the cell from any where not only from paint. DataGridView1.Rows[0] .Cells [0] .Style.BackColor = Color.Red; But before u change it make sure that you are able to catch correct rowindex and columnindex. This you can do in mousedownevent or keypress event And now after getting the row and column index, during onmouseleave event change the ...Show All
Visual Studio Tools for Office using VSTO w/ ASP.Net 2.0
Hi, Newbie using VSTO and developing office applications. The task is to import and export data from and to database, but user can select from a list columns what they want to add, there will be a dialog will appear and allow user to select data to be included in a word document, how can this be done I installed PIA, VSTO2005SE w/ runtime, MS Office 2003 Web Components and will use MS Office 2003 (ver 11.0.7969.0) with ASP.Net 2.0. I tried some links and cannot find Actions Pane Control. What Am I missing Can anyone point me to some sample codes or resources to do this Thanks in advanced. den2005 Exactly what components should be working in which manner isn't clear from your description ...Show All
Software Development for Windows Vista MonthCalendar recognized as pane...
Hi guys, I'm having a problem with the MonthCalendar control not being recognized as one, it's just recognized as a pane. I tried different applications: - A C# (Winforms) app with the basic control - A native Win32 application - The MonthCalendar control in the 'Date and Time Properties' of Windows Nothing...Allthough the control should to supported: http://msdn2.microsoft.com/en-us/library/ms753925.aspx Any idea on what is causing this PS: I'm using the release version of Winfx. Thanks, Nick ...Show All
.NET Development Print problem
Hai, Im wrking on AJAX and Reportviewer.Im Having a webpage with a UpdatePanel,Button and a ReportViewer within Updatepanel.Whenever i click on Button, report gets loaded in updatePanel. Report gets Loaded Successfuly in Updatepanel.But whenever i click on PrintButton of reportviewer (Which is Builtin within in reportviewer control),Im Unable to Get Print-Dialog .Im not able to Print report..... Whenever i remove the UpdatePanel ,Im able to Print report .(thru report viewer) Is it not possible to Print whenever i try to keep Reportviewer in Updatepanel. Can any one plz tel me a solution for this............it is very Urgent ............ Thank you in advance............ With regards, Mahender 9989302525..... ______________ ...Show All
