|
|
David Lema son wrote: Ddddd But what is the question? Also, you are on the VB forum and your subject is C# (there is a separate forum for that). C# is one semitone short for discussions on D.
The best help that I can think of based on your text is ... (Using MS Windows Calculator in Programmer Mode)
Hex: Ddddd
Dec: 908765
Oct: 3356735
Bin: 11011101110111011101
|
|
|
|
|
jsc42 wrote: But what is the question?
Look at his member profile: Member since Thu 19 Jan 2023 . SPAM.
Graeme
"I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee
|
|
|
|
|
I already reported his message as "inappropriate"
|
|
|
|
|
Hello,
We can use API to communicate two different applications.
I have one major doubt, that I am having my VB6.0 application need to integrate with third party webbased application.
Is this possible to use API keys through vb6.0 code to link with third party API?
Thanks
|
|
|
|
|
This has nothing to do with the language being used. Yes, you can use the API keys, but it's your code and/or library that communicates with the API that's going to use the keys.
But, WHY ON EARTH ARE YOU USING VB6? It's been dead for 20 years now. New development in VB6 is a complete waste of time. You're going to end up rewriting this app sooner than you think. VB6 runtime support will end with the end of support for Windows 11. Support for the 22H2 version of Windows 11 will end in October 2025, just under 3 years from now.
|
|
|
|
|
Thanks for the reply.
Actually main reason behind using vb6 is we have developed one big application in vb6 before 12 years which is currently been used very much finely and perfectly.
And it will be a big taks for us to upgrade it to vb.net hence instead of upgrading we are still using it.
Now just small changes are there which is like to integrate web based applications data with that application.
|
|
|
|
|
I suggest you start planning the change to another platform, you have 3 years!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
OK, but you have a lot of planning to do. You WILL be re-writing this thing. Are you going to wait until it's too late to do it?
You better start now.
|
|
|
|
|
Don't worry too much about people telling you that VB6 is outdated, dead, or both. There are millions and millions and millions lines of VB6 code out there, keeping companies running and being profitable. And if you have VB6 skills, you definitely have employment and earnings opportunities for many years to come. I should know: I am quickly approaching my 70th birthday, I am retired, and still bring home quite a bit of bacon by free-lancing, carefully selecting what I want from a ridiculous number of offers/requests.
Oh... when someone tells you that VB6 is outdated, dead, or both... just remind them of COBOL...
And to come back to your question: yes, VB6 can be used to interact with many API. Depending on the API, you will use different tools and/or techniques. Sometimes it will be more difficult than using other, more modern languages. In other cases, strangely, it will be easier. Go figure.
Good luck with your project!
|
|
|
|
|
This just goes to prove the point that VB6 applications should be retired and rewritten into a more modern language. You have a limited future as a viable developer and you are able to be very picky about which jobs you take on. While there may be millions of productive lines of code out there finding a young developer to support it is a challenge.
Encouraging anyone to continue with VB6 is doing them a disservice.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Thanks a lot.
gvidali thank you very much..such a relief from this tension.
Now i am going to search API key and definitely link with my VB6 application..
|
|
|
|
|
It is interesting that you ignore the advice of two respected members with high reputations, but accept it from someone who has hardly contributed anything to these forums.
|
|
|
|
|
No no ..
Even I am thankful to all of you for the reply and solutions.
I will think on evryone's opinion surely.
Thats why i have started working on it also.
But for API key, i need to integrate it in my existsing system thats why i said i am relieved from the tenion thats all.
|
|
|
|
|
Here you go:
https://stackoverflow.com/questions/122607/how-to-consume-a-web-service-from-vb6
The useful life of a "typical" program is 5 years; obviously, you (and I) don't believe in typical.
(I'm not one of the respected ones).
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
|
Hello good people. Please I'm using Vb.net 2019 and I have a setup project in the solution explorer which I have packaged and installed on other machines and it works fine.
About some fews weeks later, I realised the setup project was mysteriously unavailable and I tried to repackage using Add new Project. In the add a new Project window, I searched for setup in the template but nothing was found. I came to the main project and clicked on Extensions and found that Microsoft Visual Studio Installer Projects was still installed and ticked. I'm stuck and don't know what to do now. Please I need your urgent help. Thanks
modified 19-Dec-22 3:49am.
|
|
|
|
|
|
Sorry, wanted to type 2019 pls. Thanks for the correction.
|
|
|
|
|
Option Explicit On
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim xlApp As Application
Dim xlWorkBook As Excel.WorkBook
Dim xlSheet As Excel.WorkSheet
xlApp = CreateObject("Application Excel")
xlWorkBook = xlApp.xlWorkSheets
xlSheet = xlWorkBook.Sheets("Données principales")
xlSheet.activate
MsgBox("h")
MsgBox(xlSheet.Range("A1").value)
End Sub
End Class
|
|
|
|
|
... and where did you have addressed the workbook itself ?
|
|
|
|
|
And is there supposed to be question there?
|
|
|
|
|
My guess (based on the subject text) is that your question is "Why do I have to put 'Excel =' in the 'Imports Excel = Microsoft.Office.Interop.Excel' line when I could just do 'Imports Microsoft.Office.Interop.Excel'?". If that is your question, the answer is that the 'Excel =' provides a shorter name than having to write the whole lot every time, so rather than having to type
Dim xlWorkBook As Microsoft.Office.Interop.Excel.WorkBook you can simply type
Dim xlWorkBook As Excel.WorkBook . If that is not what your question is, then what is the question?
We at CP are good at answering questions; we are not quite as good at trying to guess what the question is
|
|
|
|
|
There is no (apparent) API for managing icons in the system tray in Windows. Applications that live in the system tray that are aborted through Task Manager, or end without a proper shutdown (error out) will leave their icons in the system tray. Restarting the application then puts another icon in the tray. The zombie icons persist and the only official way to remove them is to float your mouse over them and POOF - they disappear. There simply is no Win32 API for clearing these out. In my research I have found that a lot of folks are looking for the ability to clear these out. I even found one commercial product from a company called APPSVOID But it's bundled in an expensive subscription package.
I suspect the commercial product uses hacks that can be found in various places in languages other than VB. One such can be found at Refresh Notification Area This works, but is written entirely in C++. I'm not a C++ Programmer so I spent some time clumsily refactoring the C++ to vb.net (Framework 4.8 in a Winforms application) and came up with the following and would love it if someone smarter than me could look over my shoulder, laugh a little, and help out:
<pre>Imports System.Runtime.InteropServices
Public Class ClearSystemTray
Private Const WM_MOUSEMOVE As UInteger = &H200
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
<DllImport("user32.dll", EntryPoint:="FindWindowW")>
Public Shared Function FindWindowW(<MarshalAs(UnmanagedType.LPTStr)> ByVal lpClassName As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, ByVal childAfter As IntPtr, ByVal lclassName As String, ByVal windowTitle As String) As IntPtr
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto)>
Private Shared Function GetClientRect(ByVal hWnd As System.IntPtr, ByRef lpRECT As Rectangle) As Integer
End Function
Public Shared Async Function ClearTray() As Task(Of Task)
Dim SystemTrayContainerHandle As IntPtr = FindWindowW("Shell_TrayWnd", Nothing)
Dim systemTrayHandle As IntPtr = FindWindowEx(SystemTrayContainerHandle, IntPtr.Zero, "TrayNotifyWnd", Nothing)
Dim sysPagerHandle As IntPtr = FindWindowEx(systemTrayHandle, IntPtr.Zero, "SysPager", Nothing)
Dim NotificationAreaHandle = FindWindowEx(sysPagerHandle, IntPtr.Zero, "ToolbarWindow32", "Notification Area")
If NotificationAreaHandle = IntPtr.Zero Then
NotificationAreaHandle = FindWindowEx(sysPagerHandle, IntPtr.Zero, "ToolbarWindow32", "User Promoted Notification Area")
Dim notifyIconOverflowWindowHandle As IntPtr = FindWindowW("NotifyIconOverflowWindow", Nothing)
Dim overflowNotificationAreaHandle As IntPtr = FindWindowEx(notifyIconOverflowWindowHandle, IntPtr.Zero, "ToolbarWindow32", "Overflow Notification Area")
Await RefreshTrayArea(NotificationAreaHandle)
Await RefreshTrayArea(notifyIconOverflowWindowHandle)
Await RefreshTrayArea(overflowNotificationAreaHandle)
Else
Await RefreshTrayArea(NotificationAreaHandle)
End If
Application.DoEvents()
Return Task.CompletedTask
End Function
Private Shared Async Function RefreshTrayArea(windowHandle As IntPtr) As Task(Of Task)
Dim rect As Rectangle
GetClientRect(windowHandle, rect)
Dim iPos As Integer
Await Task.Run(Sub()
For x As Integer = 0 To rect.Right - 1 Step 5
For y As Integer = 0 To rect.Bottom - 1 Step 5
iPos = (y << 16) + x
PostMessage(windowHandle, WM_MOUSEMOVE, 0, iPos)
Next
Application.DoEvents()
Next
End Sub)
Return Task.CompletedTask
End Function
Since I can barely read the C++ code I have no idea if I did this correctly or not - but... it appears to work.
Here is the original C++ code from the above mentioned site:
<pre>#include "stdafx.h"
#define FW(x,y) FindWindowEx(x, NULL, y, L"")
int _tmain(int argc, _TCHAR* argv[])
{
HWND hNotificationArea;
RECT r;
GetClientRect(
hNotificationArea = FindWindowEx(
FW(FW(FW(NULL, L"Shell_TrayWnd"), L"TrayNotifyWnd"), L"SysPager"),
NULL,
L"ToolbarWindow32",
L"Notification Area"),
&r);
for (LONG x = 0; x < r.right; x += 5)
for (LONG y = 0; y < r.bottom; y += 5)
SendMessage(
hNotificationArea,
WM_MOUSEMOVE,
0,
(y << 16) + x);
GetClientRect(
hNotificationArea = FindWindowEx(
FW(FW(FW(NULL, L"Shell_TrayWnd"), L"TrayNotifyWnd"), L"SysPager"),
NULL,
L"ToolbarWindow32",
L"User Promoted Notification Area"),
&r);
for (LONG x = 0; x < r.right; x += 5)
for (LONG y = 0; y < r.bottom; y += 5)
SendMessage(
hNotificationArea,
WM_MOUSEMOVE,
0,
(y << 16) + x);
GetClientRect(
hNotificationArea = FindWindowEx(
FW(NULL, L"NotifyIconOverflowWindow"),
NULL,
L"ToolbarWindow32",
L"Overflow Notification Area"),
&r);
for (LONG x = 0; x < r.right; x += 5)
for (LONG y = 0; y < r.bottom; y += 5)
SendMessage(
hNotificationArea,
WM_MOUSEMOVE,
0,
(y << 16) + x);
return 0;
}
If someone here is literate in C++ it would be great if you could look this over and see what dumb things I may have done. I am not offended by legitimate criticism (saying you shouldn't be using VB is not legitimate criticism). Also - if someone thinks it's valuable to have this in C# I'm game for that.
modified 29-Nov-22 8:21am.
|
|
|
|
|
The obvious "dumb thing" was linking to the expensive commercial application, which is technically spam.
Also, returning Task(Of Task) is unnecessary; just have the function return Task , and remove the Return Task.CompletedTask lines.
And calling Application.DoEvents is a code-smell. Aside from the fact that it ties your code to WinForms, it will also lead to unexpected behaviour.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|