Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 22097 articles
Browse latest View live

Urgent Help: Compile error: Permission denied while making dll

$
0
0
Hi Team,

It is my first post and looking for some solution on the error which I am getting while generating DLL on VB6 ActiveXDLL project. Following program is just an snippet of what I am using:

Sub Pro()
Dim dlg As DialogObjects.ChooseFile
Set dlg = New DialogObjects.ChooseFile
dlg.Show
End Sub

This is an activex DLL project, so when I try to make DLL, I get Compile error: Permission denied error. Checked all permission settings of DLL, folders, registry (regedit) / ownership but still I am not able to figure out the issue.
Name:  error.jpg
Views: 31
Size:  15.3 KB
Attached Images
 

Stoping an exe.

$
0
0
Is there any way to stop an exe. if it does not execute ..

keeping form with webBrowser large enough to avoid scroll bars

$
0
0
I have an app that calls a WebBrowser attached to its own form. The WebBrowser is a credit card authorization function and it links direct with their server. I want my form to always be big enough to avoid scroll bars. In the form load I have

WebBrowser.Height = Me.Height
WebBrowser.Width = Me.Width

and have made the form the right size for their normal entry process. But if the user makes any mistakes like invalid credit card number or bad expiration date, their web sends back extra messages which takes up more space so the WebBrowser automatically adds a vertical scroll bar. I want to make my form automatically increase its size based on the room needed by the WebBrowser to avoid scroll bars. I don't seem to find any event where I could add code to enlarge the form, nor do I see any properties I could set. Any ideas?

Custom Font

$
0
0
What steps do I need to take to make my own custom fonts. I have the bitmap images of all the characters

splitting file to custom mb size , detect file size while spitting

$
0
0
assuming there is a file in appath can be a video avi file or any just for this example say there is a file and how do i split in into custom mb size how do i detect the size when i open a file as read or somehow dun no just asking if u no let me no:p

How to get the data from MS Access table to Combo box?

$
0
0
Hi,

I have a Dropdown Combo box (Combo1) on my VB6 Form. How can I get the data from MS Access Table called "ItemsList_tbl" to Combo1? What is the code, please?

Regards.

cannot running exe aplication in client from source that has been compile in other PC

$
0
0
dear master,

i have compile my source in VB6, with msado15.dll as reference, but when i running my exe that i had been copied in client it can not run. there is error 430 "class does not support automation or does not supprt expected interface". i've been copy msado15.dll and register it but it still error. but, when i am done installing vb6 in that client n i compile my source becoming exe, there is no error n my aplication run well. what should i do, because i don't want to install vb6 in each client in my company.

please help me master, i confuse n almost frustated

sorry with my english

question saving file from windows to linux directory

$
0
0
I know I can write file like so to windows disk like so

Open "c:\My Documents\sample.html" For Output As # 2

I would like to know how to write to linux server directory from windows using windows vb6 application?

Connect to SQL Server 2008 R2 using an ODBC DSN

$
0
0
Hi,

My application connects to a relational database server through an ODBC DSN, using ADODB version 2.8. This works fine for a local SQL Server 2005, a local MySQL Server 5.1, and a remote MySQL Server 5.1. However, when I try to access a remote SQL Server 2008 R2 server, using the SQL Server Native Client 10.0 driver, it doesn't work.

I use the following code:

Dim oBDConnection As New ADODB.Connection
Set oBDConnection = New ADODB.Connection
oBDConnection.Open "MyDSN"


The DSN has all the settings to access the server, including the username and password for SQL Server authentication, and works fine when tested with e.g. Excel.

The error message I get is "[Microsoft][SQL Server Native Client 10.0]TCP Provider: No such host is known". When looking at the properties of the connection in debug-mode it becomes clear that the settings from the DSN are not picked up. All of them are empty.

When I create a connection string with all the parameters in code, I can connect to the database without problems. So, I know that VB6 is capable to connect to SQL Server 2008 R2, but the problem with that approach is that it would require me to create an interface for the user to enter the connection parameters, effectively recreating the ODBC Administrator, which doens't make sense.

After searching the web for hours, I somewhat understand that this may be related to SQL Server 2008 using another dll to connect to the database (SQLNCLI10.dll), but can't figure out how I can fix the problem.

Anyone a suggestion?

Thanks in advance,
Erwin

Email

$
0
0
Hi

Can we send email using vb6 & attaching file.

Thanks

Screen Resolution Problem VB 6

$
0
0
Hello All,

I developed my Application in 1366 x 768.
But my client's resolution was 1024 x 768.
so the objects are lost. i use this codes..
Code:


Private sub Form1_Load()

Form1.ScaleHeight = VB.Screen.Height / VB.Screen.TwipsPerPixelY
Form1.ScaleWidth = VB.Screen.Width / VB.Screen.TwipsPerPixelX

