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

Strange rounding problem

$
0
0
Hi everybody :-)

I don't understand how VB6 calculates a simple difference.
I have 2 text boxes say X and Y.
X.text = "13"
Y.text = "13.7"

Str$(Val(X.text) - Val(Y.text)) = ... "-0.699999999999999" !!!

How is it possible and how can I obtain "-0.7" ?

If I set
X.text = "12"
Y.text = "13.7"
Str$(Val(X.text) - Val(Y.text)) = "-1.7"
Why is the result different ?

[RESOLVED] LaVolpe AlphaImgControl - Capture Picbox To AIC...

$
0
0
I have controls inside a PictureBox. I am capturing the PictureBox with controls as an Image and would like to set that image to the AlphaImgControl, but it keeps telling me that it's an invalid picture. Need the captured image in the AlphaImgControl and would like to do so without file-saving. Any ideas?

[RESOLVED] DWord Alignment of VB Resource File Entries

$
0
0
I've seen posts regarding this topic from time to time. So, trying to get a definitive answer from you guys/gals from your personal, verifiable experiences.

Can VB change the reported actual size of an individual resource once it is compiled into the application?

FYI. I know that prior to SP6, this was a bug and supposedly fixed with SP6. That bug resulted in VB padding the resource, as needed, 1 to 3 vbNullChar bytes to force dword alignment. That in itself is not the problem, the problem is if the size of the resource was adjusted to match. This bug appears primarily with HTML/XML resources (RT_HTML/RT_MANIFEST respectively). The resource size includes the null characters and null characters are not valid in that context.

Note: I've seen a couple of Elroy's posts regarding this topic, but do not know if they were pre-SP6 or not. In his case, his concern was checksums/CRCs when extracting data from a resource to file. If the resource was padded and size was modified to reflect the padding, then the extracted resource would be 1-3 bytes larger than original; resulting in a failed checksum/CRC validation.

Edited: msdn comments about the pre-SP6 padding bug

VB6 -Runtime error 462 - Remote server machine does not exist or unavailable

$
0
0
Code:

