JonAkaJon's Q&A profile
Visual Basic How do I change/specify Webbrowser Control font?
I am using the webbrowser control to display HTML formatted string in a VB.NET 2005 application. The default webbrowser text seems to be Times New Roman 12pt. Is there a property or other method to change the default font and size Thanks... ...Show All
Visual Studio Express Editions Getting numerical input from a masked textbox using VS2005 Visual C++
I am trying to use a function to divide 2 numbers entered into masked textboxs. I have masked the text boxes for 10 numbers. The masked textbox names are maskedTextBox1 and maskedTextBox2. Here is my code: void seti( void ) { if (maskedTextBox1->Text->Equals( "" )||maskedTextBox2->Text->Equals( "" )) { //didn't enter everything MessageBox::Show( "You must enter both numbers to proceed." , "!!!Error!!!" , MessageBoxButtons::OK, MessageBoxIcon::Stop); } else { ckt.i = ((System::Windows::Forms::MaskedTextBox ^(maskedTextBox1->Text))/(System::Windows::Forms::MaskedTextBox ^(maskedTextBox2->Text))); lblI->Text = ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Change from MDX in Vector3.Normalize(new Vector3()) behavior
When executing the command: Vector3.Normalize(new Vector3()) with XNA framework, it returns NaN for each of the vector coordinates. Looks like it used to return 0,0,0 in MDX 1.1 & 2.0. Odd though that it didn't cause an exception when I referenced the "invalid" vector3 later on in my code. It was actually a hidden bug in my code that allowed me to even try to normalize a zero vector in the first place... Seems like it would be better to throw an exception - this is the same kind of thing as division by zero. Anyway should this be a comment or did you have a specific question. ...Show All
SQL Server Date function for calculated member?
Hello, In AS2000 I was using a VBA function Date to retrieve the current date and use it as part as my calculated member formula. In AS2005, you cannot use VBA function and I do not find a way to retrieve the current date (without the time or with the time set to 00:00:00) I tried to create a Named query in the DS but I cannot seem to be able to use this in the calculated member. Any Idea Thanks, Philippe You can use the "Now()" function. Here is an example that I use to create a member based on the current system day: --Create a date string using the following format: "9-Jun-06" CREATE HIDDEN [As of Date String] = Format(Now(), "d-" ) + Lef ...Show All
Visual C++ Accessing Data In An Already Loaded DLL
I asked a similar question a couple of days ago in the C# forum, but my question is revised now and concerns C++, since I'm pretty sure it can't be done in C#. Here is the scenario that I'm dealing with. I have ProgramA.exe on my computer that loads up LibraryA.dll when it starts. There are some classes and methods in LibraryA that ProgramA uses that I would like access to. For example, there's a class called ClassTest with a method called MethodTest() that returns a variable that pertains to some data in ProgramA. If I just load the DLL, I think it creates a separate data space for the program I'm using to access it, so I can't read ProgramA's data with the exported methods of LibraryA. I tried writing a DLL and injecting it into ProgramA ...Show All
Windows Live Developer Forums Is there any way to fill a polyline?
Does anybody have any ideas You have to make sure the points are in order. otherwise the polygon shape will morph, only works in IE. result is an array of points function MapTerritoryArea_callback(result) { var i = 0; var locs = new Array(); var mylocs = result.Locations var x = 0; var y = 0; for (i = 0;i <= mylocs.length - 1;i++) { var ll = mylocs ; var loc = new VELatLong(ll.Latitude, ll.Longitude); locs.push(loc); x = x + ll.Latitude; y = y + ll.Longitude; x = x / (i); y = y / (i); var loc = new VELatLong(x,y); var col = result.Color; var pol = new VEPolygon(result.Id, locs); polygonID++; pol.SetOutlineW ...Show All
Visual C# Why did I only get part of what I intend to get?
No error was complained! The following program is to write a whole year's month,day,weekday in a MSSQL table. But somehow, for many times I have tried, but each time I got only part of what I intend to get: the whole year with 12 monthes, instead, I only got 3 or 4 months' content in the table. Can anybody tell me why calendar.dll using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using database; namespace calendar { public class calendar { private int _nian; //year private int _yue; //month private int _ri; //day private int _xingqi; //weekday private string _errorInfo; public int nian { get {return _nian;} set {_nian=value;} } public ...Show All
Visual Studio 2008 (Pre-release) Include XAML into XAML
How can I include one XAML into an other XAML. i think you have a resourcedictionary as a external XAML-document ! now, you can use this document (reference this document) with the tag <RecourceDictionary source="MyXAMLDocument.XAML"/> in the "Recource" tag from any container’s. a small sample for using a ResourceDicnionary.xaml in a window tag. .... <Window> <Window.Resources> <ResourceDictionary source="MyXAMLDocument.xaml"/> </Window.Resources> ..... i hope it help ;-) sorry for my small englisch TOM ...Show All
SQL Server Scheduled SQL Server Agent SSIS Package Job Problem
HELP! I have been banging my head against a brick wall on this one all this morning AAAAAAGGGHHH! 1. I have an SSIS package that runs a simple SQL script and then updates a few tables by downloading some XML of the web. It runs fine when I kick it off manually under SSMS. 2. I created a SQL Server Agent job to run it every day. This always fails. The error information in the log is useless ("Executed as user: domain\user. The package execution failed. The step failed." - I had already figured that out!). It fails almost straight away, and when I enable logging for the SSIS package, no info is ever logged (text file, windows event log, whatever). 3. Out of desperation I have changed Agent to run under the same domain user ...Show All
Visual C# How to add auto date to snippet?
Hi, I'm writing a snippet for my team, and I need to insert auto date (ie, today). Can I do this Can I use some functions inside snippet TMF, Unfortunately there is no way to automatically insert the date/time with a code snippet. You have two choices - if this is for a file header for newly created files you could modify the add item template to automatically add the date (as well as author, etc.). The other option is to create a macro which inserts something similar to what the snippet would create and then suggest that your team use that instead. VS Pro ships with an example macro called "InsertDateTime" whcih demonstrates this. You can see the sample macros by opening up the Macro Expl ...Show All
Visual C++ What is Visual C++ equivalence to C#'s "is" operator?
I'm trying to convert some C# code over to C++ but cannot figure out what's the C++ "is" operator. C# code: Control m_control; if (m_control is Control) { ... } I've searched and found this article but it's outdated and does not work with Visual C++ 2005: http://msdn.microsoft.com/msdnmag/issues/02/02/managedc/ In which the author defines the following template: template <typename T1, typename T2> inline bool istypeof ( T2* t ) { return (dynamic_cast<T1*>(t) != 0); } bool isanInt = istypeof<int __box>(someBoxedInt); I've tried all following with no luck: if ((Ojbect^)m_control == (Object^)Control) if(m_control.Equals(Control)) Any help would be appreciated. Thanks ...Show All
SQL Server Is there a script to delete all database constraints?
Hi all, I am trying to delete all of my table constraints and I generated this script: declare @table_name sysname declare @alter_table_statement varchar(256) declare @const_id integer declare @prt_obj integer declare @const_name varchar(256) declare @parent_name varchar(256) -- definindo o cursor... declare constraint_id cursor local fast_forward for select id from sysobjects where XTYPE='PK' OR XTYPE='F' order by parent_obj declare parent_obj cursor local fast_forward for SELECT PARENT_OBJ FROM SYSOBJECTS WHERE XTYPE='PK' OR XTYPE='F' order by parent_obj -- definindo o cursor... -- apagando as constraints... open constraint_id open parent_obj fetch next from parent_obj into @p ...Show All
.NET Development .NET program in autostart
I've created a very simple "hello world" program with C# 2.0 (VS2005) and placed this program into the autostart folder. On startup the console window shows up, but it remains empty for several seconds. Only after about 5 seconds the "hello world" message appears in the console. I tested the program on a different computer (the hardware is pretty much the same) and the delay is much shorter (about 1 sec). I guess that it has to do something with the initial setup of the CLR. How can I speed this up I did another test: I reduced the program to the absolute minimum (nothing is outputted, there are no dependencies): namespace HelloWorld { class Program { static void Main(string[] ar ...Show All
Visual Studio Increasing the wait timeout for the VSS2005 Internet Web Service and IDE plug in
Is there any way to adjust the time out parameters on the server and/or client side when using the Internet provider What's happening is that occassionally the connection between the developer and the server is a very slow one, and the plug in gives up (often at the worst of times), resulting in bindings getting confused. My client has also discovered that the server (Windows 2003) needs to be rebooted about once a week in order to keep the web service speed up. VSS2005 starts running slowly, they reboot the server, it speeds right up. VSS2005 is the only application hosted on the server at the moment. Thanks The timeout Barry talked about is set on the client machine, and affects how long will the client wait to receive the r ...Show All
Game Technologies: DirectX, XNA, XACT, etc. DrawTransform problem - looks like a DriectX bug
Hi there, I use Line.DrawTransform to plot some 3D lines. They all plot fine, however when I start moving the camera forward all lines that are in the direction of the camera move "jump" to infinity when I clip the near plane (it is my guess that it is the near plane). Could you please help with some advice. My hunch tells me that it is a rather obvious problem for more advanced game programmers - too spectacular to miss :) There is not much in the code, really 1. I define the lines in a Vector3 [][] v3Lines = new Vector3 [1][]; 2. Draw the lines with float FieldOfView = ( float )( Math .PI / 4); float aspectRatio = this .Width / this .Height; //1.0f; float zNearPlane = 10.0f; //pure guess for this ...Show All