End sub

But it was not working....
How can i do this..
Please Help...

Thank You

[RESOLVED] Like operator with wildcards in String Search

$
0
0
Ever felt like a beginner? Well, I KNOW this is so simple, can't see it.


I want to search in a string to find something like this:

str = "Now is the time for all good men to come to the aid of their party."

I want to return "time for all good", but I only know "time" and "good" (IOW, I want to find the complete string starting with "time" and ending with "good"

I can do it this way:
Code:

Option Explicit
Private Sub Command1_Click()
Dim myText As String
Dim searchString1 As String
Dim searchString2 As String
Dim foundString As String
Dim x As Integer
Dim y As Integer
myText = "Now is the time for all good men to come to the aid of their party."
searchString1 = "time"
searchString2 = "good"
x = InStr(1, myText, searchString1)
y = InStr(1, myText, searchString2)
If x > 0 And y > 0 Then
    foundString = Mid(myText, x, Len(searchString1) + y - x - Len(searchString1) + Len(searchString2))
    MsgBox foundString
End If
End Sub

But thought the Like Operator would offer a simpler solution.
I tried (and failed):

Code:

dim str as String
dim sStr as string
str = "Now is the time for all good men to come to the aid of their party."
sStr = "time*good"
if str Like sStr then
  'found it
else
  'not found
end if

[RESOLVED] How to print listview item on more than one line?

$
0
0
Hi guys, so I have this code to print listview items on multiple pages:

Code:

Public Sub PrintListView(ByVal lvw As ListView)
   
    ' Use 1 inch margins.
    Const TOP_MARGIN = 1440
    Const LEFT_MARGIN = 1440
    Const COL_MARGIN = 240
   
    Dim bottom_margin As Single
    Dim xmax As Single
    Dim num_cols As Integer
    Dim column_header As ColumnHeader
    Dim list_item As ListItem
    Dim i As Integer
    Dim num_subitems As Integer
    Dim col_wid() As Single
    Dim X As Single
    Dim Y As Single
    Dim line_hgt As Single

    Dim need_top As Boolean
    Dim start_new_page As Boolean

    bottom_margin = Printer.ScaleTop + _
        Printer.ScaleHeight - TOP_MARGIN

    ' Get column widths.
    num_cols = lvw.ColumnHeaders.Count
    num_subitems = num_cols - 1
    ReDim col_wid(1 To num_cols)

    ' Check the column headers.
    For i = 1 To num_cols
        col_wid(i) = _
            Printer.TextWidth(lvw.ColumnHeaders(i).Text)
    Next i

    ' Check the items.
    num_subitems = num_cols - 1
    For Each list_item In lvw.ListItems
        ' Check the item.
        If col_wid(1) < Printer.TextWidth(list_item.Text) _
            Then _
          'col_wid(1) = Printer.TextWidth(list_item.Text)
          col_wid(1) = 5000
        End If

        ' Check the subitems.
        For i = 1 To num_subitems
            If col_wid(i + 1) < _
                Printer.TextWidth(list_item.SubItems(i)) _
                Then
                If i = 1 Then
                    col_wid(i + 1) = Printer.TextWidth(list_item.SubItems(i))
                Else
                    col_wid(i + 1) = 5000
                End If

            End If
        Next i
    Next list_item

    ' Add a column margin.
    xmax = LEFT_MARGIN
    For i = 1 To num_cols
        col_wid(i) = col_wid(i) + COL_MARGIN
        xmax = xmax + col_wid(i)
    Next i

    ' Get a line's height.
    line_hgt = Printer.TextHeight("X")

    ' Print the pages.
    need_top = True        ' Start printing a new page.
    start_new_page = False  ' Use the NewPage method.
    For Each list_item In lvw.ListItems
        ' See if we need to print the top.
        If need_top Then
            need_top = False

            ' Start a new page if necessary.
            If start_new_page Then Printer.NewPage
            start_new_page = False

            ' Print the column headers.
            Printer.CurrentY = TOP_MARGIN + line_hgt / 2
            X = LEFT_MARGIN + COL_MARGIN / 2
            For i = 1 To num_cols
                Printer.CurrentX = X
                Printer.Print FittedText( _
                    lvw.ColumnHeaders(i).Text, col_wid(i));
                X = X + col_wid(i)
            Next i
            Printer.Print

            Y = Printer.CurrentY + line_hgt / 2
            Printer.Line (LEFT_MARGIN, Y)-(xmax, Y)
            Y = Y + line_hgt / 2
        End If

        ' Print the next item.
        ' Print the item.
        X = LEFT_MARGIN + COL_MARGIN / 2
        Printer.CurrentX = X
        Printer.CurrentY = Y
        Printer.Print FittedText(list_item.Text, _
            col_wid(1));
        X = X + col_wid(1)

        ' Print the subitems.
        For i = 1 To num_subitems
            Printer.CurrentX = X
            Printer.Print FittedText( _
                list_item.SubItems(i), col_wid(i + 1));
            X = X + col_wid(i + 1)
        Next i
        Y = Y + line_hgt * 1.5

        ' See if we've reached the bottom of the page.
        If Y >= bottom_margin Then
            ' We've reached the bottom.
            ' Draw lines around it all.
            Printer.Line (LEFT_MARGIN, TOP_MARGIN)-(xmax, _
                Y), , B

            X = LEFT_MARGIN
            For i = 1 To num_cols - 1
                X = X + col_wid(i)
                Printer.Line (X, TOP_MARGIN)-(X, Y)
            Next i

            ' Start a new page for the next item.
            need_top = True
            start_new_page = True
        End If
    Next list_item

    ' See if we finished the last page.
    If Not start_new_page Then
        ' We did not finish the last page.
        ' Draw lines around it all.
        Printer.Line (LEFT_MARGIN, TOP_MARGIN)-(xmax, Y), , _
            B

        X = LEFT_MARGIN
        For i = 1 To num_cols - 1
            X = X + col_wid(i)
            Printer.Line (X, TOP_MARGIN)-(X, Y)
        Next i
    End If
   
End Sub

' Return as much text as will fit in this width.
Private Function FittedText(ByVal txt As String, ByVal wid _
    As Single) As String
    Do While Printer.TextWidth(txt) > wid
        txt = Left$(txt, Len(txt) - 1)
    Loop
    FittedText = txt
End Function

My problem is that my listview items are quite long, so I'd like to print them on as many lines as it takes
to see all the text, and have its subitems next to the first line. For now, I'm using the FittedText function,
because I don't know how to do that. Any ideas?

Thank You.

[RESOLVED] Disable all controls on a form.

$
0
0
How can I disable / enable all controls on a form at runtime?

Calling a C++ Dll from VB6

$
0
0
Following the article Step-by-Step-Calling-C-DLLs-from-VC-and-VB-Part on Code Project I have an interesting problem.

I created the DLL2.dll using Visual Studio 5 and 2008 on a Windows 7 machine. On an XP I created a VB6 test project to call the DLL. All Fine.

It works on the Windows 7 machine just great, but when executed on a Windows XP or Windows 8 it tells me it can't find the DLL, even though it is in the same folder as the VB6 program?

Any help would be appreciated.

Windows 8.1 hates the variables Date & Time!!

$
0
0
I am using the variables Date and Time for a project of mine. I am looking to have them redone, so that it is easier to get past this type of problem I'm having. Also that there won't be an easy resolve for this problem, seeing that only those were the easiest option for me to use, in the programming of mine project...

Could someone please help me to come to a conclusion for this problem of mine and then to find out how to get around this, too. That would be great...

!! Thanks in advance !!

vbRichClient / Form-Engine / Tutorial / Forms and the cfPanelLayout-Helper

$
0
0
Hi

That example does not work if decimal symbol is , (comma)
Example work only if I change decimal symbol to . (point)

Code:

Private Sub Form_ResizeWithDimensions(ByVal NewWidth As Long, ByVal NewHeight As Long)
  'only this line here is needed, to ensure proper dynamic placment of all the (now hidden) Panels, which make up our Layout
 
  'The line that causes the error, Run-time error 5, Invalid procedure call or argument
  View.CurLayout.ResizeOnParent 0, 0, NewWidth, NewHeight
End Sub


Is that forum right place to post error report of Olaf's framework?

A Listbox for millions items and transparent background

$
0
0
There is a time that you want a user control for an advanced list.
So this is my glist

You may show or not a vertical scroll bar
You can add as many item as you wish
Scroll bar move carret in a special way so it overcames the limit of 32768 items..
Transparency is simple enough!

(a small change in form...not in glist)
Attached Files

[RESOLVED] textbox to textbox

$
0
0
I have text1 with multi line = true , it is filled with text .. I need to show any line or any word from any line into another textbox text2 .. need help

Text1

Learn to build a web service and an application
that consumes your data that is stored in the cloud.

and need to show in Text2

consumes

in 2nd line and on 2nd place

or whole line

Learn to build a web service and an application

OCX Manager

$
0
0
VB6.

I want to know what ocx files are on my computer and the file details i.e. name, location, size, etc. I want to know the registration status. I want to know what are the properties and methods. What software will answer my concerns? It would be great if the software put the information into some form of searchable database.

There exists one package I know of – Aivosto ActiveXplorer v4. Are there others that you would suggest?
http://www.aivosto.com/activexplorer.html


Thanks for your suggestions.
Viewing all 22097 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>