I have no idea how I should solve the following task and I would be pleased if someone can give me a small advice at least.
I've got old sourcecode in visual basic 6.0, active x browser plugins that start an VB .dll module to upload documents to the server. This is part of a webclient. To start the upload-services, the active-x control is called.
Private Sub ProgressStarter()
Dim hModule As Long
hModule = 0
Dim strExe As String
Dim strParam As String
Dim nResult As Long
strExe = App.path & "\ClientServiceStarter.exe"
strParam = "some_params"
' wait for Exe
nResult = ExecCmd(strExe & strParam)
If nResult < 32 Then
MsgBox "Error", vbCritical Or vbOKOnly
End If
Exit Sub
The execcmd-func starts the VB .dll
Public Function ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim Start As STARTUPINFO
' Initialize the STARTUPINFO structure:
Start.cb = Len(Start)
' Start the shelled application:
Dim Ret As Long
Ret& = CreateProcessA(vbNullString, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, _
vbNullString, Start, proc)
' Wait for the shelled application to finish:
ExecCmd = Ret&
Ret& = WaitForSingleObject(proc.hProcess, 1)
While Ret& = WAIT_TIMEOUT
DoEvents
Ret& = WaitForSingleObject(proc.hProcess, 1)
Wend
Call GetExitCodeProcess(proc.hProcess, Ret&)
Call CloseHandle(proc.hThread)
Call CloseHandle(proc.hProcess)
End Function
Now I want to change the VB .dll into a in c# written application. My question is, what kind of application should I use and how should I call it, because just changing the filename in the ProgressStarter-function doesn't work (nothing happened). I tried it with an wpf-application, that runs on its own, but could not executed from this active-x. So...what am I doing wrong? Any ideas how to solve this?
Kind regards and Sorry for my bad english.