redneon's Q&A profile
Visual Basic Problem with a calulator
Hello, im new here and i have a quick question. When i make VB do maths like: Label1.Caption = Text1.Text * Text2.Text (or 5*5=25) However if i try Label1.Caption = Text1.Text + Text2.Text i get something like 5+5=55. How could i make it add up numbers in a text box Int() Attempts to convert the object into a integer Same a CDbl() for double, Cbool for boolean, cStr for string... and so on. You could also use CType() command to cast objects from one type to another. (When possible.) Dustin ...Show All
Visual C++ I know that i can use LoadFromResource in CHtmlView to load resource in the web browser, but when I embedded a browser in the di
I know that i can use LoadFromResource in CHtmlView to load resource in the web browser, but when I embedded a browser in the dialog how can i get the .htm file in the resource I appreciate your help. Thanks you for your answer. But when I use the Res:protocol, it seems that it did not work for me right now, my code is as folllows: CString strApFileName; CWebBrowser2* m_pWebCtrl; strApFileName="Res://E:\Today\WBP\Release\WBP.exe/html1.htm"; COleVariant vtEmpty; m_pWebCtrl->Navigate(strApFileName, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty); I only change the path of html file into strApFileName="Res://E:\Today\WBP\Release\WBP.exe/html1.htm"; Maybe I need to add some stateme ...Show All
.NET Development Drive Letter in .net 1.1
Hello there.. i'm working in a windows app developed in .net 1.1 and i need to know which drive installed in a computer is a cdrom drive, for example for a list of drives currently installed how do i know which is a cdrom I know that there exists a DriveInfo class in .net 2.0 but i'm still working in 1.1 and migration is not possible yet... there is a way to achieve this, through a .net native class or pinvoke Thanks, Gabriel. ManagementObjectSearcher searcher = new ManagementObjectSearcher( "Select Name from Win32_CDROMDrive" ); foreach (ManagementObject cdrom in searcher.Get()) { Console.WriteLine( "CD-ROM Name: {0}" , cdrom.GetPropertyValue( "Name" )); } ...Show All
.NET Development Debugging multithreaded code
I love a lot of stuff about the VS2005 IDE, but what I don't get is why it is utterly useless for debugging multi threaded code. I've reinstalled my OS a few times now on this notebook, so the IDE has been installed a few times too. My WinForms app is multithreaded, and whenever I go into multithreaded code, breakpoints take ages to work, then the variables can no longer be viewed, and restarting just hangs the app. How is this possible I'm using the MS flagship product and debugging with message boxes !!! This may be due to property-evaluation in the debugger, which may be especially common for winforms. Do you have property-evaluation disabled See here for more details: http://blogs.msdn.com/greggm/archive/2005/11/18/494648. ...Show All
Visual C# question about assembly loading
I'm dynamically loading an assembly at runtime and trying to use it but I'm running across something strange. Assembly A contains a common interface type Assembly B contains an executable that loads a type from Assembly C, and contains a reference to the common interface. Assembly C contains a type that inherits from a class that implements the common interface found in Assembly A. now. at runtime I load up the an assembly which is specified in the app config, and recursively walk its references until I've loaded every reference possible from Assembly C. In that walk I load all loadable assemblies, then get all the types in that assembly and cache that data. After recursively walking all the dependencies of th ...Show All
Visual Studio 2008 (Pre-release) Is there any type of context available at time of IAuthorizationPolicy evaluation?
I've been doing some work with adding custom context to our WCF web services. I've successfully added context to the operation and instance context, but now I'm doing some work at the IAuthorizationPolicy level and finding out that the contexts that I've hooked so far (i.e. operation context and instance context) are not available yet at this point. First, is there a context that flows all the way through all these layers of a WCF request Second, I cannot find any good documentation on what the life cycle of a request looks. If I could find that I would probably be able to figure the rest out on my own. TIA, Drew My first question is: what type of context information do you need in order to perform ...Show All
Software Development for Windows Vista Return value from Code Activity
Is it possible to return a value from a Code activity Also, to pass a value in Thanks. Tom, What I was trying to do was just create a simple example for someone where I didn't have to call into a local service or a custom activity. Actually though, it would be pretty simple to create a custom activity what that small amount of functionality. I just wondered if it were possible to modify the generic Code activity. Thanks! ...Show All
Software Development for Windows Vista GetTypedObjectForIUnknown worked on Xp but always failed on Win2K?
My code was very simple, and I used the shell32.dll // pIUnknown points to shell32.dll obj = GetTypedObjectForIUnknown(pIUnknown, pTargetType); The exception was "Invalid cast..." What's the reason Thx. ...Show All
Visual C# data objects
Hello my name is Mike I am very new to C# as a language but not new to programming at all. Let me first explain what I am working on. It is a Mortgage Calculator and I am trying to Declare and Create a new data object and I'm not quite sure about the syntax Also I have an Amortization table that I'm trying to create and then retreive the data from. I just basically need to know the syntax on how to do this. Please help me I'm stuck. what do you mean by data object Do you mean instances of a class (Object Orientation) You simply create a class, with methods/properties/constructor(s) and create an instance of it wherever you want in your project. Example: MyClass theClass = new MyClass(); theClass.DoS ...Show All
Windows Forms UPDATE... Not INSERT!
I am using these lines of codes to insert data in these fields in my database: insert = c.Cadastro_GeralTableAdapter.Insert(get_TIPO(), get_ID_CLIENTE(), get_ID_CONCORRENTE(), get_ID_FORNECEDOR(), get_ID_PARCEIRO(), get_NOME(), get_CPF(), get_CI(), get_Razao_Social(), get_CNPJ(), get_IE(), get_Data(), get_Telefone(), get_Email(), get_WebSite(), get_ID_COBRANCA(), get_ID_ENDERECO()); But I want to UPDATE the data. For example: I want to chance in the field "Email" to another e-mail address, replacing the old one. Someone is able to help me Thanks. ...Show All
Visual C++ Error messsage
The version of SP is 20040803.231319. It has been suggested that I post my query in another forum. This I will do. Thanks for responses. Please post your question here - we do not know where you posted it already, so nobody here knows what your question is. -- SvenC ...Show All
Windows Forms textbox.text error
I have the following code for a dialogue with a combobox and I defined public variable SiteName as string in a module. When calling the SiteName variable on a main form and display in a textbox, I get an error that says "Error 1 Value of type 'System.Windows.Forms.TextBox' cannot be converted to 'String'." How could I modify it so i can get rid of this error .. Private Sub OK_Button_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click If Me .DialogResult = System.Windows.Forms.DialogResult.OK Then SiteName = siteList.SelectedText() End If Me .Close() End Sub ------------------- This code below is in the main form ------------------------ ...Show All
Visual Basic FileNotFoundException on some machines
Hello, I have a VB.Net program that has been loaded on a number of different computers and all works well. On a few machines the user gets "System.IO.FileNotFoundException: File or assembly name AxInterop.MSComctlLib, or one of its dependencies, was not found" I checked my Deployment project and the dll and all dependencies are included and refer to the default application directory. Any ideas why some machines have this problem Thanks, Chris It looks like on of the assemblies you are using as a reference to comctrl32.dll via COM interop. Try copying and registering comctrl32.dll on those machines and see if that fixes the problem. -Scott Wisnewsiki ...Show All
Windows Forms New Button Design VB Express
Hi, I am trying to catch up with VB using Visual Studio Express editiion and for a form I need to design a new button. The button I need is round in shape not rectangular. Is there a quick way to create this Other properties of the button should remain, event handling etc. You can set the Region property of the button. You'll need to calculate your own points defining your circular button, add them to a Region object, and then set yourButton.Region = yourCircularRegion. This will make the button appear circular, and will also make it so that the mouse only interacts with the button in that region. ...Show All
Software Development for Windows Vista SqlTrackingService does not work in Beta 2.2
Hello, I have a problem with tracking : I have worked through Hands-on Labs Beta 2, Lab 03, DefaultSQLServices. The compiler throws the error message: "Type or namespace SharedConnectionWorkflowTransactionService not found" When I delete this line the code will be compiled, but I get runtime errors. The persistence service and the tracking service do not work together as it seems. The persistence service alone works well. But the tracking service does not - no tracking records were generated. Take a look at this post for more information. ...Show All
