Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Finish The System When An Error Happen Inside A DLL


Dear friends,

I've a application that uses a ActiveX (DLL) like a 2ª layer.
This DLL can have an error, If an error happens inside this DLL, I want that my application END.
I was using the world "END" to finish my application when the error happened, but the sustem returns a message saing that the world "END" can't be used inside an ActiveX.

How I FINISH my application if an error happens inside the code of my DLL?

Thanks and sorry about my bad english.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Finish The Application When An Error Happen Inside A DLL
Dear friends,

I've a application that uses a ActiveX (DLL) like a 2ª layer.
This DLL can have an error, If an error happens inside this DLL, I want that my application END.
I was using the world "END" to finish my application when the error happened, but the sustem returns a message saing that the world "END" can't be used inside an ActiveX.

How I FINISH my application if an error happens inside the code of my DLL?

Thanks and sorry about my bad english.

What Happen In System For WM_LBUTTONDBLCLICK ?
Please tell me step by step of technical information for WM_LBUTTONDBLCLICK.

I know the result is windows must be highlight the word if it do on any text.

How To Make .exe File After I Finish My System??
how to make .exe file after i finish my system??

i already finish my system, i want make it .exe file
how 2 do that??

and how i can make a setup program install my .exe??


Example like windows xp instalation when we click setup it will run the instalation progress and folowwing xxxxxxxxxxxxxxxxxxxxx


i want make my system instal like that how 2 make it??

Error 372, Sometime Happen And Some Time Not
I hit the following error:

Run-time error '372'
Failed to load control 'ABC' from ABC.ocx. Your version of ABC.ocx may be outdated.
Make sure you are using the version of the control that was provided with your application

The strange thing is I run the same program, sometimes it has this error, and sometimes do not.
It happens when I display a form B. But before form B, display form A with the same control
do not have the error.
And form B not always have this error, just sometimes...

Anybody help?

Thanks

An Error In EXE Which Doesn't Happen In Design Environment
Okay. As a preface, I've been doing this for over 5 years, and this has got me stumped.

I'm getting an error: Run-time error '5': Illegal Function Call when I'm running the .exe . I do not get this when running in the design environment (Start with Full Compile). I cannot track down what or where the error is caused.

As a given, all 'on error resume next' statements are commented out. I'm using Option Explicit.

In order to attempt to trap it the old fashioned way, I have msgbox's in certain places, but the oddest thing happens. No matter where I put my msgbox's I still get the error, but the msgbox is behind the error dialog box. I can still click on 'OK' on my msgbox and the program terminates.

Kind of a tough one to explain, but even tougher to figure out. Anyone???

Stop VB From Complaining With A Error Box When I Don't Finish A Line?
I like to copy and paste a lot(helps prevent typos) but say I am in the middle of an if statement and I need to copy something from above I click off the statement and VB6 gives me that error
is there an option I can turn off to make it so those blasted boxes don't pop-up?

Handling Error's Inside An Error Handler - How?
Looking for some insight on proper error handling. How would one handle errors that might (for some reason or other) occur within the error handling routine itself, so a program crash can be prevented?

Suppose I have the following Routine;


Code:
Public Function ReadSomeValue(intSomeValue as Integer)

On Error GoTo ErrorHandle1

intSomeValue = intLocationA_Data

Exit Function

ErrorHandle1:
intLocationA_Data = intLocationZ_Data ' Assuming intLocation_Z had corrupt or invalid data for some unknown reason
Resume next

End Function

Error During .EXE, But Not Inside IDE
I receive a runtime error 5 in my EXE but when i run it inside VB everything works fine. Whats going wrong?

How To Access File System Inside Access Queries
Hey Folks!!!

Does anyone know the technique of accessing file system using access queries.

Guys This is imprtant. Please help me!!!

Error Handling Inside Loop
I want to handle all error that accrue inside the loop but I can handle only one error

 

Edited by - aman_04_11_2007 on 6/15/2008 10:22:48 PM

