TomPearson's Q&A profile
.NET Development Dynamic compilation with CodeDom to an internal procedure
I've seen plenty of examples of using codedom with functions like CreateCompiler to produce a new EXE or DLL, in memory or on disk, and then invoke it But is it possible to compile a code snippet which can reference internal functions and classes within my API DLL This would enable me to extend our existing application scripting language to support the .NET language. Lets say you have this (daft) code snippet as a string in memory: function ScriptExec(sParam1 as string) dim x as string x = SaveXMLData("<root><field>" & sParam1 & "</field></root>") if x <> "" then Throw x end if return "ok" end function SaveXMLData is a private or public ...Show All
Microsoft ISV Community Center Forums Help with Excel VBA Code
I am trying to format different spreadsheets. I need the data to be in the same cells for each worksheet. This data is in column A. I need to check to see if DBCS# ( ) is above Tour, and if so insert rows until Tour is in row 175, column A. The problem is that the number after DBCS# is never the same. How can I use an IF statement to make sure that the cell above Tour says DBCS# (whatever the number is) This is the If statement that I tried. If I put DBCS#46 in my IF statement, it will not work because the number after # isn't always 46. If (Range("A174:A174") = "DBCS#") And (Range("A175:A175") = "TOUR") Then GoTo label_177: Else: Do While (Range("A174:A174") <> "DBCS#") And (Range("A175:A175") <> "TOUR") Select ...Show All
Visual Studio Team System Problem building a simple solution containing 1 CL and 1 ASP.Net
Hi all I have a solution, with 1 class library and 1 asp.net web-site. The web-site is referencing the class-library via the project and also 2 other assemblies via the dlls. Solution behaves fine on my local machine, however when trying to build it fails with MSB4018, here is the log: Build started 30/08/2006 12:10:15. __________________________________________________ Project "c:\teambuilds\Contact\CEC.Contact.Website\BuildType\TFSBuild.proj" (EndToEndIteration target(s)): Target InitializeEndToEndIteration: UpdateBuildNumberDropLocation BuildNumber='CEC.Contact.Website_20060830.1' DropLocation='\\mem-app-cen-181\tfsbuild\CEC.Contact.Website_20060830.1' Target CoreClean: Removing directory "c:\teambuilds\Contac ...Show All
Microsoft ISV Community Center Forums vlookup
Hello can anyone help me with how to write the excel vlookup function in vba the function in excel looks like this VLOOKUP(O2,'[Consolidated list of supplier.xls]Sheet3'!$A$5:$F$218,6,FALSE) how can i get something similar working in a macro. thanks namrata Hi, How about some like this Dim rngLookupValue As Range Dim rngtable As Range Dim lngColIndex As Long Dim blnRangeLookup As Boolean Set rngLookupValue = Range("O2") Set rngtable = Workbooks("Consolidated list of supplier.xls").Worksheets("Sheet3").Range("$A$5:$F$218") lngColIndex = 6 blnRangeLookup = False vntResult = Application.WorksheetFunction.VLookup(rngLookupValue, rngtable, lngColI ...Show All
Visual Studio Express Editions how to set a thread to run at specific core
1. is it possible to set a thread to run at specific core. 2. to find number of core using vb.net Using the WinApi it's possible to edit your process afinity mask and to resume threads. However this can actually have highly detrimental effect depending upon the the nature of your application. Windows normally tries to keep a thread running on the processor which initiated it. Afterall, that process is in cache and will be faster rather than to have to do another cache loading on another core. It would be the rare thread that could accomplish anything meaningful with hard affinity unless it was specifically designed to do so. Microsoft recommends the it's better to manipulate process ...Show All
Visual Studio Express Editions Timer won't fire
I have a timer on form1 with the timer_tick set up like this: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick teaTime = False MessageBox.Show("End timer") End Sub In a module I have: Public Sub Transition1() Form1.Timer1.Enabled = True teaTime = True Dim st As Integer = 0 Do While teaTime ...Show All
Visual Basic crop image & save it to new file, howto?
I have 3200x2200 resolution image, now I want to crop Image from pixel 1600,1100 until 3200,2200(1600x1100 res). and save it to the new file do you have the sample code I'll appreciate that I just knew how to save : If SaveFileDialog1.ShowDialog( Me ) = Windows.Forms.DialogResult.OK Then t.Save(SaveFileDialog1.FileName, Imaging.ImageFormat.Jpeg) End If but the problem is how to save the file with another image format(JPG, GIF) according to the savefiledialog thanks Roberts Hoath's answer has been tried and tested many times in the past and it's the easiest way to do it. No need to get into encoders etc. Though you may need saveDialog.FileName. ToUpper. EndsWith ...Show All
Visual Basic String without terminator "
Hi there, I was using an array of chars to take chars from a serial port buffer. But, when I do a cast to a string, for some strange reason, my string becomes something like string="haskjdh Without the last " !! I think this is really strange, did it happen to any of you P.S. Now I use the ReadExisting method that returns a string directly, but I really curious about the reason for this strange error :-) Thx Code: Dim buf(100) As Char If (Me.SerialPort1.BytesToRead > 0 And Me.SerialPort1.BytesToRead > 100) Then Me.SerialPort1.Read(buf, 0, 100) ElseIf (Me.SerialPort1.BytesToRead > 0) Then Me.SerialPort1.Read(buf, 0, Me.SerialPort1.BytesToRead) End If dim st as string=buf ...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
Visual Basic Problem with Singleton Code. Single instance in CLASS code.
I have a class that is invoked in multiple ways, but no matter how it is invoked, I only want one instance to exist at any one time. The class looks like this: [code langauage="VB"] Imports System.Threading Public Class SingletonClass Private Shared _mu As New Mutex Private Shared _instance As SingletonClass Public Shared ReadOnly Property GetInstance() As SingletonClass Get _mu.WaitOne() Try If _instance Is Nothing Then MsgBox("Creating New Instance of SingletonClass") _instance = New SingletonClass End If Finally ...Show All
Windows Forms Columns in DataGridView re-order themselves after build
I am using Visual Studio 2005 to develop a Windows Forms application. I apologize in advance for including information that may seem irrelevant to my question, but I feel that it might give someone a better idea of how to fix the problem. One of the forms in my application contained a tab control with eight different tabs, each of which contained an individual DataGridView control. The form also contained a table layout panel with 12 labels and 12 text boxes. I created columns for the DataGridViews in the forms designer. The columns each had a value assigned to the DataPropertyName property, which corresponded to a field in a binding source object to which the datagridview could bind at runtime. Each DataGridView set its datasource p ...Show All
Gadgets How to make ActiveX Callback functioning
I cannot get the office name control to call back to a jscript eventhandler. (Office 12 installed in my case) The page works well if just rendered in a browser, hoever it does not function when run in a gadget. The thing that fails is that the eventhandler is never called when a buddy chnages state. The callback function is registered by calling the OnStateChange function as shown below. is such a callback not allowed (or only with additional magic ) I'd also appriciate suggestions for debugging this as I am not quite sure how to approach this Jos no that is not working either. MotW only allows me to pusch a page to less priviliges and I seem to be missing some permission. The ActiveX control gets instantiated, the cal ...Show All
.NET Development PDF Encoding using StreamWrite and StreamReader
Hi All, I'm looking for the correct Encoding (or method) to read and write PDF files. When I use something like the code below, the generated PDF (Destination.PDF) is not the same as the Source.PDF used. StreamReader objSR = new StreamReader ( @"c:\temp\Source.pdf" , Encoding .ASCII); StreamWriter objSW = new StreamWriter ( @"c:\temp\Destination.PDF" , false , Encoding .ASCII); objSW.Write(objSR.ReadToEnd()); objSW.Close(); objSR.Close(); Thanks in advance! Since PDF can contain binary data and supports multiple encodings, I must once again warn against using anything other than binary access. Just because this is working with some files does ...Show All
Smart Device Development How to hide keyboard at mobile 5.0 or pocket pc2003
Hi all: Now I only know how to hide the menu_work and task bar at mobile 5.0 or pocket pc2003. But I have no ideal about How to hide the keyboard at these images. Could you help me for this. Thanks! Sample code: HWND hWndTaskbar = ::FindWindow(_T("HHTaskBar"), NULL); ::ShowWindow(hWndTaskbar, SW_SHOW); HWND hWndMenubar = ::FindWindow(_T("menu_worker"), NULL); ::ShowWindow(hWndMenubar, SW_HIDE); ....... I have used this API to try . But the menubar and input button(keyboard icon) doesn't hide. Sample code: HWND hwnd = GetSafeHwnd(); DWORD dwState = (SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); SHFullScreen(hwnd, dwState); // Next resize the main window to the size ...Show All
Visual C++ C programming
Hi, Everyones I do hope this question aren't getting bored at all .... Well, recently I typed some short C program that's require to include assembler code, and I got confused how to figure out the assembler editor on V S.net Does anyone know how to tackle this problem and I do hope too you are guys out there could drop me some source code or an example about that .....other question is how to use Clrscr() == in C : I had found ESC[2J but it won't work as Turbo Pascal compiler.....please show me.... Thanks.... Malvino..... Malvino wrote: by the way what is the #include <header file> must be put it regards to _asma and system(cls);, I do hope you would show me again ...Show All
