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

Can't figure out the path

$
0
0
Hello
I'm giving the user the choice to choose the directory of the database by means of CommonDialog.
Then the path is saved into textfile.
Code:

DBPath = CD.FileName
The DBPath is something like this:
Code:

C:\Users\Sammer\Desktop\NewFolder\mydata.mdb
Now what I need is to grap the database path to check the existence of the idl file.
How can I drop the CD.FileTitle from the FileName and grap this repertory?
Code:

C:\Users\Sammer\Desktop\NewFolder
Thank you

SXS and UMMM with inter-thread marshalling

$
0
0
Hi everyone. I'd really appreciate any help on this. I'm trying to get an app portable, but I can't for the life of me figure out the syntax for UMMM's ini file regarding marshalling support. I've tried a number of things, but can't get comInterfaceExternalProxyStub to even show up in the manifest. If I leave out all references to Slitheris.dll, Windows magically finds the DLL and uses it with no apparent problem. But I really want to properly isolate it with a manifest. Slitheris.dll is an ActiveX DLL used in conjuction with Thread Factory to do some fancy inter-process multithreading. I know I'm doing something wrong. Do I even need the File command in there?

Here's what my current .ini looks like:

Identity Slitheris.exe
Dependency ComCtl

Interface Slitheris.dll Slitheris_DLL.clsScanner

File Slitheris.dll
File COMCTL32.OCX
File cNewMenu6.dll
File iGrid600_10Tec.ocx
File SSubTmr6.dll
File vbalIml240_10Tec.ocx
File vbalSbar6.ocx
File vbalTbar6.ocx
File ThreadFactoryOCX_RUNTIME.ocx
File ThreadFactoryLib_RUNTIME.dll
File vbRichClient5.dll


I'd like to try The Trick's fantastic manifest-free method too if it works with this DLL, but I wanted to at least have it done with an UMMM manifest first so I can understand how a proper manifest should look, and be able to recreate it at each new compile since I'm not currently using Version Compatibility on the DLL.

Also I'd like to apologize to anyone I may have pissed off or wasted time of by bothering them in PMs on this lately. Nice first impression! :/

windows photo viewer

$
0
0
My application is able to take a snapshot of the form, and then save it to a file as a MyPic.jpg. I'd like the user to be able to click a button and have the pic open in windows photo viewer. I think that viewer is actually a .dll, but not sure about it or where its at. Anyone know?

Also, i'm using win7. what if the user has win10? is it the same viewer and file?

[RESOLVED] windows photo viewer

$
0
0
My application is able to take a snapshot of the form, and then save it to a file as a MyPic.jpg. I'd like the user to be able to click a button and have the pic open in windows photo viewer. I think that viewer is actually a .dll, but not sure about it or where its at. Anyone know?

Also, i'm using win7. what if the user has win10? is it the same viewer and file?

GetDeviceCaps Returning 0 for hdc

$
0
0
Hi there,

Getting 0 back in this code:

Code:

Public Property Let hDC(newHdc As Long)
HDCStored = newHdc
End Property

Where newHdc is passed as the dc property of a formObj in the loading phase- but not yet shown.
Code:

Public Property Get DCWidth() As Long
DCWidth = GetDeviceCaps(HDCStored, HORZRES)
End Property

Fairly sure that GetDC and ReleaseDC is not required for this use, but what's found in testing is this:
DCWidth (or DCHeight) will return values if the dimensions of the form are not changed. Haven't tested other properties being changed.
If the formObj width or height is changed before another call of GetDeviceCaps, DCWidth (or DCHeight) will then return 0.
Not a big drama, any corrections welcome- but it's out there if anyone is interested. :)

[RESOLVED] How walk through the collection array?

$
0
0
Hi,
I have code like this:
Code:

Dim arrTemp(1) As String
Dim dictTemp As Object

Set dictTemp = CreateObject("Scripting.Dictionary")

arrTemp(0) = "val1"
arrTemp(1) = "val2"
dictTemp.Add "First", arrTemp

ReDim arrTemp(0)
arrTemp(0) = "val3"
dictTemp.Add "Second", arrTemp

Now, I want to know how looping through each item in array in dictionary items?
Code:

    For Each v In dictTemp.keys
    'For I=0 to (v)(Ubound(arrTemp))    <--- how correctly write this expression?
    'Debug.Print dictTemp.Item(v)(i)
    'Next
    Next


Array have dynamically ubound.

Disabling / Enabling the Start Menu Button

$
0
0
I found this post

http://forums.codeguru.com/showthrea...s-Start-Button

I implemented the functionality and testing it with Windows XP and found that even though the start button is not visible, if you keep clicking in the area, the start menu options will pop up.

