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

OpenConnection Fails on Command Line Works in IDE

$
0
0
Greetings,

I have a vb 6.0 "desktop" application that has multiple components. One of those components is a dll that gets called to perform various database functions. These functions include making the database connection, submitting SQL queries and returning results. It all works fine when it's run in the VB 6.0 IDE. However, when I try to run it on the command prompt, it errors out. The error occurs at this line:

Set Current_Database = Current_Workspace.OpenConnection("DOCUGEN Database", dbDriverNoPrompt, False, Connect_String)

where we set the database connection using the OpenConnection method of the Workspace. The Current_Database is a DAO connection object. This error is not captured by the program, the On Error statement seems to have no effect, the program just crashes. I am able to get this information from the Application Verifier logs:

<avrf:logfile xmlns:avrf="Application Verifier">
<avrf:logSession Version="2" PID="4432" TimeStarted="2017-05-19 : 08:14:07">
<avrf:logEntry Severity="Error" StopCode="0xE100" LayerName="Networking" Time="2017-05-19 : 08:14:08">
<avrf:message>Illegal networking API called from DllMain</avrf:message>
<avrf:parameter1>74a11d10 - Networking function being called from DllMain</avrf:parameter1>
<avrf:parameter2>8348fda - Name of Dll making invalid call if not NULL</avrf:parameter2>
<avrf:parameter3>0 - Not used</avrf:parameter3>
<avrf:parameter4>0 - Not used</avrf:parameter4>-<avrf:stackTrace>
<avrf:trace>vfnet!+74a13607 ( @ 0)</avrf:trace>
<avrf:trace>OraOCIICUS11!ztcsl+39dd ( @ 0)</avrf:trace>
<avrf:trace>OraOCIICUS11!+c991041 ( @ 0)</avrf:trace>
<avrf:trace>OraOCIICUS11!ociepacm+3cb ( @ 0)</avrf:trace>
<avrf:trace>OraOCIICUS11!ociepacm+484 ( @ 0)</avrf:trace>
<avrf:trace>vrfcore!VerifierTlsSetValue+431 ( @ 0)</avrf:trace>
<avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+c55 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!RtlQueryEnvironmentVariable+241 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrResSearchResource+b4d ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrResSearchResource+a10 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrLoadDll+7b ( @ 0)</avrf:trace>
<avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+1087 ( @ 0)</avrf:trace>
<avrf:trace>KERNELBASE!LoadLibraryExW+1f1 ( @ 0)</avrf:trace>
<avrf:trace>KERNELBASE!LoadLibraryExA+26 ( @ 0)</avrf:trace>
<avrf:trace>KERNEL32!LoadLibraryA+31 ( @ 0)</avrf:trace>
<avrf:trace>OCI!koptdumptds_check+617 ( @ 0)</avrf:trace>
<avrf:trace>OCI!lpminit+8 ( @ 0)</avrf:trace>
<avrf:trace>SQORA32!SQLTablesW+36a ( @ 0)</avrf:trace>
<avrf:trace>SQORA32!SQLTablesW+766 ( @ 0)</avrf:trace>
<avrf:trace>verifier!+728fc66d ( @ 0)</avrf:trace>
<avrf:trace>vrfcore!VerifierTlsSetValue+431 ( @ 0)</avrf:trace>
<avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+c55 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!RtlQueryEnvironmentVariable+241 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrResSearchResource+b4d ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrResSearchResource+a10 ( @ 0)</avrf:trace>
<avrf:trace>ntdll!LdrLoadDll+7b ( @ 0)</avrf:trace>
<avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+1087 ( @ 0)</avrf:trace>
<avrf:trace>KERNELBASE!LoadLibraryExW+1f1 ( @ 0)</avrf:trace>
<avrf:trace>ODBC32!VFreeErrors+2ff5 ( @ 0)</avrf:trace>
<avrf:trace>ODBC32!SQLDisconnect+593 ( @ 0)</avrf:trace>
<avrf:trace>ODBC32!SQLDisconnect+6f4 ( @ 0)</avrf:trace>
<avrf:trace>MSRDO20!DllGetClassObject+1933 ( @ 0)</avrf:trace>
<avrf:trace>MSRDO20!DllGetClassObject+1492 ( @ 0)</avrf:trace>
<avrf:trace>MSRDO20!DllGetClassObject+e7f ( @ 0)</avrf:trace>
<avrf:trace>MSRDO20!DllGetClassObject+d29 ( @ 0)</avrf:trace>
<avrf:trace>MSRDO20!DllGetClassObject+c72 ( @ 0)</avrf:trace>
</avrf:stackTrace>
</avrf:logEntry>
</avrf:logSession>
</avrf:logfile>