Network I/O Error Or System Error Device Error
 I am getting an Error. I believe it is a NetworkError DeviceError or SystemError
 I was wondering if someone knows how to trap these errors in VBA.
 There is a pressing need for a solution.
  Any help would be appreciated.
  Thanks Sirron

Excel XmlHTTP Object Error Message - System/runtime Error
Hi guys,

Thanks for reading my thread. This is a VBA problem for something in Microsoft Excel - I wasnt sure if I should really be posting this problem on this kind of forum, so apologies if I am in completely the wrong place! I have looked on google and used the search feature and found very limited information that is useful to me.

I am having trouble with a very simple few lines of code in a macro. The code looks like this:



Code:


Function startmarketIDs()

Dim targeturl, writerow, readrow, textmass, xmlHTTP

targeturl = "http://lite.betfair.com/Events.do?s=00010913z"

Set xmlHTTP = CreateObject("Microsoft.xmlHTTP")

xmlHTTP.Open "GET", targeturl, False
xmlHTTP.send

MsgBox xmlHTTP.StatusText
textmass = xmlHTTP.responsetext

MsgBox textmass

End Function



My problem occurs at the line "textmass = xmlHTTP.responsetext"

The responsetext command is obviously causing problems because if I remove it, the code executes without error and the "xmlHTTP.statustext" says "OK". With the responsetext command left in, the code generates the following error:

Run-time error '-1072896658 (c00ce56e)':

System Error: -1072896658.

If I change the targeturl to www.betfair.com, the code executes fine and I get a message box (as desired) with the source code of the website displayed. There is therefore something about the url or the way in which I am using the xmlHTTP object that is causing the issue, I wondered if someone would mind inspecting my code and perhaps pointing me in the right direction?

I am not an expert in VBA programming, and I feel a little out-of-my-depth using the xmlHTTP object, but Id really like to get hold of the source code of the targeturl so that I can parse it for some data that I require. Thanks to anyone who can offer me any assistance,

Regards,

Porky / Paul

Runtime Error 462 - OLE Word Inside Excel
Why does this program not work a second time.

If I run this a second time I get a Run Time Error 462
"The remote server machine does not exist or is unavailable"

If I reset the program and run it again, it works fine, no matter how many times I run it.

'-------------------------------------------------------------
' File : Fred.xlt
' Module :
' DateTime : 7/26/2002
' Author : Ron Shubert
' Purpose :
' This program is activated from an Excel workook. It opens a Word template "Barney.dot",
' then sets the Document Properties "Title" to a value.
' Then it copies the entire Word document and inserts it into the worksheet as an icon.
Option Explicit

Sub newword()
'++++++++DECLARATIONS+++++++++++++++
Dim WordApp As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Dim ProjName As String 'Project Name
Dim DocProp As Object
'++++++++CREATE A WORD APPLICATION AND OPENS A WORD TEMPLATE+++++++++
Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open("c:WINDOWSApplication DataMicrosoftTemplatesBarney.dot")
'++++++++ASSIGN A STRING TO WORD'S DOCUMENT PROPERTIES+++++++++++
ProjName = "Project Name" 'I usually get this string from the worksheet.
Set DocProp = ActiveDocument.BuiltinDocumentProperties
DocProp("Title") = ProjName
'++++++++ SELECTS THE WHOLE STORY - INSERTS INTO EXCEL ++++++++++
Set WordRange = WordDoc.Goto(What:=wdGoToBookmark, Name:="MM")
WordRange.WholeStory
WordRange.Copy
wordinsert ' call sub routine "wordinsert" listed below.
'++++++++ QUIT WORD AND RELEASE ALL VARIABLES ++++++++++
WordApp.Quit savechanges:=wdDoNotSaveChanges
Set WordRange = Nothing
Set DocProp = Nothing
Set WordDoc = Nothing
Set WordApp = Nothing
End Sub