I am looking for a solution in VB6 that will disable/enable hide/show the start menu button in Windows XP, Windows 7 and Windows 10.

Any suggestions?

2d shape (rectangle) manipulation

$
0
0
Hi everyone,
I am using VB6 and even if I can handle do some coding by myself at a certain low-medium level, I have now a task that seems surpasses my knowledge.
I have done several searches on various sub-forums and I did not find a similar issue to mine.
Briefly put, I need to simulate the car traffic in an intersection.
Therefore, I will randomly generate some shapes (rectangles) and some of them will pass through the intersection going forward, but for some there is the challenge of making them turn left or right.
I found easy to animate a rectangle playing with .Top or .Left and using a Timer, but I did not find any methods for rotating the rectangle shapes.
Kindly help me with samples or suggestions of how to tackle this issue as simply as possible.
I attach here an image describing the way I need to make the rectangle follow the desired path.
Name:  rectangle_path.jpg
Views: 38
Size:  12.8 KB
Thank you in advance for any help provided!

Best Regards,
Jon
Attached Images
 

Which way am I supppose to refer to a physical drive?

$
0
0
When doing raw disk reading and writing, am I supposed to refer to the drive like this:
\\?\PhysicalDrive# (where the symbol # should replaced with a number like 0, 1, 2, etc)

Or should it be like this?
\\.\PhysicalDrive#

I've seen it both ways in various code samples people have posted regarding raw disk reading and writing. One way has a question mark between the second and 3rd slash, and the other way has a period between the second and 3rd slash. Which is the correct way?

