|
|
I'm not sure powertoys are the way to go, doesn't the 3rd party need to have the same powertoy to be able to see the descriptions? what if I want to ship user friendly marketable components, so when the developers program, they can see description tags for each method, just like they expect to. I know it's not a language issue, but yet what this means is those who program in C# can create quality components, whereas we can't... If there is 1 limitation, you can bet there will be more.
|
|
|
|
|
Mesrop Simonian wrote:
doesn't the 3rd party need to have the same powertoy to be able to see the descriptions
No, because all it does is generate the XML that the standard tools need. All it does is plug the gap for VB.NET
Mesrop Simonian wrote:
those who program in C# can create quality components, whereas we can't...
Do VB Programmers traditionally write components anyway?
VB (and VB.NET) is a productivity language before all else, and this usually means gluing together existing bits to solve a specific problem more than writing new components. So it's not a big issue for me at all, and with the powertoy, it isn't an issue at all.
I'm comfortable with VB.NET as a productivity tool (much more so than C#), and if I really need to ramp up performance or do something really tricky, I'll break out the C++ tools and use those.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Actually, from a language point of view, they DO do everything. This is just an output from the compiler that isn't supported...yet! Wait 'til the 2004 version...
RageInTheMachine9532
|
|
|
|
|
After a lot of pondering I finally decided to turn to my highest VB authority on this matter - Francesco Balena. Here's what he said for all those who asked me to keep them posted on this matter:
----
That feature is based on descriptions held in an XML file held in the same directory as the DLL containing the actual types and methods. To see what I mean, see all the DLLs and the pairing XML files in the C:\Windows\Microsoft.NET\Framework\v1.1.4322 folder
The guys that say that it can be done only with C# are partially right, because C# makes it _easier_ to generate the XML files that the Object Browser (and Intellisense) use to store descriptions of each methods. The C# compiler has an option that gathers all the comments interspersed in code (in a special format) and generates the XML file that VS.NET uses.
With VB you must generate this file manually. However, there is a tool at http://www.gotdotnet.com/team/vb/ that lets you do that with VB as well.
It is true (unfortunately) that C# can do things that VB can't - most notably, operator overloading, unsigned integers, and unsafe code - but this feature isn't one of those.
regards,
Francesco
|
|
|
|
|
I wrote a program (VB.Net) that takes the exiting file name, opens it, formats it and allowing the user to change/format the file and wait for the user to close the excel applilcation
but my WaitForExcelToClose function is not working..
Can someone please help me.
<br />
<br />
Dim wBooks As Excel.Workbooks<br />
Dim wBook As Excel.Workbook<br />
Dim sheets As Excel.Sheets<br />
<br />
excelApp = CreateObject("Excel.Application")<br />
wBooks = excelApp.Workbooks()<br />
wBook = wBooks.Open(filename)<br />
sheets = wBook.Worksheets<br />
' some other functions<br />
sheets.PrintPreview()<br />
WaitForExcelToClose()<br />
excelApp.Quit()<br />
<br />
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br />
Private Declare Function GetLastError Lib "kernel32" () As Long<br />
Private Declare Sub SetLastError Lib "kernel32" (ByVal dwErrCode As Long)<br />
Private Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, ByVal lpSource As Integer, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByVal Arguments As Long) As Long<br />
Private Declare Function GetWindowThreadProcessId Lib "user32" Alias "GetWindowThreadProcessId" (ByVal hwnd As Long, ByVal lpdwProcessId As Long) As Long<br />
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long<br />
Private Declare Function WaitForSingleObject Lib "kernel32" Alias "WaitForSingleObject" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long<br />
Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long<br />
<br />
<br />
Public Sub WaitForExcelToClose()<br />
<br />
Dim hWnd As Long<br />
Dim buf As String<br />
hWnd = FindWindow("XLMain", excelApp.Caption)<br />
If hWnd = 0 Then<br />
buf = Space(1024)<br />
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0&, GetLastError, LANG_NEUTRAL, buf, 200, 0&)<br />
Else<br />
Dim pid As Long = 0<br />
Dim lngThread As Long<br />
Dim lngReason As Long<br />
lngThread = GetWindowThreadProcessId(hWnd, pid)<br />
Dim lngProcess As Long<br />
lngProcess = OpenProcess(SYNCHRONIZE Or PROCESS_ALL_ACCESS, True, pid)<br />
lngReason = WaitForSingleObject(lngProcess, INFINITE)<br />
CloseHandle(lngProcess)<br />
End If<br />
End Sub<br />
thank you
|
|
|
|
|
Seems like alot of work for waiting for Excel to close. Could you declare the excelApp object WithEvents and then handle the WorkbookBeforeClose event?
RageInTheMachine9532
|
|
|
|
|
|
Possibly something like this:
Dim WithEvents appExcel As Microsoft.Office.Interop.Excel.Application
Private Sub appExcel_WorkbookBeforeClose(ByVal Wb As Microsoft.Office.Interop.Excel.Workbook, ByRef Cancel As Boolean) Handles appExcel.WorkbookBeforeClose
' do something here!
End Sub
I don't know if this is going to work the way you want, but...
RageInTheMachine9532
|
|
|
|
|
no but thank you for you help
|
|
|
|
|
Hi, Is there any way to get a programme written in Visual Basic .Net to work on a computer running Windows NT.
I'm trying to show a friend a programme I wrote but his computer runs Windows NT and my understanding is that Windows NT won't run a VB.Net programme...
If this is so is there any language which does run on Windows NT and any way to convert the Visual Basic.Net programme so that it would run?
|
|
|
|
|
All you have to do is install the redistributionalble portion of the .NET Framework. This is availble free on the Microsoft website.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
Sure. Make sure he's running Service Pack 6a and then install the .NET Framework available here[^].
RageInTheMachine9532
|
|
|
|
|
i use DrawRectangle to draw shapes in vb.net form..then i minimize the form and restore again, my rectangle is missing?!!!same happen to other type of shapes!! anyone can help me plz....
|
|
|
|
|
Have you heard the story of the "Boy who cried 'wolf'"? Of your six posts on this forum 4 have carried the word "Emergency" and 1 has used the word "Urgent".
Are they real emergencies? Will someone die if the answer is not found?
All I am asking is that you tone down this sort of language because people will become desensitised to it.
From my experience: Emergencies in software development are rare. Often if I get stuck on one part of a system I can post a question and move on to a different part. If/when someone replies I can go back and try their suggestion.
To your specific problem: Are you using DrawRectangle in the Paint event handler. The reason is that when any window is minimised or another window drawn on top then the contents of the window become damaged. The Operating System will not keep track of what is being drawn on the window, that is your job. If you draw with basic tools like DrawRectangle then you have to draw each time the window gets damaged. Normally when a window is damaged and needs to be redrawn Windows will issue a Paint event. You must handle this event and perform your drawing.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
i put emergency becoz i am doing my final yr project... i need the information as soon as possible due the time constraint of my project... if wat i done make u unhappy... then i apologize to u...
and thanks for ur reply...
|
|
|
|
|
Hi MJAY...
You will need to store the points you have used to create the rectangle in an array or a file..
Then in the paint event you will have to recreate all the objects drawn in that control..
Hope this Helps..
Thanks !
Manoj Madhavam
|
|
|
|
|
as topic, i can find DrawEllipse, DrawRectangle in picturebox control but i cant find DrawRoundRec in VB.Net !! anyone can help me plz...
this is the roundrectangle i mean...(of coz the lines must be connected each other)
____
(____)
|
|
|
|
|
That's because there isn't one. You're going to have to draw them yourself, line segment by line segment. You might want to look into GraphicsPath for creating an object that can be drawn all at once.
RageInTheMachine9532
|
|
|
|
|
Hi,
Here's a couple of functions I wrote that will draw you a rectangle with rounded corners. I just ripped them out of my own code, so I hope I didn't miss anything. Just call DrawRoundedRectangle and pass it your graphics object, a rectangle to draw in and an integer specifying how "round" you want the corners to be. If you have a program drop me a line.
' Draw an empty rectangle with rounded corners using the same pen for all sides
Public Sub DrawRoundedRectangle(ByRef prGraphics As Graphics, ByRef prPen As Pen, ByRef prRect As Rectangle, ByVal pvRounding As Integer)
Dim lrectSurface As GraphicsPath
lrectSurface = BuildRoundedRectangle(CreateRectangle(prRect.Left, prRect.Top, prRect.Width - 1, prRect.Height - 1), pvRounding)
prGraphics.DrawPath(prPen, lrectSurface)
End Sub
' Build a graphic path for a rounded rectangle/square
Public Function BuildRoundedRectangle(ByRef prRect As Rectangle, ByVal pvRounding As Integer) As GraphicsPath
Dim lPath As New GraphicsPath()
Dim lHalf As Integer = CInt(pvRounding / 2)
With prRect
lPath.StartFigure()
lPath.AddArc(.Left, .Top, pvRounding, pvRounding, 180, 90)
lPath.AddLine(.Left + lHalf, .Top, .Right - lHalf, .Top)
lPath.AddArc(.Right - pvRounding, .Top, pvRounding, pvRounding, 270, 90)
lPath.AddLine(.Right, .Top + lHalf, .Right, .Bottom - pvRounding)
lPath.AddArc(.Right - pvRounding, .Bottom - pvRounding, pvRounding, pvRounding, 0, 90)
lPath.AddLine(.Right - lHalf, .Bottom, .Left + lHalf, .Bottom)
lPath.AddArc(.Left, .Bottom - pvRounding, pvRounding, pvRounding, 90, 90)
lPath.AddLine(.Left, .Bottom - lHalf, .Left, .Top + lHalf)
lPath.CloseFigure()
End With
BuildRoundedRectangle = lPath
End Function
Nursey
|
|
|
|
|
thanks for replying me!!
i think i need ur program understand how the coding works, can u send to me?
my email is mjlai83@pd.jaring.my
thanks again for help!!
|
|
|
|
|
I have been writing a VB 6 program to execute dos commands with parameter eg :-
Commands1 = "pairdisplay -x umount " & DriveLetter & " " & VolumeName & " > d:\apps\shadowapp\logs\pairdisplay4.txt"
ExecCmd Commands1
Public Sub ExecCmd(ByVal cmdline As String, Optional ByVal HideWindow As Boolean = False)
' This sub executes the command in cmdline$ and waits for it to finish.
Dim proc As PROCESS_INFO
Dim start1 As STARTUPINFO
Dim ret&
If (HideWindow) Then
start1.dwFlags = STARTF_USESHOWWINDOW
start1.wShowWindows = SW_HIDE
End If
start1.cb = Len(start1)
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start1, proc)
ret& = WaitForSingleObject(proc.hProcess, INFINITE)
ret& = CloseHandle(proc.hProcess)
End Sub
When I try and execute this the execcmd gives an error stating that the file cannot be found.
Right now this does not work with the parameters and for the the pipe for the output (txt file), but the individual commands without the output etc do.
I am at a loss of how to get this to work. If anyone can help then i would really appreciate it.
Paul
|
|
|
|
|
Try adding the full path to pairdisplay before you pass it to ExecCmd:
Commands1 = "C:\Full\PathName\pairdisplay -x umount " & DriveLetter & " " & VolumeName & " > d:\apps\shadowapp\logs\pairdisplay4.txt"
RageInTheMachine9532
|
|
|
|
|
I want to make an image maipulation program and would like to know if anyone has any code that would be useful for image manipulation. Anything would be helpful...THANKS!!!;)
|
|
|
|
|
What kind of manipulation? There are volumes of books on various techniques for HUNDREDS of manipulations. Also, your going to have to be aware of pixel formats, color tables, transparency, ...
RageInTheMachine9532
|
|
|
|
|