|
|
We have a suite of around 15 applications which we use to manage a MES, all written in VB6.
There are around 200,000 lines of code spread over the apps, most with a SQL DB but the apps are quite simple, e.g. no custom controls.
Can anyone recommend a service/utility to convert these to a .net winforms language? We haven't decided which one yet but probably C#. There will probably only be one or two devs working on this so writing from scratch isn't really an option. Surprisingly we have a budget so we're not limited to free tools.
Any suggestions greatly appreciated.
|
|
|
|
|
I don't think you'll have much luck with finding anything that converts VB6 to .NET.
The two are fundamentally different in many ways, and it's not simply a matter of translating syntax.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
A Jordison wrote: so writing from scratch isn't really an option I think that is about to change, I have never heard of a successful or even adequate conversion utility. This used to be my bread and butter, a total rewrite is going to be your best option. And for Ghu's sake do not outsource the project, you need to domain knowledge to do this properly.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Googling suggests some
convert from vb6 to C#
Based on my experience long ago of using a tool to convert from MS Basic (not VB) to C++ I wouldn't expect anything but some poor code. If it even run expect there to be problems and that it runs slower.
|
|
|
|
|
I know that services are not allowed to interact with any of the desktops.
I take this to mean that a service cannot create and/or display windows on any desktop.
But can the service interact with windows that are already on any of the desktops?
If not send messages, then can a service use Win32 functions to learn information about the existing windows, like their caption text?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: I know that services are not allowed to interact with any of the desktops.
I open the Services applet.
Pick any service at random.
Right click.
Properties
Select Tab that says "Log On"
There is a check box under "Local System account" that says "Allow service to interact with desktop"
Richard Andrew x64 wrote: I take this to mean that a service cannot create and/or display windows on any desktop.
Is "Greenshot" not a windows service? Maybe just a task applet.
Certainly you could create an task applet as he UI then the service could talk to and use that. Like SQL Server, Oracle, Docker, etc.
But even so I suspect that a service can create windows. Just not an easy task.
Following google suggests that
windows create UI from windows service
Richard Andrew x64 wrote: If not send messages, then can a service use Win32 functions to learn information about the existing windows, like their caption text?
Probably but first you must get the window itself. Following seems to suggest how to list windows.
https://stackoverflow.com/questions/42589496/getting-a-list-of-all-open-windows-in-c-and-storing-them[^]
No doubt all of the above is impacted by permissions.
|
|
|
|
|
Lemme wade in here:
Simple Windows Service in C++[^]
From the word "Service", used in the title of the article, I would surmise that there's at least a 30% chance of it being used in reference to the MS "Windows" shingle. Peering at the code I see nothing but orders for mother to stay up there until I get back.
|
|
|
|
|
Typically, in today's "security" world, you wouldn't try to interact with the desktop from a service.
Normally, you write two apps. The first is your Windows service app that does whatever work you need, and the second is a normal UI app that talks to the service over a named pipe or other IPC channel as your requirements dictate.
|
|
|
|
|
Hi everyone.
A question has arisen (stupid). Using the WinUSB program I created a multiboot flash drive. First (as in the instructions) I recorded Win10 64-bit, after Ubuntu16.04. Now there is a need to add Win10 32-bit there. Is it possible to add it there or do I need to completely format the flash drive and write it again in the order: Win10 32, Win10 64, Ubuntu?
|
|
|
|
|
I am trying to sign .EXE application and also a .MSI installer, and to create a .PFX certificate file, since
this program asks for it, it is Paquet Builder 2021. I tried to use Windows APP Cert Kit which is installed on
my PC. I have Windows Home Edition 64-bit. The Error says "Windows APP Cert Kit 3.3 is not supported on this
version of Windows.... " Are there other ways to create a PFX file?
Get back thanks.
|
|
|
|
|
You can use the SIGNTOOL that comes with Visual Studio to sign the files. You'll have to open the Developer Command Prompt to use it. Just type "developer" into the Windows search bar to find it.
If you're going to distribute the resulting signed files to public customers or is otherwise public facing, you MUST use a certificate from a trusted third-party certificate authority, like Verisign.
You cannot use a self-signed cert for this, otherwise the certificate will not be trusted as it cannot be verified by a publicly trusted CA.
WACK does not work on the Home edition of Windows. You would have to upgrade to the Pro edition or higher.
|
|
|
|
|
Will try, I get back if I have any issues, best regards.
|
|
|
|
|
Hello;
In an Excel file containing Japanese Kanji with phonetic, how can I get the phonetic above the Japanese Kanji?
Kanji with Hiragana
Here is a simple code Excel string extraction program, but it cannot capture the above Hiragana.
The code to get string from excel, but it cannot get the above Hiragana.
string excelFilePath = Directorypath + "TestBook.xlsx";
Excel.Application excelApp = new Excel.Application();
Excel.Workbook workbook = excelApp.Workbooks.Open(excelFilePath);
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets.get_Item(1);
int rowCount = worksheet.UsedRange.Rows.Count;
int colCount = worksheet.UsedRange.Columns.Count;
for (int row = 1; row <= rowCount; row++)
{
for (int col = 1; col <= colCount; col++)
{
Excel.Range cell = worksheet.Cells[row, col];
string cellValue = cell.Value != null ? cell.Value.ToString() : "";
Console.Write(cellValue + "\t");
}
Console.WriteLine();
}
workbook.Close();
excelApp.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(worksheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp);
|
|
|
|
|
I can't find anything that suggests that the phonetic version is stored in the spreadsheet.
As I read it it converts it from the original as needed.
If that is true then you would need to find a way to invoke excel itself to extract that. So not just 'read' the file. There should be an API, since there used to be one, that one can invoke processing. Way back when I needed to do it for Word I found the documentation very, very difficult to use. Perhaps it is better for Excel now.
|
|
|
|
|
Curiosity premise: I always ran Win10 setup on a bootable USB, prior set in Bios as 1st boot choice. Now I see videos of Win10.ISO contents copied to C: drive on a separate created drive partition and installed by running setup.exe. Or some show the WinISO setup.exe being run from a mounted folder on the existing system partition drive.
Question: How does windows.iso setup (repair or clean install) get the reboot process to re-enter the ISO setup several times, and pick up where it left (prior to reboot) instead of starting over. What logistics are involved, in brief if possible.
Appreciate any comments and links to pertinent study material on this.
(I've read some on BCDEdit but not sure if this is what's happening on this?)
|
|
|
|
|
An informal survey here to find out if anyone is actually using Win UI 3 in a real commercial application that people pay for?
I'm sure there are plenty of LOB apps and personal projects etc., but I mean is anyone using it for anything serious that they expect to make money off of? A bet-the-company flagship product?
Three years after release, compared to WPF it's buggy, inflexible, and poorly supported (by Microsoft or by the community - try running a search to find something Win UI 3 specific and seeing how much UWP or WPF content you have to sift through).
I badly need to move off of WPF for its being nearly 20 years old and unsupported, but I find WinUI 3 to be essentially unusable. It suffers from the ultimate problem that nearly all Microsoft development technologies suffer from - because they don't use it to develop their own consumer products, it - at best - isn't a strategic priority, or - at worst - it's deliberately crippled to make sure their own products can't be edged out.
I'm tempted to just use DirectComposition and build an entirely homegrown UI framework, which I then at least can control and debug. I'm almost certian this is what all the major development shops (including Microsoft) do for their flagship products. What other options are there at this point really?
|
|
|
|
|
You should avoid UWP/Win 3 UI and appx, you have to understand they are trying to kill win32 and build a closed down ecosystem like apple and google, don't tie yourself down they want to deceive developers into the close ecosystem to tax you to death with a 30% fee to be hosted on microsoft store.
|
|
|
|
|
You can sideload; you don't have to go through the store. And the 30% is for "games"; other categories are lower.
"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
|
|
|
|
|
A good sign is that Microsoft IS using WinUI (WinApps SDK) to build consumer-facing apps. One of them is the Photo App Microsoft rolls out Windows App SDK-Powered Photos app for Insiders[^]
If I recall well, another WinUI app by Microsoft was something to do with a "Phone" app, but can't quite recall what it was.
While I can agree with some of the sentiment expressed, I am starting to see great energy on WinUI team, open-sourcing of WinUI was great and their OSS participation has been great.
|
|
|
|
|
Hi,
The current Microsoft version of the Win32 documentation says that LoadString, LoadStringW, and LoadStringA will pass back a pointer to a read-only copy of a string resource, if the buffer size passed to the routine is 0. In which universe does this happen? This is what I see:
LoadString(hModule, valid_string_id, buf, buflen) returns length of string
LoadString(hModule, invalid_string_id, buf, buflen) returns 0
LoadString(hModule, valid_string_id, buf, 0) returns -1
LoadString(hModule, valid_string_id, NULL, buflen) throws an exception
LoadString(hModule, valid_string_id, NULL, 0) throws an exception
I always look at the source code of Wine when I encounter stuff like this, as a first approximation of what might actually be going on internally, and it would appear that Wine would do the same, except for the last case where it would return -1.
I can work around this, no problem. The question is more about the mismatch between the documentation and the behavior. Does anyone have any insight on this?
sample code below. You need to attach a resource file with a valid string defined
#include <windows.h>
#include <stdio.h>
#include "test.h"
#define ARRAYLENGTH(a) (sizeof(a)/sizeof((a)[0]))
int main (int argc, char **argv)
{
char buf[300];
int len;
HMODULE hModule = GetModuleHandle(NULL);
#define TEST_FUNC_CALL(expression) \
buf[0] = '?'; \
buf[1] = 0; \
printf("%s\n", #expression); \
__try { \
len = expression; \
printf("... returned %d; buf: %s\n\n", len, buf); \
} \
__except(EXCEPTION_EXECUTE_HANDLER) { \
printf("... threw an exception\n\n"); \
}
TEST_FUNC_CALL( LoadString(hModule, IDS_STRING1, buf, ARRAYLENGTH(buf)) )
TEST_FUNC_CALL( LoadString(hModule, 9999, buf, ARRAYLENGTH(buf)) )
TEST_FUNC_CALL( LoadString(hModule, IDS_STRING1, buf, 0) )
TEST_FUNC_CALL( LoadString(hModule, IDS_STRING1, NULL, ARRAYLENGTH(buf)) )
TEST_FUNC_CALL( LoadString(hModule, IDS_STRING1, NULL, 0) )
return 0;
}
|
|
|
|
|
I just tried that and it does indeed return the length of the string, and set the buffer address to point to the string itself. In your call with a buffer length of zero, you need to pass the address of a pointer, where Windows will store the address of the string. Something like:
char* pString;
TEST_FUNC_CALL( LoadString(hModule, IDS_STRING1, (char*)&pString, 0) )
|
|
|
|
|
So the documentation is wrong. For example it doesn't document '-1' at all.
You might get some more information by doing what it says....
"To get extended error information, call GetLastError."
|
|
|
|
|
Solved: receiving a pointer to the string when cchBufferMax == 0 happens in the Unicode universe (LoadStringW), not the MBCS universe (LoadStringA). Duh! Of course. String resource data is Unicode. If I'd looked at Wine's LoadStringW instead of LoadStringA I'd have seen that yesterday.
(And in case anyone stumbles on this discussion for info about this feature, note that the string in the resource is likely not null terminated.).
I'll post feedback for the documentation. It was an error that the same copy got pasted into both LoadString descriptions. LoadStringA needs to have the part about cchBufferMax == 0 deleted. The -1 return value should also be documented. (Also, LoadStringW does not throw exceptions with a NULL buffer pointer, it returns 0, but that doesn't need to be documented.)
|
|
|
|
|
Brian Knittel wrote: stumbles In the event that you are a spammer (not BK of course) or are experienced in successfully loading hidden links and payloads (again, not BK), please ignore this action verb reference and move n.
|
|
|
|
|