If you have the Office Developer Edition with MS Access you can use their Setup WIzard wich creates disk images for you as well as bringing together all (not 100%) the referenced stuff. This is the easiest way but not always problem free. If you used API functions in your code this setup program will not recognise them and you must somehow ensure that the API source files get on to the computer you are deploying to. Benefit of the Developer addition is that you get a runtime version of MS Access which adds greater security and behaves more like a standalone exe application (but there are enough querks to let you now it's not an exe). Also there are heaps of bugs relating to system folers being used as the location of your runtime application for some reason C:\My Documents\myMDE.mde /Runtime can stuff up so don't deploy in this folder.
The Hard Way
Use the object browser to view the libraries you have referenced also use the reference/cotrol lists and record all the dll, ocx, and every other file you referenced as well as it's path. Once you have done that collect all of them and write a program (or do it manually) that copies them to their original folders (dangerous do not overwrite newer versions).
Sux ha. The reason it's hard to deploy is that no one actually expected VB programmers to achieve anything, you know, we are seen as the "Wanna be programmers." and as such the part of getting your app distributed hits those software manufactures as big news .....bigger than a newspaper front page article ...."Whore becomes Christian" or "Christian WOman Becomes WHore", either way it wasn't ment to be.
Actually it is a Normal TextBox. I looked over the documentation on MSDN and found that there was a slight problem. I was passing lPoint as ClientCoordinates not ScreenCoordinates, so I fixed that, yet SendMessage is still returning -1.
"Edit controls: The low-order word contains the horizontal coordinate. The high-order word contains the vertical coordinate."
It appears that is what I am doing.....
ClientToScreen txtPrice.hwnd, ptCaret
lPoint = (ptCaret.y * &H10000) Or (ptCaret.x And &HFFFF&)
lIndex = SendMessage(txtPrice.hwnd, EM_CHARFROMPOS, 0, lPoint)
If lIndex And &H8000& Then
nCharIndex = lIndex Or &HFFFF0000
nCharIndex = lIndex And &HFFFF&
Ignore my rich edit comment... for some reason I thought you were passing lParam incorrectly, but you are not - my mistake.
I see no reason why this would not work then. You checked lPoint in hex to make sure it was formed right, did you? Other than that the only other reason I can think of that it would return this (it's actually returning two short integers, both -1: for line number and char number) is if there was no text in the control at the specified point... are you clicking within a portion you KNOW contains text, or are you cliking beyond the text it contains?
Yes I did check the lPoint value in Hex. It was set up correctly.
I am not clicking in the control to trigger the code I am doing the code within KeyPress. I know the textbox has text. And I have tried it when the cursor is at the end of the text as well as in the middle of the text.
I'm stumped too. If you had only tried with the caret at the end, I might have understood; MSDN also says:
"The index indicates the line delimiter if the specified point is beyond the last visible character in a line."
which might explain the -1.
But if you've tried it from the middle...
I'm not sure what you're trying to achieve, but an alternative might be to keep a copy of the text box's text each time a key is pressed. Then when the next key is pressed, you can get its current contents and compare to the contents saved from last time. That will tell you what character has been deleted or added...
I've been trying to get a macro to refresh the formulae in a workbook (say every 10 seconds or so) to update a timer I've constructed. I will need to be able to run other macros while the timer is running.
Can anyone point me in the right direction please?
Is ther any one can tell me that how to creat a sub property in ActiveX control, like A recordset has sub properties and the TableDef has an array or properties and same with the fields.
I will obviously thankfull to you.
I have a deep problem with Visual Basic. I just started using it a few days ago so there's still a lot to learn (sorry for any dull questions). The problem is that I tried to put a lot of controls on a form that I had to change the height of the form to the maximum but still needed to put more controls so I thought it was best to add scroll bars to the form and just scroll the contents of the page. OK, now I have two problems; the first probelm is that I have resized the form to its maximum height but still need to add more controls, how can I change the height of the form after it reached its maximum (11520 twips on 1024x768 resolution)?! Do I have to create the controls dynamically? Or should I just place them anywhere then change their positions at run-time? the second problem is that I can't add scroll bars to the form (of course I could've used the scroll bar control but this is not what I want, I want to add the scroll bars to the window not as seperate controls). Should I use SetWindowLong() to change the style of the window at run-time? If I add the scroll bars how can I scroll the contents of the page?
Private Sub cmdOK_Click()
1 Dim CNN As New ADODB.Connection
2 Dim RCS As New ADODB.Recordset
3 Dim CNNstr As String
4 Dim sqlstr As String
5 Open App.Path + "\" + "db\CNNstr.txt" For Input As #1
6 Input #1, CNNstr
7 Close #1
8 CNN.CursorLocation = adUseClient
9 CNN.Open CNNstr
10 sqlstr = "select * from TABLE where UserID = '" & Text1.Text & "' and UserPassword ='" & Password & "'"
11 RCS.Open sqlstr, CNN, adOpenForwardOnly, adLockReadOnly
12 If RCS.RecordCount > 0 Then
13 Form1.Show 1
15 r = MsgBox("Unauthorised User")
17 End If
1, 2, 3, 4 Declare variable
5 get the database path in text file
10 check whether the user exist and the password correct or not at once
I have a couple of forms in my MDI application. When I create multiple instances of the child forms, they occupy a lot of screen real-estate. I want to change my design to have one single form having a tab control with each tab displaying the same controls which is currently displayed in separate forms. Is there any way I can attach/move the controls in a form to a tab page at run-time?
For example, there are two forms - Form1, Form2. The user can create any number of instances of these forms at run-time. Instead I want to have a tab control and show these forms as tab pages. The existing forms have lot of contrls and there is lot of code behind them!
Is there any way I can attach these controls to a tab ctrl at run-time?
i am currently working on a shell. my shell will completely get rid of the start/tool/task bar, however i dont want to always push alt+tab whenever i switch to a new window. does anyone know how to program a totally new running tool bar so i can click on a minimized window instead of always pushing alt tab?
Hi i just want to ask who i can change the screen resolution from visual basic! thnx!
The Code That Man Do!
When The Night
Will Gather Darkness
And Black Clouds Unadorde
Only Poets, Dreams And Mandess
Will Sail Out Into The Storm!
Each Man Has A Soul
That Struggles To Escape
And In The Shallows Of His Dreams
We Can Often See Its Wake!
Let's say i want to have a feature in my system which enable users to view chart report e.g. students' performance. How am i suppose to do that in VB language? Can i link to MS Excel to create these charts? Please help. Thank you.
Does anyone know how if it is possible to export a text file out of Access using a VBA function like (DoCmd.TransferText) to append a text file instead of writing over it. Or is there a different approach that would work.
' Replace "Any.Doc" with your document name
' type with or without path you want to save it to
Dim strSaveAs As String
Dim strMsg As String
strSaveAs = "Any.Doc"
strMsg = "Choose Yes to overwrite the existing document " & vbCrLf _
& "'" & strSaveAs & "'" & " or No to save as a new document"
If Dir(strSaveAs & "*") = "" Then
Select Case MsgBox(strMsg, vbYesNoCancel + vbExclamation)
.Name = ""
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru. And one year experience with the VB guru
Is it possible to call an Extension DLL from VB as I've a satellite orbit prediction DLL that exports a C++ class only. The DLL will need to be integrated with Matlab eventually but I'm looking into this for a colleague and don't have Matlab on my PC, just Visual Studio.
#define DLLEXPORT __declspec(dllexport)
class DLLEXPORT CSGP4_SDP4
...member functions here.
Any suggestions would be appreciated.
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-16 14:30