Private Sub cmdPrint_Click()
Dim xlApp As Excel.Application
    Dim xlWB As Workbook
    Dim xlWS As Worksheet
    Dim strFile As String
   
   
   
    'Open App.Path & "\INVOICE.LOG" For Append As #1
    'Write #1, Val(txtInvoice.Text), txtDate.Text, txtCustomer.Text, txtCustomerPlace.Text, txtBillTotal.Text
    'Close #1
       
    strFile = Format(Now(), "YYMMDDHHMMSS")
    FileCopy "D:\GS-Bills\bills.sig", "D:\GS-Bills\Working\" & strFile & ".tmp"
       
    Set xlApp = New Excel.Application
    Set xlWB = xlApp.Workbooks.Open("D:\GS-Bills\Working\" & strFile & ".tmp")
    Set xlWS = xlWB.Worksheets("sheet1")
   
   
    xlWS.Range("h2") = ": " & txtDate.Text
    xlWS.Range("h3") = ": " & txtBillNo.Text
   
   
    xlWS.Range("c6") = ": " & txtPatientName.Text
    xlWS.Range("c7") = ": " & cboSex.Text
    xlWS.Range("f7") = ": " & txtAge.Text & " " & cboAge.Text
    xlWS.Range("c8") = ": " & txtMobileNo.Text
   
    xlWS.Range("c10") = ": " & cboDr.Text
   
    For I = 0 To 7
        xlWS.Range("b" & 13 + I) = " " & cboTest(I).Text
        xlWS.Range("H" & 13 + I) = txtCharges(I).Text
    Next I
   
   
   
    xlWS.Range("b21") = txtBillAmount.Caption
    xlWS.Range("H21") = "Rs." & txtBillTotal.Text
   
   
    xlWS.PrintOut , , 1
   
    xlWB.Save
    xlWB.Close
   
   
    Set xlWB = Nothing
    Set xlWS = Nothing
    Set xlApp = Nothing
    Excel.Application.Quit
    Kill "D:\GS-Bills\Working\" & strFile & ".tmp"
   
End Sub

I'm unable to find the error ... any help ?

Adding Icons to Menu Items

msinet could not be loaded

$
0
0
have problebm with windows 8.1 64 bit

mswinsock.ocx msinet,ocx ....

how solve it ??
Attached Images
  

[RESOLVED] how to get info: is my vb6 Project compiled or interpreted ?

$
0
0
Hi,
how can I check if my VB6 program is compiled (running as .exe)
or interpreted (running in the Vb6 Ide, as .vbp project) ?

InkEdit Control

$
0
0
Can anyone explain the rather strange behavior of the MS InkEdit Control? When added to a project, it adds a component "C:\Windows\SysWOW64\Inked.dll" (ie. no OCX). It also adds a Reference "C:\Windows\SysWOW64\Inked.oca". When I examine these files, Inked.dll was created ‎October ‎2, ‎2015, and Inked.oca was created ‎June ‎20, ‎2017. The control also appears as a black square in the Toolbox window. An OCA file is normally created the first time an OCX file is used. Since there is no OCX file, I presume the OCA file was created the first time I used it on this machine (Win 8.1). Win 10 also includes "InkObjCore.dll", that is not on Win 8.1.

Can I assume from all this that the InkEdit Control is not a true ActiveX control?

J.A. Coutts

MSCOMM : Save received data as a Bitmap file (XP strange behaviour!)

$
0
0
Continued from this thread :
http://www.vbforums.com/showthread.p...-a-Bitmap-file

After installing the software on two PCs one with Windows 7 and the other with XP, receiving data from the device, using Olaf's routine to save the bitmap to disk.

The bitmap files saved are shown correctly in Windows 7 like this :
Name:  correct.png
Views: 29
Size:  1.2 KB

On XP shown like this :
Name:  wrong.png
Views: 25
Size:  1.1 KB

What is wrong?!

P.S: I had a doubt that something wrong with the serial cable so I just copied the file received from Windows 7 PC to the XP and extracted the bitmap files but it gave the same results, so definitely the problem is with XP I guess!
Attached Images
  

Copy the content of two multiline textbox into another textbox

$
0
0
Hello experts
I want to Copy the content of two multiline textboxes into another textbox as shown:

Name:  pic.png
Views: 22
Size:  5.7 KB

Thank you in advance
Attached Images
 

[RESOLVED] Copy the content of two multiline textbox into another textbox

$
0
0
Hello experts
I want to Copy the content of two multiline textboxes into another textbox as shown:

Name:  pic.png
Views: 61
Size:  5.7 KB

Thank you in advance
Attached Images
 

I hire best vb6 programmer here, buget $500-$1000

$
0
0
I have a project that need execute javascript with inet control in vb6
i wana hire good vb6 programmer here who can do the task
budget: $500-$1000
payment: paypal or btc or any other payment method u prefer
my skype: pblastz
also send me pm with ur skype or contact info.

[RESOLVED] Adding Icons to Menu Items

[RESOLVED] Moving one PictureBox on top of another

$
0
0
I load three PictureBoxes (Win1, Win2 and Win3) onto one form.
Win1 is large and the other two are small.
I can then draw on Win1.
I can then use .TOP, .HEIGHT, .BOTTOM and .WIDTH to place Win2 on top of Win1 and print on it.
I can then use .TOP, .HEIGHT, .BOTTOM and .WIDTH to move Win2 back to it's original place and size.
I can then use .TOP, .HEIGHT, .BOTTOM and .WIDTH to place Win3 on top of Win1 and draw and print on it.
Next I would like to place Win2 on top of Win3 and again print on it.
But, when I use .TOP, .HEIGHT, .BOTTOM and .WIDTH to place Win2 on top of Win3 I can't see it.
It is again on top of Win2 and I have to move Win3 before I can see it.

How can I see Win2 without moving Win3?

Can i found TextBox Like Mail Text

$
0
0
Hi,

Can i found TextBox Like Mail Text.

same like this

Name:  Textbox.jpg
Views: 50
Size:  4.9 KB


Thanks
Attached Images
 

LockResource may be in process until app unloads?

$
0
0
For you system memory gurus.

Let's say I have shell32.dll loaded by my application. It's very reasonable to expect that especially if manifesting for common controls.

Ok, now let's say my app wants to examine each icon within the shell32 resource. I'd do that by calling, among other APIs, the LockResource API to get a memory pointer to the data I'm querying. For sake of argument, let's say I asked for the memory address of every icon. There are over 2,000 icons.

But per MSDN, there is no "unlock resource" type of API. MSDN simply says that when process unloads that had the resources loaded, the memory will be deallocated/freed. So, if I wanted to release the memory, I could call FreeLibrary on a LoadLibraryEx call. But if the dll is already in process, then FreeLibrary won't release the dll, just decrease its count, correct?

Bottom line. Any ideas how I can access a crap load of memory related to a dll, then release that memory? Or am I way overthinking this? If I'm not overthinking it, I do have some ideas on how to access that information without an inprocess LoadLibraryEx call. And yes, LOAD_LIBRARY_AS_DATAFILE is being used.

Thanx in advance.

Edited & FYI. As an example, viewing Task Manager
Before I call a routine that scans every system32.dll icon for size, depth, etc, I marked the memory used by the project. Once the routine triggers, the memory jumps by about 7MB. After I call FreeLibrary on the LoadLibraryEx, memory doesn't decrease. However, if I use LoadLibraryEx on a dll that isn't currently in process, after the FeeLibrary call, I can see a decrease in memory right away. In the previous exercise, even after waiting several minutes, the memory didn't drop. You may say that 7MB is nothing to be concerned about, but this topic is really a question for knowledge... Looking like an out of process method may be needed?

Vb source codes

$
0
0
Does anyone know of any good free sites to download source codes etc? More to learn from as I have been away from the game for many years, cheers

VB6 forms becoming transparent in middle area

$
0
0
I don't know, but this happens since Windows 7 and up IIRC.

It has borderless forms, no title bar, and it is full of USERCONTROLS object, now, where the usercontrol is painted with an IMAGE, it is ok. But where the usercontrol is rendered using Pset, or Print, or Line, Circle, it is wrong., you can see the desktop wallpaper through the VB6 form., and it is like MIXED semi-translucid 50% and 50%.

I don't understand, but it does it always, and I forced customer to use a black solid background.

first, normal look.



then semi translucid, problem. NOT WANTED







what is it wrong?



If i move the window all over the destop, the holes where become translucent show perfectly what is behind perfectly, like if it were designed thay way on purpose. How to fix these holes?

LaVolpe : Alpha Image Control

$
0
0
Regarding the SavePictureGDIPlus method, does it save in synchronous or asynchronous mode?!

Also, How's the shape/development of version 3 of the control?!

Adding icons to submenu

$
0
0
Hi there,
With reference to the link bellow, added icons to the submenu.
http://www.vbforums.com/showthread.p...-to-Menu-Items

code at #2

replaced "C\...\foxlogo.png" with AlphaImgCtl1.Picture

The image type is .ico 256 x 256 32 bit
It works perfect in run mode and but fails to load the application using Package and Deployment Wizard.

Is this the wrong procedure ?
Viewing all 22051 articles
Browse latest View live


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