Sub wordinsert()
Dim mDate As Date
Dim mTime As Date
mDate = Date
mTime = Time
Worksheets("Total").Activate 'name of worksheet in workbook
ActiveWorkbook.Worksheets("Total").OLEObjects.Add _
Filename:=("c:WINDOWSApplication DataMicrosoftTemplatesBarney.dot"), DisplayAsIcon:=True, _
IconFileName:=("C:WINDOWSApplication DataMicrosoftTemplatesfred.ico"), IconIndex:=0, _
IconLabel:=(mDate & " " & mTime), Left:=25, Top:=150, _
Width:=25, Height:=25
End Sub

Any help you could offer would be greatly appriciated.

Thank You,


Ron Shubert

Handle Errors Inside Error Handler
Hi All
Good Day To You

Small Question.

How to handle Errors That occurs in the Error Handler?

For an Example, I have a situation where I have to Rollback DB transactions if an error occurs. But the problem is , when I use DBConn.RollbackTrans , it triggers an Error Sometimes (DBConn is an open ADODB Connection)
This second error causes the Application to Exit

I want to capture the second Error an continue, so far , I have not been successful.
This the Current Error Handler


Code:
cmdExportDB_Click_Error:

'On Error GoTo 0
MsgBox "Error " & Err.Number & vbCrLf & _
"(" & Err.Description & ") " & vbCrLf & "Please check your Export Options and Database Constraints"



If isTXNStarted = True Then
On Error GoTo DBERR
DBConn.RollbackTrans

DBERR: isTXNStarted = False
End If
If isFileOpen = True Then
Close #FileNum
isFileOpen = False
End If



Can somebody help me over this?

Thanks In Advance

Error Modifying Labels Inside Of Reports
I am attempting to change the text of a label in a VB6 report. Here's an example:

Private Sub DataReport_Initialize()

Label1.Text = "test"

End Sub

When I run the report however I get a Run-Time Error 424: Object Required. I've tried using rptCheckIn.Label1.text with the same results. Label1 doesn't show up in the list of objects for the report. Also, when I type in "Label1." I don't get the context menu poping up like you normally do with objects. Is there some addin or component I'm missing?