vb6 + Win7 / WinZip64 = ????? :(

$
0
0
G'day, I know this has been asked a lot as I have spent two days going through the forum search results.
However all of those posts are about shelling Winzip32 and I have "WINZIP64".
Code:

Dim Source As String
Dim Dest As String
        Source = txtSource.Text
        Dest = txtDest.Text
        Call Shell("C:\Program Files\WinZip\WINZIP64.EXE -a -rp" & Source & " " & Dest, vbNormalFocus)

I have tried numerous parameters and even tried the same method with WinRar after seeing it in a post here.
Initially I had it hidden with "-min" and "vbHide" but needed to show it to see what was happening as I was getting the busy cursor animation then nothing.

I have downloaded and installed WinZip commandlines and read it over and over.

I am getting an error (from Winzip) saying "WinZip parameter validation error" so I removed the parameters one at a time in hopes to eliminate the error yet no matter which parameter remained I still got the same error and when I remove all parameter (switches) I get a VB runtime error saying "File not found".
The paths are correct as I right-clicked the address-bar in Windows Explorer, selected "Copy address as text" and pasted it into the script. I did the same for my "txtSource" and "txtDest" textboxes.

I'm just wondering if this commandline only works for Winzip32.exe?

Any help would be greatly appreciated.
Cheers

Access Violation Exception while calling an ActiveX DLL in VB.NET

$
0
0
I have created an ActiveX DLL in VB6 which contains a class two properties and a method.I am using this DLL as a wrapper to another Visual Foxpro 6 dll which referes internally.In short this dll is used to communicate between VB.NET and Visual Foxpro using Activex Dll.I am able to register dll in client machine.But after creating an object,if I try to access member properties or methods it is throwing an exception
AccessViolationException was unhandled.Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Check if a variant variable is a byte array

$
0
0
I can do Typename(Variant) = "Byte()". But is it possible to do with VarType function?

vb6 (apps on ARM) & Multitouch???

$
0
0
vb6 apps on ARM?

... so if this is happening, the real shortcoming remains: Multitouch!

So, a naive question for you Windows-Gurus:

Could it be feasible to slip some software layer underneath/above the Touch/Mousedriver, which

*TRANSLATES MULTIPLE TOUCHES INTO A SERIES OF INDIVIDUAL MOUSE-DOWN / MOUSE-MOVE / MOUSE-UP-EVENTS*??

My very limited understanding/reasoning tells me: should'nt be that hard.

And while limited and potentionally slow it could be *GOOD ENOUGH*

Comments?

GID+: how use attributes?

$
0
0
i can't find any tutorial... so how can i use the attributes?
(at least for i start use it)

Storing Large Chunks of Data in VB6

$
0
0
Hi All,

I need a bit of brainstorming help. I've got a somewhat complex calculation I use Excel to do, and I want to pull it entirely into VB6. Pulling in the actual calculations is the easy part. However, the calculations also involve a rather large set of static data (think, a massive amount of Const data).

To give you an example of the size of this static data, it involves two Excel tabs. The larger tab has columns to IV and rows to 460. If you feel that you need to know more about the calculations, here's a poster that explains part of them. But understanding that has nothing to do with my question.

Yeah, I know about the Array() function, and I'll use that if I have to. The two downsides I immediately see to that are that it's only one dimension and also it returns a variant. Ideally, I'd like a two-dimensional array of Doubles.

I'm also looking for the easiest way to get this data into VB6 code. I don't want it in a file. I just want it hardcoded into a Class module.

Your Thoughts Are Appreciated,
Elroy

EDIT1: I still miss the old DATA and READ commands. I bet few remember those.

Form Icon Issue

$
0
0
I'm struggling with an issue trying to set MDI child form icons at runtime. when using me.icon = loadpicture... it only seems to want to load a 32x32 icon and scale it down to 16x16. If the icon file has both sizes, it always does that and if it only has a 16x16 icon it loads that with an ugly black background. I can load the same icons to a picture box on the same form with no problem.

I have attached a file contain some sample icons and a demonstration of the problem. It seems to do the same thing whether the app is running in the IDE or compiled. I can load the same icon to the form in the IDE and then it loads the 16x16 version without the black background, but still with loss of quality.

Is there some way I can load different form icons at runtime so they always look nice? I'd love to use alpha icons, but am willing to settle for 256 color as long as they look decent.

I've many similar problems here and elsewhere, but none of the provided solutions seem to work for this.

Thanks for any help you can offer.

S

form_icon_issue.zip
Attached Files

when the form is closed(on 'X' button), what event is caused?

$
0
0
i'm confused: when the form is closed(on 'X' button), what event is caused?

What advantages (still) has VB6 compared to others?

Re-Building Record Structure of a Random Access File

$
0
0
I have lost my source code for a pretty simple VB6 program. I have the EXE of the code but not the source. It is just a basic address book and the data file is actually about 30 years old and was originally created with an early version of Quick Basic. Modified to VB 6 and a EXE created.

The exe works fine, although I have to make sure the data file is in the location that it was many years ago, which is just in a folder off of the C: root directory, C:\Address


My question is does anyone know if I could rebuild the structure of the random access file. It was created with TYPE EntryRecord, all the fields, END TYPE then use DIM Entry as EntryRecord. Then I open the file with OPEN "C:\Address\Address.dat" FOR INPUT AS #1 Len(Entry). That part I remember. THe EXE works fine and all the data is intact. Just can't do anything with the data that is not in the orginal VB .EXE file, like export it.

My problem is I want to modify the program with Excel and VBA. I'm trying to fine a way to get all the records out of the file. But without the structure I created with the original TYPE command, I can't find a away to work with the file.

My problem is each record has a series of different length strings and integers and I am not sure of the order.

Any suggestions on getting the data from the file?

The efficiency of SQLite's memory management for recordsets

$
0
0
When we use the cRecordset type to create a recordset in SQLite, how efficiently does it manage the memory?
Does it load the entire recordset into the RS object upon the OpenRecordset statement?
Or does it load just parts of it, and then as navigation statements are executed (MoveNext, Move Last, MovePrev, MoveFirst, etc.) some more records are loaded into memory and older records are disposed?

Let's say we have the following snippet of code:
Code:

  Dim C  as Currency
  Dim Rs      As cRecordset
  sql = "select * from T1"
  Set Rs = Cnn.OpenRecordset(sql)
 
      Do Until Rs.EOF
        C = C + Rs.Fields("A")
        Rs.MoveNext
      Loop

My opinion is that the right way of doing it is to load a certain number of records from the beginning of the table as well as a certain number of records from the end of the table into memory when OpenRecordset statement is executed, so that for a reasonable number of navigations (MoveNext, Move Last, MovePrev, MoveFirst, etc.) the required records that we are trying to navigate to, are already in memory, and if the program proceeds to navigate a lot (and surpasses the existing records in memory) new records should be loaded into memory from the database and older records (statistically least used records) should be discarded (memory allocated to them released to the operating system) and this kind of chunk-wise MANAGING of records should continue until the recordset is set to nothing in which case the whole records should be disposed of and all the memory allocated to them released to the operating system.
Please correct me if I am wrong: The above description is what I think is the best management of records in memory, but I am not sure if this is the best or not, and I am not sure if this is the way that SQLite actually manages recordsets memory.
The reason why this is an issue is that I believe if the table is gigantic with millions of records, loading the entire table into memory is not wise because it will use all of the computer's memory.
This kind of exceeding the computer's memory will eventually happen if the table is more and more gigantic.
What if the table has a billion records?
What if the table has 100 billion records?
I don't think it is right to load the entire table into memory, but I am not sure about that.
And I am not sure how SQLite actually does it.
Can you please clarify this issue?
Thanks.
Viewing all 21204 articles
Browse latest View live


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