|
Property sheets will advance based on the way in which you set your property page. As for not advanceing if the validation fails return -1 and you will stay on the same page.
|
|
|
|
|
I want my application to check for an active VPN connection.
Any ideas?
Thanks
A reasonable man adapts himself to the world. An unreasonable one persists, trying to adapt the world to himself. That is why all the progress in the world depends on the unreasonable men.
|
|
|
|
|
Back in the 'ol days of VB6, debuging a DLL was as easy as instanciating an object (set x = new ABC) in the Immediate window and stepping through the code.
IS there ANY sort of parallel in the .NET world? I've only been able to debug VB.NET dll's via a reference in a windows form project.
TIA.
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
Hi! I got a file called "FILENAME_XXX_YYY_ZZZ.txt".
Is it possible to read the X,Y,Z information into some variables.
Thankx
Pat
|
|
|
|
|
write a parser that parses on "_"
Dim mystring As String
Dim resultstr(3) As String
Dim nStart As Integer
Dim nEnd As Integer
Dim cnt As Integer
mystring = "hfskh_XXX_YYY_ZZZ.txt"
nStart = InStr(mystring, "_")
Do While (nStart > 0)
nEnd = InStr(nStart + 1, mystring, "_")
If nEnd = 0 Then
nEnd = InStr(nStart, mystring, ".")
End If
resultstr(cnt) = Mid(mystring, nStart + 1, nEnd - nStart - 1)
nStart = InStr(nStart + 1, mystring, "_")
cnt = cnt + 1
Loop
|
|
|
|
|
Is there any way I can open pdf files from VB?
Or is there any way I can find the exe file of Acrobat reader?
|
|
|
|
|
|
I only want to execute reader 5 and open the pdf files i want by clicking on a button in an application i created.
|
|
|
|
|
Andy Chiang wrote:
I only want to execute reader 5 and open the pdf files i want by clicking on a button in an application i created.
In that case, read this article which explains how you can do what you want :-
http://www.codeproject.com/useritems/newbiespawn.asp
Nish
p.s. It's a C++ article, but you can use the same calls from VB I presume!
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I am trying to convert the C# example of MSHTML Advanced Hosting Interfaces to VB.Net. The article can be found under C# programming -> Com Interop -> Using MSHTML Advanced Hosting Interfaces, or at http://www.codeproject.com/csharp/advhost.asp
Anyways, this is the translated code but it doesn't seem to work. Any help would be greatly appreciated.
I tried to convert the code from C# to VB.Net but it doesn't seem to be working. The application won't pick up the Button Clicked Events. I have an html file called start.htm with two buttons...Open FileNew File. I'm not sure exactly what is wrong but here is my code.
Imports MsHtmHstInterop
Imports MSHTML
Imports AxSHDocVw
Public Class frmChild
Inherits System.Windows.Forms.Form
Implements IDocHostUIHandler
'Windows Form Designer generated code, including protected webStart as AxWebBrowser
Protected Sub InitializeBrowsers()
Dim o As Object
Dim theLoc As String = Application.StartupPath
webStart.Navigate("about:blank", o, o, o, o)
Dim cDoc As ICustomDoc = CType(webStart.Document, ICustomDoc)
cDoc.SetUIHandler(CType(Me, IDocHostUIHandler))
webStart.Navigate(theLoc & "\html\start.htm", o, o, o)
End Sub
Private Sub WebBrowser_DocumentComplete(ByVal sender As Object, _
ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) _
Handles webStart.DocumentComplete
' Get the document
Dim doc As IHTMLDocument2 = CType(webStart.Document, IHTMLDocument2)
' Get references to the buttons
Dim btnOpen As HTMLButtonElement = CType(doc.all.item("btnOpen", Nothing), HTMLButtonElement)
Dim btnNew As HTMLButtonElement = CType(doc.all.item("btnNew", Nothing), HTMLButtonElement)
' Attach the event handlers with the events interface
AddHandler CType(btnOpen, HTMLButtonElementEvents2_Event).onclick, _
New HTMLButtonElementEvents2_onclickEventHandler(AddressOf Me.ButtonOpen_onclick)
AddHandler CType(btnNew, HTMLButtonElementEvents2_Event).onclick, _
New HTMLButtonElementEvents2_onclickEventHandler(AddressOf Me.ButtonNew_onclick)
End Sub
Private Function ButtonOpen_onclick(ByVal e As IHTMLEventObj) As Boolean
MsgBox("Alert from the app: Received HTMLElement btnOpen.onclick Event!")
Return True
End Function
Private Function ButtonNew_onclick(ByVal e As IHTMLEventObj) As Boolean
MsgBox("Alert from the app: Received HTMLElement btnNew.onclick Event!")
Return True
End Function
'''''''''''''''''''''''''''''''''''''
' IDocHostUIHandler implementation '
'''''''''''''''''''''''''''''''''''''
Sub EnableModeless(ByVal fEnable As Integer) _
Implements IDocHostUIHandler.EnableModeless
End Sub
'ppDORet out
Sub FilterDataObject(ByVal pDO As MsHtmHstInterop.IDataObject, ByRef ppDORet As MsHtmHstInterop.IDataObject) _
Implements IDocHostUIHandler.FilterDataObject
ppDORet = Nothing
End Sub
'ppDropTarget out
Sub GetDropTarget(ByVal pDropTarget As IDropTarget, ByRef ppDropTarget As IDropTarget) _
Implements IDocHostUIHandler.GetDropTarget
ppDropTarget = Nothing
End Sub
'ppDispatch out
Sub GetExternal(ByRef ppDispatch As Object) _
Implements IDocHostUIHandler.GetExternal
ppDispatch = Nothing
End Sub
Sub GetHostInfo(ByRef pInfo As _DOCHOSTUIINFO) _
Implements IDocHostUIHandler.GetHostInfo
End Sub
'pchKey out
Sub GetOptionKeyPath(ByRef pchKey As String, ByVal dw As UInt32) _
Implements IDocHostUIHandler.GetOptionKeyPath
pchKey = Nothing
End Sub
Sub HideUI() _
Implements IDocHostUIHandler.HideUI
End Sub
Sub OnDocWindowActivate(ByVal fActivate As Integer) _
Implements IDocHostUIHandler.OnDocWindowActivate
End Sub
Sub OnFrameWindowActivate(ByVal fActivate As Integer) _
Implements IDocHostUIHandler.OnFrameWindowActivate
End Sub
Sub ResizeBorder(ByRef prcBorder As MsHtmHstInterop.tagRECT, ByVal pUIWindow As IOleInPlaceUIWindow, _
ByVal fRameWindow As Integer) _
Implements IDocHostUIHandler.ResizeBorder
End Sub
Sub ShowContextMenu(ByVal dwID As UInt32, ByRef ppt As MsHtmHstInterop.tagPOINT, _
ByVal pcmdtReserved As Object, ByVal pdispReserved As Object) _
Implements IDocHostUIHandler.ShowContextMenu
End Sub
Sub ShowUI(ByVal dwID As UInt32, ByVal pActiveObject As IOleInPlaceActiveObject, _
ByVal pCommandTarget As IOleCommandTarget, ByVal pFrame As IOleInPlaceFrame, _
ByVal pDoc As IOleInPlaceUIWindow) _
Implements IDocHostUIHandler.ShowUI
End Sub
Sub TranslateAccelerator(ByRef lpmsg As tagMSG, ByRef pguidCmdGroup As Guid, ByVal nCmdID As UInt32) _
Implements IDocHostUIHandler.TranslateAccelerator
End Sub
Sub TranslateUrl(ByVal dwTranslate As UInt32, ByRef pchURLIn As UInt16, _
ByVal ppchURLOut As IntPtr) _
Implements IDocHostUIHandler.TranslateUrl
End Sub
Sub UpdateUI() _
Implements IDocHostUIHandler.UpdateUI
End Sub
End Class
Thanks
|
|
|
|
|
Somewhere in there you need to connect to the browser instance to receive events. At least that's what I had to do under ATL. I don't see that anywhere in your code. I think I use AtlAdvise and AtlUnadvise?
Todd Smith
|
|
|
|
|
Can I use relative file path in VB? For e.g., if I want to put a picture from a CD that I created into a application program which is executed directly from the CD, how do I specify my picture's location? or is that anyway I can know the CD-ROM drive where the CD is ?
|
|
|
|
|
Hi !
I'm not sure to understand exactly what you want to do, but in VB, App.Path will give you the path of your running app. Thus, you can use it to access relative file path.
Jérôme
|
|
|
|
|
1) I know is this is .NET forum but here i go anyway... Let's say i post a message to a VB form using it's HWND from a Visual C++ application. How can i get the the VB form to process/handle the message?
2) Let's say my VB form calls a DLL that performs some I/O with a serial
port. How can i use a thread from the DLL or VB form to inform the user what is going on? (eg. informing them through a textbox for example that serial communication is taking place)
Thanks!
|
|
|
|
|
- Subclass the form. This is much easier in VB.Net than VB, but it can be done. Have a look at vbAccelerator.com for some examples;
- Use .Net or C++! Seriously, threading is a nightmare in VB, but VB.Net makes it almost pleasurable.
|
|
|
|
|
Hi,
The answer to your second Question.
From a DLL you can use API calls to inform the user whatz happening inside the DLL.
Taking your example, You have a textbox for the user to see and a process takes place in the DLL. Now you can use SendMessage API call to inform the user that something is happening in the DLL. All you have to do is to pass the handle of the textbox to the DLL so that you can post message back to the textbox from the DLL using SendMessage API
Ravi Shankar S
Programmer Analyst
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
Hi all,
"I have inherited" from a my colleague a VisualBasic6 application that uses an Access97 database with Jet(I suppose). In the code I found hte following string "Provider=MSDataShape.1;Persist Security Info=False;Connect Timeout=15;Data Source=" & JCR_DB & ";Data Provider=MICROSOFT.JET.OLEDB.4.0"
Now I would to use Access2000 but, when I try to connect it I receive an message error: "incompatible format"...
I think that I have to change the Project->References using a new OCX (?!) but how?
Anyone could help me?
Excuse me if I have described the problem in little detailed way but I don't know VB programming.
...and sorry for my english!
Ciao!
|
|
|
|
|
This web site has a vary good listing of all the ADO connection strings.
http://www.able-consulting.com/ADO_Conn.htm
To make a reference to a different version of Ado goto project -> references, and they are called microsoft activex data objects.
To download the lastest version of ADO, you will have to do this for each computer if it's not already installed..
http://www.microsoft.com/data/
Good luck
|
|
|
|
|
Helo
Im planing a project, but one of my requirements is that the app
will auto-update it self. My plan is to have the app checking whith
my server if there are any new program-updates/patches.
Q: Are ther any built-in services witch can help me whit this?
Or can a webservice fix it, having the patch in XML?
Andreas
|
|
|
|
|
check out this great application updater component from a guy at Microsoft:
http://www.gotdotnet.com/team/windowsforms/appupdater.aspx
|
|
|
|
|
I have a problem:
Try make a new custom control(usercontrol1). In this control, you add a listbox which goes beyond the bounderies of you usercontrol1 and insert as many strings so these as well goes beyond the bounderies. That is it, compile it.
Now try add usercontrol1 and a button control to a webform. Since the listbox goes beyond the the bounderies, you add the property (autoScroll = true ) to usercontrol. Compile and run the program. You now use the scrollbar to go to the last element in the listbox and select this. You now push the button, and then you select the second last item in the listbox. Now you will see that the usercontrol scrolls to the top.... WHY? I think it it because the control is being ScrollControlIntoView, but how to prevent that?
Thanks in advance...
Gooky
|
|
|
|
|
Hello,
I made a new dll, for my VB program, and i need to pass
array (with no lenth defined) in parameters.
my function (in c++) have a float pointer
but VB doesnt validate my function...
anyone having ideas...
|
|
|
|
|
What language did you use for the DLL?
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied." - Alex, 13 June 2002
Please review the Legal Disclaimer in my bio.
|
|
|
|
|
I use the managed c++ library for wrapping a class,
and i spell it into VB...
I have now a function which copying the __gc table
to __nogc table...
But is there other means to acces to the memory,
for example with a pointer...
|
|
|
|
|
When you said "managed C++", that eliminated me fromt he discussion. Unless forced to by a job change or corporate policy of my current employer, I have no interest or knowledge in "managed" c++.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|