App.LogEvent Error -2147024882 (System Error &&H80004005 (-2147467259).
Hi all,

I knocked up a project and decided to use App.LogEvent to log errors, so I set up the event log:

CODE    Call App.StartLogging(sUnusedFileName, vbLogToNT)

Error: Statement Invalid Inside Type Block
Hey guys I have a problem, I have the code
VB Code:
Private blnQuit As BooleanDim iFileNo As StringDim mystring As StringDim sFileText As StringPrivate Declare Function GetTickCount& Lib "kernel32" ()


And When I run the program I get the error Statment invalid inside type block.

What does that mean???

Thanks

System Error &H80004005(-2147467259). Unspecified Error
The subject is the error. I'm going to look it up now. But this happened when I cycle through the Recordset object for a particular form connecting to the specifi database table.

System Error &H80004005 (-2147467259). Unspecified Error
System Error &H80004005 (-2147467259). Unspecified error ...?

Why Would This Happen
Hi all

I have a strange problem and can't seem to figure it out, i have a Vsflexgrid on my form "grdjournal" in col 2 i store currency, i then use the following code to add up the figures and display it in a label "lblTotal".


Code:
Private Sub cmdSubTotal_Click()
lblTotal.Visible = True
grdJournal.SubtotalPosition = flexSTBelow
grdJournal.Subtotal flexSTSum, -1, 2, "$", vbRed
lblTotal.Caption = Format(grdJournal.TextMatrix(50, 2), "Currency")
End Sub
But for some reason it is rounding the total to the nearest whole number, for instance, in col 2

$10,50
$10,50
$10,50

will display $31,00 instead of $31,50.

Please can someone advise me as to what i might be doing wrong.

Many thanks

Why Would This Happen
Hi

I am using an access database, and on my form i have two command buttons, one command button copies data from a Table called "Sales1" into a table called "SalesHist" the other command button then deletes the same data from "Sales1", the part that is confusing me is that the queries work provided i quit my app between buttons. So if i use command1 to copy the data it works fine, if i quit the app and then use command2 the correct records are deleted and all is fine. But if i click on command1 and then 10 seconds later command2 the records are deleted from both tables, and there are'nt many records it does the same with 10 or 2.


Code:
Private Sub cmdCustomers_Click()
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim sSQL As String
Dim tmpSQL As String

Set MyConn = New ADODB.Connection
Set MyRecSet = New ADODB.Recordset
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"
MyConn.Open
tmpSQL = "INSERT INTO SalesHist (Tbl_No, Qty, Description, Price, Dates) SELECT Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & lblTabNo.Caption & "'"
MyConn.Execute tmpSQL
MyConn.Close
End Sub



Code:
Private Sub cmdTender_Click(index As Integer)
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim sSQL As String
Set MyConn = New ADODB.Connection
Set MyRecSet = New ADODB.Recordset
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"
MyConn.Open
sSQL = "DELETE Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & frmMain.lblTabNo.Caption & "'"
MyRecSet.Open sSQL, MyConn, adOpenStatic, adLockReadOnly
Unload Me
End Sub

Many thanks

Why Does This Happen?
Hi all,

I'm having a minor problem with my application. What I have is a progress bar that shows the progress of the current sub being performed. Now, this sub takes 15+ seconds to complete (depending on the listcount in the listbox). It is interacting with a third party app, which is why it takes so long.
Anyway, it works all fine and dandy...until you click on another application. When you try to switch to a new application or anything of the nature, the application temporarily 'locks up' until the sub is finished running. I've attached a picture of what it looks like when it is 'locked up'. The progress bar stops moving and if I was to go back and click on the app again, it would turn all white and say (Not Responding) in the title bar until the sub was finished. Once it finishes, everything goes back to normal. I'm thinking it's some sort of refresh/redraw problem, but I'm not sure. I have a Me.Refresh at the end of each 'Next x' in the sub (The sub runs a full time for each item in the list box) and in my form loud I have a Me.AutoRedraw=True but neither of those work.
Any ideas?

What Happen Here?
Hi, i have a public sub in a module that i call.

when i put this:
call seteatoolbar(1) it doesn't work

when i put this:

msgbox "wait"
call seteatoolbar(1) it work correctly

when i put a message box before or after the call it works right.

do you have an idea of what's happening?

Anybody Else Had This Happen Lately
I'm having some serious difficulties in running Visual Studio/VB98. While compiling and running my project. I get the dreaded "Microsoft has experienced a problem and will now be terminating yada yada yada". This has increasingly become a problem as I work from home and can't find my Visual Studio discs.. Maybe I should have just upgraded to XP Pro and installed .Net. Anyone else that has experienced difficulties feel free to reply and help me correct this problem.
Thanks
Larson

Never Seen This Happen Before ????
Hi there

We have a piece of software that's used by about 700 customers running on over 1500 machines. One particular machine of a 3 workstation network behaves in a strange way to all the others.

Its a pentium 4 running Windows XP with all the latest updates.

Here's an example of the problem

A$ = VAL("3")

but when you look in A$, you get something like 2.99999999997

This happens for nearly every whole number, I can understand if the val operation was performed on a floating point, but not on an integer.

The other machines on their network run fine and they all run the same EXE of a file server.

Appart from replacing the machine, I have no idea on what to do.
Anyone come across this problem?

Cheers
Simon Luce

Why Would This Happen
Hi all

I have a strange problem and can't seem to figure it out, i have a Vsflexgrid on my form "grdjournal" in col 2 i store currency, i then use the following code to add up the figures and display it in a label "lblTotal".



VB Code:
Private Sub cmdSubTotal_Click()    lblTotal.Visible = True    grdJournal.SubtotalPosition = flexSTBelow    grdJournal.Subtotal flexSTSum, -1, 2, "$", vbRed    lblTotal.Caption = Format(grdJournal.TextMatrix(50, 2), "Currency")End Sub


But for some reason it is rounding the total to the nearest whole number, for instance, in col 2

$10,50
$10,50
$10,50

will display $31,00 instead of $31,50.

Please can someone advise me as to what i might be doing wrong.

Many thanks

Why Would This Happen?
Hi

I am using an access database, and on my form i have two command buttons, one command button copies data from a Table called "Sales1" into a table called "SalesHist" the other command button then deletes the same data from "Sales1", the part that is confusing me is that the queries work provided i quit my app between buttons. So if i use command1 to copy the data it works fine, if i quit the app and then use command2 the correct records are deleted and all is fine. But if i click on command1 and then 10 seconds later command2 the records are deleted from both tables, and there are'nt many records it does the same with 10 or 2.



VB Code:
Private Sub cmdCustomers_Click()        Dim MyConn As ADODB.Connection        Dim MyRecSet As ADODB.Recordset        Dim sSQL As String        Dim tmpSQL As String         Set MyConn = New ADODB.Connection        Set MyRecSet = New ADODB.Recordset        MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"            MyConn.Open            tmpSQL = "INSERT INTO SalesHist (Tbl_No, Qty, Description, Price, Dates) SELECT Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & lblTabNo.Caption & "'"            MyConn.Execute tmpSQL            MyConn.CloseEnd Sub



VB Code:
Private Sub cmdTender_Click(index As Integer)        Dim MyConn As ADODB.Connection        Dim MyRecSet As ADODB.Recordset        Dim sSQL As String            Set MyConn = New ADODB.Connection            Set MyRecSet = New ADODB.Recordset                MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:pospos.mdb;"                MyConn.Open                sSQL = "DELETE Tbl_No, Qty, Description, Price, Dates FROM Sales1 WHERE Tbl_No = '" & frmMain.lblTabNo.Caption & "'"                MyConn.Execute sSQL                    Unload MeEnd Sub


Many thanks

Why Does This Happen?
hey guys, i ahve another question:

Option Explicit
Dim x As Long

Private Sub Command1_Click() ....................1
On Error GoTo aa .....................................2
If Form1.Name = "Form1" Then ....................3
x = CDbl(txt.Text) ...............................4
Print "ss" ...........................................5
aa: .................................................6
Call MsgBox("sdfsd") ............................7
Resume Next .................................. 8
End If
End Sub

ok now i will explain what's going on: First in the txt i have a string lateral not numeric, so when i press i get to line 4, an error occures and i get to line 6, msgbox is called then back to line 3, i get to 4 then error then to 6 then back to 5, ss is printed then i get to 6 and a msgbox....so i get 3 times the msgbox.
But in case txt is numeric: i press, reach 4,5,6 and get a msgbox, then resume to where? In this case i am getting the msgbox twice, why? where is the aa: resuming to.
thanks.

Does This Happen To You Too?
try this out. open a new project, maximise the form and put a cmd button or any other ctl right at the bottom of the form. then run it and maximise the form.... what do u see?

Can This Happen??
Can you change someones homepage(default location a browser goes to) without them knowing about it?? Kinda like when you are prompted to set your home page as someones web site except without prompting you just set it? Can that actually be done?? If so How? .......if you tell me how maybe i will tell you why i want to know ......i will not do anything bad with it...I promise

Why Does This Happen?
Put this line of code into a form and tell me what you get. what i get is 6.4583333, but when i do this on a calculator i get .0064583333. Why does this happen, how do i fix this?

lblpaymentout = 7.75 / (12 * 100)

How Will It Happen?
how to add icons in menu bars? 14

Why Did This Happen?
I did my first deployment via CD today. I went to a client where I had already installed a version of my program via floppy disk.

I popped the CD in the tray, hit setup.exe, and a message appeared saying that some files were missing, and if I wanted to complete setup then I would need to re-boot the computer. I did, and when I re-started setup.exe, I got a series of messages saying that I was trying to install older dll files than what was already on the computer. It gave me the option of keeping these older files, and the setup proceesed okay.

But why did all this happen in the first place? Nothing like this happened with the floppy disks.

Anybody Have This Happen To Them!!!
Last week for no reason that I can figure out, the ability of my IE 6.0 to View the source of any webpage was disabled! How can I fix that?

Why Does His Happen?!
I get a type mismatch error when this occurs:

Private Sub Form_Load()
bActiveSession = False
hOpen = 0
hConnection = 0
optBin.Value = 1
dwType = FTP_TRANSFER_TYPE_BINARY
Dim imgI As ListImage
Set imgI = ImageList1.ListImages.Add(, "open", LoadPicture("open.bmp"))
Set imgI = ImageList1.ListImages.Add(, "closed", LoadPicture("closed.bmp"))
Set imgI = ImageList1.ListImages.Add(, "leaf", LoadPicture("leaf.bmp"))
Set imgI = ImageList1.ListImages.Add(, "root", LoadPicture("root.bmp"))
TreeView1.ImageList = ImageList1
TreeView1.Style = tvwTreelinesPictureText
EnableUI (False)
End Sub


The bolded line is where the error occurs. The thing is, I don't understand it cuz the image is what it is meant to be, and the code and images work somewhere else!!! so why not here? the image is in the right place and is right type etc, but i get this error>?

pls help!

Bob

Why Does This Happen
Hi, when ppl type in a text box I use the Replace command to change the < into another symbol.

However, when it does this (Im using OnChange) the sursor jumps to the begining of the text box (Tex1)

Why does it do this, and how do I stop it?

Why Does This Happen?
This code. Thanks to geoff_xrx and bloodeye!
It goes to the page url and lists the url until the list box has run out of space.
What it's meant to do is go to the url, look to see if the words specified are there if so list the url it is at!

Option Compare Text
Dim site(2) As String
Dim words(2) As String 'just a few words....you'll have to add them all
Dim siteNum As Integer

Private Sub Form_Load()
Web1.Navigate "http://www.riu.com.au/gold/secure"
site(0) = "http://www.riu.com.au/gold/secure"
words(0) = "Resource Service Group"
siteNum = 0
End Sub
Private Sub nextSite()
Web1.Navigate site(siteNum)
Do Until Web1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
siteNum = siteNum + 1
End Sub

Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim itext As String
Dim x As Integer
Me.Caption = "site:" & siteNum & " " & URL
If (pDisp Is Web1.object) Then
itext = Web1.Document.documentElement.innerText
For x = 0 To UBound(words)
If InStr(itext, words(x)) < 0 Then
List1.AddItem Web1.LocationURL
nextSite
Exit Sub
End If
Next x
nextSite
End If
End Sub

Would There Happen To Be...
By any chance, would there happen to be an API function available
that would allow me to terminate a process by name (as it appears
in the task manager list) ?

Can This Happen If Yes How?
how can i disable the date displayed in the taskbar of the explorer using a Visual basic code

Why Does This Happen
i my html editor i want to cover up a richtextbox while the html code in it is being colorized, so i have a picturebox over it and when i call the colorize function it sets it as visible and then does all the colorizing and then sets it as invisible. but the picturebox never shows unless i trace through the code. i guess it's just going thru so much code so fast that it never shows, but even when it takes about a minute to color the html it still doesn't. any ideas? maybe some way of pauing after setting it as visible, but i can't use a timer i don't think cause it's in a module, not on the forum. or are there ways of preventing people from clicking in or typing in the rtf box while it's doing this? i can't set it as not visible or as locked or not enabled cause i get errors with those. please help...

What Will Happen With VB?
What is the future like for VB, with the creation of VB.Net. Should I keep on learning VB or should I change to a new language.

What Does It Happen ?
Please show me where I wrong ?

When I want to use RichTextBox control, I must have richtx32.ocx ?

And richtx32.ocx can work if Riched32.dll or riched20.dll has been registered properly ?

Richtextbox control behavior does not depend on platform (win98 and win2k) if we use the same richtx32.ocx and riched20.dll?

If it correct then why I can not set background text color in Windows98 but I can in Windows2000.

(I got a sample at www.vbaccelarator.com)
Code is as follows :


public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hWnd as Long, byval wMsg as Long, byval wParam as Long, byval lParam as Long) as Long
public Type CHARFORMAT2
cbSize as Integer '2
wPad1 as Integer '4
dwMask as Long '8
dwEffects as Long '12
yHeight as Long '16
yOffset as Long '20
crTextColor as Long '24
bCharSet as Byte '25
bPitchAndFamily as Byte '26
szFaceName(0 to LF_FACESIZE - 1) as Byte ' 58
wPad2 as Integer ' 60