Does anyone have any idea what is going on and how this can be resolved? Moving to different technologies is not an option because there is too much code involved.

Many thanks.

Align Justify in DataReport Label

$
0
0
Friends,

1. I had used a Label in Data Report. I need to use a letter paragraph in the said label. But i was unable to Align Justify.

There is 3 alignment property is there;

0-rptJustifyLeft, 1-rptJustifyRight, 2-rptJustifyCenter

Please help me to sort out the issue.

2. Need to use a continuous number in a label in all pages. Please help me that too.

Guna

VB6 Identification and Removal from Enterprise Environment

$
0
0
Hello,

Is it possible to create some type of query to identify all instances of VB6 and automatically remove it?

I've been tasked with identifying VB6 in an enterprise environment and removing it from all assets.

We have an enterprise software management tool (LanDesk).

Any help or suggestions would be greatly appreciated.

Thank you.

add + 1 in dictionary(FSO object)

$
0
0
i loop a text file with the simple freefile.
during the loop i get from each line with mid statement a part of string and assign to MyVar.
Myvar is string dimensioned.
In this case myVar is the name of a City
now i need to assign on a City +1 value in a dictinary in loop...

example for pseudo code:

City="roma"
Not exists, in Dictionay record, for first occurrence Roma+1
next line from txt
City="Roma"
Roma alredy exist with 1 value
Roma,1+1
ecc...
In effect i need to count each occurence based the City to the end of txt

Then, now i need to loop each items in dictionary....

sory for my bad english

[RESOLVED] What does hwnd2 means?

$
0
0
I'm quite confused on my project I use Spy++. What do you call the child window having another child window? If I'm using FindWindowEx does it mean I need to create another one?! I know that hwnd1 is for parent window handler, but I can not figure out what is hwnd2... Can I assign 2 parents on FindWindowEx or do I define the 1st child window as another FindWindowEx and not FindWindow?! The textbox I'm looking at, is inside a frame window and Spy++ can not determine the class of that frame window... And that frame is inside the 1st child window... So I assume that the textbox belong to the 1st child window...

How to make Pop Up Box ala Yahoo Messenger

$
0
0
Dear Master/Guru/Shifu/etc

How to make pop up message ala Yahoo Messenger, so I can show notice or information such as expired date, stock product, etc

thank you

Press button from web page to Command1

$
0
0
Hello
Please Help

Press button from web page to Command1 VB

Name:  nmbn.jpg
Views: 34
Size:  37.7 KB
Attached Images
 

highlight msflexgrid row except last column

$
0
0
I have this msflexgrid which I populate from database. So when it is first loaded from database and I move to every row, my code to highlight the row I am in is OK. But when I filter the grid records only those matching my criteria typed on textbox and only the filtered records are seen, then I click the row to highlight, the highlighting takes so much time. It seems to loop all the rows even those rows that were hidden by the filtering search.

So I would like to ask for your advice to fix the hanging of highlighting of the row.

Below are the codes

Code:

' variable declaration
Dim rw As Long
Dim rrw As Long
Dim m_lRowHeight As Long ' to store the original rowheight


'to filter the grid record
Private Sub SearchFlexGrid()
    Dim lCol As Long, lRow As Long
    Dim sSearch As String
    Dim bMatch As Boolean
   
    sSearch = txtitemname1.Text
    With fgcode
        .Redraw = False ' for faster updating
       
'        search all rows
        For lRow = .FixedRows To .Rows - 1
            If Len(sSearch) = 0 Then
'                if the search text is empty then show all rows
                bMatch = True
            Else
'                initially we don't have a match for this row
                bMatch = False
               
                For lCol = 1 To 1 '.Cols - 1    'search in column 1
'                    For lCol = .FixedCols To 1 '.Cols - 1
'                    check whether the search string is in the cell
                    bMatch = (InStr(1, .TextMatrix(lRow, lCol), sSearch, vbTextCompare) > 0)
                   
                    If bMatch Then Exit For ' no need for searching any further
                Next lCol
            End If
           
