|
Can you create a VB6 program that does multi-tasking? I have to create a Printed Circuit Board test program that concurrently tests 2 boards.
Thank you for your help in advance.
|
|
|
|
|
VB6 doesn't support multi-threading. It is possible to do, but you can't debug the code using the VB6 IDE. It'll crash the IDE when the code hits a breakpoint. Last time I searched for articles on VB6 multi-threading, I came up empty.
If you really want to do this, I suggest saving yourself the time and aggrevation and do in VB.NET or C#. At least in the .NET Framework, multi-threading is MUCH eaasier to code, debug, and support.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi ppl,
i have a database with only one table named project_name. what i want is that on the page load event the last record of this database should be displayed in a textbox on my web form. how doi do this. i'm using access as my database. please help me.
thanks and regards
manik
|
|
|
|
|
This can easily be done using an SQL statement, something like:
SELECT LAST(fieldname) AS LastProjectName FROM project_name;
This will return a single table, with one row under the column name "LastProjectName".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanx dave,
it works.
regards
manik nath
|
|
|
|
|
sorry to bother you again dave. but the code works fine and gets me the data on to a datagrid. only one single LastProjectName data is returned. but when i try to get the data to a dropdownlist it does not work. how do i do this. also if there is a way by which i can get the data on a datagrid to a textbox.
i mean that the datagrid displays the LastProjectName but can i get this value into a textbox.
thanx and regards
manik
|
|
|
|
|
i find active window(FindWindow) using API. but i don't know how pass string (search word) to FindWindow's textbox? when it active. i am using sendmessagebystring API but it changes caption of active windos.
Any help appreciated
Thanks in advance
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Static lHwnd As Long
Dim lCurHwnd As Long
Dim sText As String * 255
Dim caption
lCurHwnd = GetForegroundWindow
If lCurHwnd = lHwnd Then Exit Sub
lHwnd = lCurHwnd
If lHwnd <> hwnd Then
caption = Left$(sText, GetWindowText(lHwnd, ByVal sText, 255))
Call SendMessageByString(lHwnd, WM_SETTEXT, 0&, ByVal "sample")
End If
|
|
|
|
|
You sent the SETTEXT message to the window, thereby changing the window title. You need to find the window that represents the textbox in that window, then send the message to that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please explain how to do that?
|
|
|
|
|
Hi all,
In VB6, how can I cast an object?
thx
|
|
|
|
|
i don't know VB6, but isn't there any CType() function ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thx for your reply, but it seems CType is a VB.Net function
I need a function that can be run in Outlook Marco
|
|
|
|
|
From memory (its been a while): CInt, CStr, CLong, CDbl, CDate
|
|
|
|
|
I have two date columns...StartDate & EndDate in my datagrid.
In my third column I need to display result of 'Start Date- End Date' in number of days
i.e. column3(no of days)=column2(enddate)-column1(startdate)
Using item template is one option but I cannot figure out how to subtract dates, calculate date and display in the subsequent item sell.
Any help anyone?got a deadline to meet
(Language = Vb.net)
Many Thanks in advance.
arty=me
|
|
|
|
|
When you subtract one datetime from another, the object that is returned is called a TimeSpan, as in
TimeSpan ts = endDate - startDate;
TimeSpan has a Days property.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
you can use
NoOfDays=DateDiff(Dateinterval.day,FirstDay,SecondDate)
where NoOfDays is of type long
Lata Agrawal
|
|
|
|
|
Introduction: I am working on a desktop application (Windows based). It is a Wizard kind of application where there are steps. You need to click on Next to go ahead and Previous to go back. On screen two I have a Data Grid which is set as read-only.
Problem: Some of the times the horizontal scrollbar of Data Grid disappears. If you double-click on Data Grid header or resize header, scrollbar appears.
What could be the cause of this, and how can we get rid of this?
- ashish
|
|
|
|
|
I am using Visual Studio Dot net 2005 for writing a program.i have to plot a graph in it from data given.i am using visual basic for this code.please help me and let me know how to plot the graph.how to make grid and all and plot graph.is there some application available tht will plot the graph automatically.
Thanks in advance.
|
|
|
|
|
|
Hello all,
Please help us with the following.
We have a winform. On click of a button, we process records which takes lot of time. The window just freezes. If you click on any other window and try to come to the same window, it does come up. When the processing is done, we want to display the same screen.
We want to display a message to the user with 'please wait' or something like that.
Any ideas or code in C# or VB.NET is greatly appreicated.
Thanks in advance.
Prasad.
|
|
|
|
|
Sound like a job for a background thread. After you launch the processing job on its own thread, you can display a modal window with your message. This will keep your UI thread unblocked so it can respond and repaint itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply.
Can anyone please give me some sample code or point to some articles which explains how to do.
Thanks,
Prasad.
|
|
|
|
|
|
Hi everyone,
I converted a project made with VB6 to VB.NET. I am now getting an error in the function header that says that I cannot pass a structure as an optional parameters. Does someone knows how I can fix it?
Here is my function:
Public Function AddInDBitems([...], Optional ByRef fColor As System.Drawing.Color = -1, [...]) As Object
Thanks in advance,
Charles
|
|
|
|
|
I think the error says it all. In the .NET Framework, Drawing.Color is a structure, not a number. Try rewriting your code to accept an Integer instead. You can convert any Color to a 32-bit value by just calling it .ToArgb() method:
Dim value As Integer = myColor.ToArgb()
AddInDBItems(..., value, ...) As Object
.
.
.
Public Function AddInDBitems([...], Optional ByRef fColor As Integer = -1, [...]) As Object
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|