' Additional stuff supported by RICHEDIT20
wWeight as Integer ' /* Font weight (LOGFONT value) */
sSpacing as Integer ' /* Amount to space between letters */
crBackColor as Long ' /* Background color */
lLCID as Long ' /* Locale ID */
dwReserved as Long ' /* Reserved. Must be 0 */
sStyle as Integer ' /* Style handle */
wKerning as Integer ' /* Twip size above which to kern char pair*/
bUnderlineType as Byte ' /* Underline type */
bAnimation as Byte ' /* Animated text like marching ants */
bRevAuthor as Byte ' /* Revision author index */
bReserved1 as Byte
End Type

dim charf as CHARFORMAT2

private Sub mnuFontBackColour_Click()
Dim ret as Long
on error GoTo error_cancel
charf.dwMask = CFM_BACKCOLOR
charf.cbSize = LenB(charf) 'setup the size of the character format
charf.crBackColor = vbRed 'value of RGB
ret = SendMessageLong(rtfText1.hWnd, EM_SETCHARFORMAT, SCF_SELECTION, VarPtr(charf))
Exit Sub
error_cancel:
''MsgBox "cancel "
End Sub





Or could you show me any URL about that ?

Thank you very much.

Why Do These Things Happen To Me
I have been developing an exe for some time it has been built and used for months no problems at all I have been working on it all week and running it all fine. Today I have made amendments and run it no problems, BUT all of a sudden when I try and run it or compile it it has decided not to recognise any of my public enumerations and is stating :