'            update the RowHeight to simulate hidden rows
            If bMatch Then
                .RowHeight(lRow) = m_lRowHeight
            Else
                .RowHeight(lRow) = 0
            End If
        Next lRow
       
        .Redraw = True ' enable updating
        .Refresh
    End With
End Sub


'to highlight the row
Public Sub rowhighlight(ColorGrid As MSFlexGrid, rr As Long)
    Dim j As Long
    Dim i As Long
   
    ColorGrid.Redraw = False
    For j = 0 To 5
        If rrw > 0 Then
            ColorGrid.Col = j
            ColorGrid.Row = rrw
            ColorGrid.CellBackColor = vbWhite
        End If
    Next
   
    For j = 0 To 5
        ColorGrid.Col = j
        ColorGrid.Row = rr
        ColorGrid.CellBackColor = &H80C0FF
    Next
    ColorGrid.Redraw = True
    ColorGrid.Refresh
   
    rrw = rr
   
    ColorGrid.Col = 19
End Sub

'grid row selchange
Private Sub fgcode_SelChange()
    Call rowhighlight(fgcode, fgcode.Row)
End Sub

Hoping to fix this real soon. Thanks

Shocking Experience with MidiStreamOpen!

$
0
0
Almost there with MidiStreamOpen, but not quite there- hence the title.
The following represents what I think is the signature:
Code:

Private Declare Function midiStreamOpen Lib "winmm.dll" (ByVal hms As LONG_PTR, ByRef puDeviceID As LONG_PTR, ByVal cMidi As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long
Here's how it's invoked:

Code:

CALLBACK_NULL = 0
hWnd = 0&
curmididev = 0
midirc = midiStreamOpen(hWnd, curmididev, 1, 0, 0, CALLBACK_NULL)

But it's returning MMSYSERR_INVALPARAM so something is wrong with the handle.

Now just as an exercise I tested this in AutoHotKey and this works:

Code:

hWnd = 0000
curmididev := 0
DllCall("winmm.dll\midiOutOpen", UInt,&hWnd, UInt,curmididev, UInt,0, UInt,0, UInt,0, UInt)

Something special with hWnd has to be performed for the function to return zero. Is it VarPtr(), and is curmididev okay as a ByRef arg?
Thanks for reading.

[RESOLVED] Shocking Experience with MidiStreamOpen!

$
0
0
Almost there with MidiStreamOpen, but not quite there- hence the title.
The following represents what I think is the signature:
Code:

Private Declare Function midiStreamOpen Lib "winmm.dll" (ByVal hms As LONG_PTR, ByRef puDeviceID As LONG_PTR, ByVal cMidi As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long
Here's how it's invoked:

Code:

CALLBACK_NULL = 0
hWnd = 0&
curmididev = 0
midirc = midiStreamOpen(hWnd, curmididev, 1, 0, 0, CALLBACK_NULL)

But it's returning MMSYSERR_INVALPARAM so something is wrong with the handle.

Now just as an exercise I tested this in AutoHotKey and this works:

Code:

hWnd = 0000
curmididev := 0
DllCall("winmm.dll\midiOutOpen", UInt,&hWnd, UInt,curmididev, UInt,0, UInt,0, UInt,0, UInt)

Something special with hWnd has to be performed for the function to return zero. Is it VarPtr(), and is curmididev okay as a ByRef arg?
Thanks for reading.

[RESOLVED] Color Conversion

$
0
0
How do I convert &H00FFF8F0& to RGB?


Thanks

[RESOLVED] Non-Standard Font

$
0
0
I have a font for JEOPARDY! (gyparody.ttf) downloaded to my computer. How do I use this font in a VB6 application (label, textbox, etc)?

Edit: I did install it in my Windows 10 machine, and I see it when I view fonts on the computer (Control Panel, Appearance and Personalization, Fonts).

Edit 2: Never Mind....I had to close the currently opened VB6 Application, then reopen it (I install the font while that app was open). Now I see it in the list provided by VB.

[RESOLVED] fill in listview subitem

$
0
0
Hi experts
I need to loop through the listview subitems(2) items and populate the listview subitems(3) as shown in the picture.
Name:  lvw.png
Views: 51
Size:  1.8 KB

val(ListView1.ListItems(i).SubItems(3) = the difference between the item in ListView1.ListItems(i).SubItems(2) and the preceding item.
something like this:
20....... 0
25...... .5
27........2
I wish you understand me
thank you
Attached Images
 

What's the right one to choose?

$
0
0
I'm trying to create a code wherein if I open another application my own form/application follow suite... I was thinking of Conditional statement and with the use of "shell" or use an API call "SetForegroundWindow" which basically I don't have any experience of using this API call, so I still don't know what it could do?

Can VB6 use JavaScript or HTML5 chart controls?

$
0
0
About the chart control, I have the following questions:

(1) FasionCharts for VB6 is the best VB6 chart control I've ever seen, but this control was abandoned by its developer InfoSoft Global a few years ago. I know that the development workload of a similar chart control is very large if we start from scratch. Is there a third-party graphics library such as vbRichClient5 (Cairo graphics engine) that can reduce the development workload of this chart control? Or whether there is a better product that can replace FusionCharts for VB6.

(2) Now many people are using JavaScript and HTML5 to develop chart control, if VB6 apps can use these chart controls it would be great. (I mean wrapping a JavaScript or HTML5 chart control into an OCX control for VB6 calls like FusionCharts for VB6.)

Though my current work doesn't need to use the chart control, I am still interested in this issue.

INSERT image in subitems of lisvtview

$
0
0
I need to insert a Gif image(is a little image) in subitems of lisview from dir c:\dir1\image.gif, not from imagelist.
How to?

How does Spy++ highlighting work?

$
0
0
Hey everyone, in Spy++, if you are navigating the window tree hierarchy where it lists Windows parents and there children there is an option where you can right click on one of those elements and click "Highlight". When you do that it will flash a border around the window showing you where it is on the UI.

I would like to learn how to do that with VB6. I want to use the feature highlight windows and there controls to create sort of a tutorial to teach somebody how to do something, ie first push this button (highlight) and then push this button (highlight) etc...

RC5 form.visible is true after close it

$
0
0
Checking the "1 Hello Form-Engine (basics)" from RC5 I found fMain.Form.Visible = True, after exit from Cairo.WidgetForms.EnterMessageLoop and no form is visible;
Why this happen
Working with M2000 interpreter, revision 3 of version 8.8 I can make all objects, without references on vbcode (on interpreters dll), using M2000 commands, and got events also that runs M2000 code, and without EnterMessageLoop, using M2000 loop for threads - working threads behind RC5 forms- but then I found visible was not change it, so i use for exit a keypress(1) - mouse click on M2000 console. I am in trials with new M2000 code, but visible on form must be false if form is not shown.



Code:

Option Explicit
 
Public New_c As New cConstructor, Cairo As cCairo

Public fMain As New cfMain
 
Sub Main()
  Set Cairo = New_c.Cairo
 
  fMain.Form.Show
 
  Cairo.WidgetForms.EnterMessageLoop 'this is required, since no VB-Forms are involved
  MsgBox "coocoo"
  Debug.Print fMain.Form.Visible  ' this is TRUE but Form is not visible
End Sub

[RESOLVED] RC5 form.visible is true after close it

$
0
0
Checking the "1 Hello Form-Engine (basics)" from RC5 I found fMain.Form.Visible = True, after exit from Cairo.WidgetForms.EnterMessageLoop and no form is visible;
Why this happen
Working with M2000 interpreter, revision 3 of version 8.8 I can make all objects, without references on vbcode (on interpreters dll), using M2000 commands, and got events also that runs M2000 code, and without EnterMessageLoop, using M2000 loop for threads - working threads behind RC5 forms- but then I found visible was not change it, so i use for exit a keypress(1) - mouse click on M2000 console. I am in trials with new M2000 code, but visible on form must be false if form is not shown.



Code:

Option Explicit
 
Public New_c As New cConstructor, Cairo As cCairo

Public fMain As New cfMain
 
Sub Main()
  Set Cairo = New_c.Cairo
 
  fMain.Form.Show
 
  Cairo.WidgetForms.EnterMessageLoop 'this is required, since no VB-Forms are involved
  MsgBox "coocoo"
  Debug.Print fMain.Form.Visible  ' this is TRUE but Form is not visible
End Sub

create new papersize

$
0
0
On windows, when a print a document, you may want to select what papersize to use like letter, legal, a4, etc.

Now, if the papersize is not there, you go to print server setting and add new papersize.

my question is how do you create this programmatically through vb6 app.
Viewing all 21920 articles
Browse latest View live


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