|
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.
|
|
|
|
|
Hi,
I am trying to retrieve the CaretPosition within a textbox. I have tried the following code within the KeyPress event of the TextBox:
Dim ptCaret As POINTAPI
Dim lPoint As Long
Dim lIndex As Long
GetCaretPos ptCaret
lPoint = (ptCaret.y * 65536) + (ptCaret.x And &HFFFF&)
lIndex = SendMessage(txtPrice.hwnd, EM_CHARFROMPOS, 0, lPoint)
If lIndex And &H8000& then
nCharIndex = lIndex Or &HFFFF0000
else
nCharIndex = lIndex And &HFFFF&
End If
GetCaretPos returns the correct x,y coordinates, but SendMessage always returns -1.
Any ideas????
Chris Mancini
|
|
|
|
|
This is a rich edit, right? Normal text boxes require a different use of the lParam parameter.
Check your lPoint value in hex and make sure it looks OK, in case the attempt to form lPoint went wrong - if it did, try using "&h10000&" instead of "65536", and try using "Or" instead of "+".
|
|
|
|
|
Thanks for your response.
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.
MSDN Says....
"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.....
GetCaretPos ptCaret
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
Else
nCharIndex = lIndex And &HFFFF&
End If
Thanks
Chris Mancini
|
|
|
|
|
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 am stumped.
Chris Mancini
|
|
|
|
|
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...
|
|
|
|
|
If you are interested I put together a simple demo which is shows this happening.
Chris Mancini
|
|
|
|
|
Yes, OK - throw it my way (jteagle@ntlworld.com). Tomorrow I can then take a look and see if I can spot anything (I'm on UK time). No guarantees though.
|
|
|
|
|
|
test 2
test 2
|
|
|
|
|
Hi ! I'm Lucky Luck, I'm student in Australia, I like programming with VB, I want to ask you anything :
When I creat any form, I don't know what to do in spite of form ? What will I do ?? Ex : Program : - Sonicque
- Herosoft
- ....anything
|
|
|
|
|
Well, you're not the only one who's confused here What exactly are you trying to ask?
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Hi ! I'm Lucky Luck, I'm student in Australia, I like programming with VB, I want to ask you anything :
When I creat any form, I don't know what to do in spite of form ? What will I do ?? Ex : Program : - Sonicque
- Herosoft
- ....anything
|
|
|
|
|
Hi
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?
Thanks
Geoff Anderson
|
|
|
|
|
maybe the DoEvents will help you?
Qapla
|
|
|
|
|
Hi
I've been trying to find how to get a macro to adjust the size of a range of data that feeds a chart. I want the range to grow by one cell each time a new piece of data is logged.
Can anyone help please?
Geoff Anderson
|
|
|
|
|
I don't think this even uses a macro, but check out this example:
http://www.ozgrid.com/download/default.htm
Go to this site and download the ChartByMonth.zip example.
|
|
|
|
|
Are there any VB functions, or is ther a way to retrieve general information about a PC. Information such as Make, Model, Monitor Make, Network Card Make and Model
Joe
|
|
|
|
|
Assuming you are talking Microsoft OS...MS Diagnostics holds most of what you've mentioned if not all and you could possibly get that info from the registry.
I too would be interested in other methods to solve this problem.
Best to you...
\\Jim
General System Information
jamesdturner@hotmail.com
jamesdturner@hotmail.com
|
|
|
|
|
Are there any VB functions, or is ther a way to retrieve general information about a PC. Information such as Make, Model, Monitoer Make, Network Card Make and Model
Joe
|
|
|
|
|
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.
sameers
sameers@hangamahouse.com
|
|
|
|
|
i think you mean something like this
in class, MyActiveXControl
<br />
Private m_sStringProperty as String<br />
<br />
...<br />
<br />
Public Property Get MyStringProperty() as String<br />
MyStringProperty = m_sStringProperty<br />
End Property<br />
<br />
Public Property Let MyStringProperty(sSP as String)<br />
' Validate if you want<br />
m_sStringProperty = MyStringProperty<br />
End Property<br />
You can also use 'Public Property Set' to have an object be a property and you can use Private to make your property read/write only as well.
James Johnson
--
There are two secrets to success. 1) Never tell anyone everything you know.
|
|
|
|
|
I understand how to go from a HelpContextID to an .htm file using the Map and Alias
tabs of the HTML Help Workshop.
Can one go from a HelpContextID to a bookmark in an HTML file?
Specifying
IDH_Helpme = file.htm#bookmark
does not work (It gives file file.htm#ookmark not found). Is there a syntax which does work?
thanks
nick toop
|
|
|
|
|
Hello codegurus,
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?
Any suggestions would be appreciated.
|
|
|
|