'Compile Error: Constant expression required'

AAArrrrgghh whats this all about

How Can I Make This To Happen
i want: when my project loades that if the database is locked (in use by a other copie of the project) that their is a message like "sorry database is in use, try again in a few minutes" and that the project will end itselves

the code

form_load()
if blabla.mdb=locked then
msgbox "sorry..."
end.
endif
end sub

isnt working

What Happen Of Call Sub ?
Code:
Public Sub LockTheForm(ByRef xx As Form)
Dim otext As TextBox
For Each otext In xx
otext.Locked = True
Next
End Sub


Code:
Private Sub Form_Load()
LockTheForm (Me)
End Sub

sub is in module and call form1 in mdiform it said

error 13 type missmatch

About VUMeter, What Happen? Help~~~~~!
Following source code to get the real-time volume of output or input channel, it say "cannot get meter control" error in WinXP, but run it under Win98 no any problem, why? Help me~~~~!!


Code:
Dim hmixer As Long ' mixer handle
Dim inputVolCtrl As MIXERCONTROL ' waveout volume control
Dim outputVolCtrl As MIXERCONTROL ' microphone volume control

Edit: Deleted rest of code

Logging In Before Anything Else Can Happen
Hi,

I am trying create a menu driven application. In order to do this, I want the user to be prompted to login to the application. If the user cannot login properly, I don't want them to be able to use the application. In other words, how can I protect the application from until a proper login is attained?

Thanks,
Jeff

I Knew It Would Happen...
You start programming in C++ for a couple of months and you forget how to do anything in VB. Can anyone help?

I am trying to use an array of buttons for a simple calculator demo. However, when I try to access the "click" procedure for each, it uses only one sub that is named

Private Sub Command1_Click(Index as Integer)

How do I make it so that when I click on Command1(3) it prints a 3.?

The button array thing is messing with my mind's concept of C++ arrays.

Thanks,
E.D.1870

Weird VB Bug! Does This Happen To You?
I've observed the following strange behavior in both VB5 and VB6 - seems like an IDE bug.

Try this (a multi-line statement with a "+" in the 2nd line):

Code:
x = _
a + b


Go back to the first line, remove the _, and the "+" in the 2nd line disappears!

Does that happen to you? Anyone seen this before? Weird!

Copyright © 2005-08 www.BigResource.com, All rights reserved