VB2005注册了一个dll [英] VB2005 registering a dll

查看:66
本文介绍了VB2005注册了一个dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用VB6 ActiveX.dll的应用程序,我也作为exe。

dll和exe具有完全相同的代码并从Sub Main开始。没有涉及形式




我将这个activex作为一个过程启动:


Dim NewProcess由于流程=新流程


然后我使用其中一个:


Process.Start(" D:\Test\VB6 \\\\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ (D:\ Test \ VB6 \ MyProg.exe,CStr(Arg1)&"& CStr(Arg2))


如果我开始exe版本一切顺利。但是,如果我启动dll版本一个

MsgBox弹出(并搞定时间)这个消息


Dll寄存器服务器在D:\测试\ VB6 \ dll \ MyProg.dll成功


我曾尝试将MyProg.dll放入System32文件夹和VB2005应用程序的Bin

文件夹。当然,我取消注册所有其他外观。


每次运行应用程序时,不仅仅是第一次弹出消息。


帮助! !!!


Galen

I have an app using a VB6 ActiveX.dll which I also have made as an exe. Both
the dll and exe have exactly the same code and start in Sub Main. There is
no form involved.

I start this activex as a Process like so:

Dim NewProcess As Process = New Process

Then I use one of these:

Process.Start("D:\Test\VB6\dll\MyProg.dll", CStr(Arg1) & " " &
CStr(Arg2))

Process.Start("D:\Test\VB6\MyProg.exe", CStr(Arg1) & " " & CStr(Arg2))

If I start the exe version all goes well. But if I start the dll version a
MsgBox pops up (and screws up the timing) with this message

"Dll RegisterServer in D:\Test\VB6\dll\MyProg.dll succeeded"

Ive tried putting the MyProg.dll in System32 folder and the VB2005 app''s Bin
folder. Of course I unregister all other appearances.

The message pops up every time I run the app not just the first time.

Help !!!!

Galen

推荐答案

嗨Galen,


我不确定我是否完全理解你的问题。所以如果我遗漏了任何东西,请随意给我/ b $ b纠正我。


默认使用Process.Start

ShellExecuteEx(< a rel =nofollowhref =http://msdn2.microsoft.com/en-us/library/ms647733.aspxtarget =_ blank> http://msdn2.microsoft.com/en-us/library /ms647733.aspx )

启动文件。对于EXE文件,EXE直接执行。对于DLL

文件,默认动词

http://msdn.microsoft.com/library/en...l/programmersg

uide / shell_basics / shell_basics_extending / fileassociations / fa_verbs.asp?frame

= true)用于执行文件。在你的情况下,我猜一些COM寄存器

工具与DLL文件相关联,它是用你的DLL执行的,并且

其他参数作为命令行传递给它。在这种情况下,工具

报告您的DLL已成功注册。


要注册您的DLL,您可以在system32目录中使用regsvr32.exe:


Dim NewProcess As Process = Process.Start(" regsvr32.exe"," / s

d:\ Test \ VB6 \ MyPyProg .exe"& CStr(Arg1)&""& CStr(Arg2))

要知道注册是否成功,请等待它退出并

读取它的ExitCode:


NewProcess.WaitForExit()

如果NewProcess.ExitCode = 0则

控制台。 WriteLine(注册成功)

其他

Console.WriteLine(注册失败)

结束如果

希望这有帮助。

此致,

Walter Wang(wa****@online.microsoft.com,删除''在线。'')

Microsoft在线社区支持


============================ ======================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。如果您使用的是Outlook Express,请确保清除

复选框工具/选项/读取:一次获取300个标题及时看到你的回复




注意:MSDN托管新闻组支持服务是针对非紧急问题

其中来自社区或Microsoft支持的初步响应

工程师可在1个工作日内完成。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有赋予任何权利。

Hi Galen,

I''m not sure if I fully understand your question. So please feel free to
correct me if I missed anything.

The Process.Start by default uses
ShellExecuteEx(http://msdn2.microsoft.com/en-us/library/ms647733.aspx) to
start the file. For an EXE file, the EXE gets executed directly. For a DLL
file, the default verb
(http://msdn.microsoft.com/library/en...l/programmersg
uide/shell_basics/shell_basics_extending/fileassociations/fa_verbs.asp?frame
=true) is used to execute file. In your case, I guess some COM register
tool is associated with the DLL file and it''s executed with your DLL and
other parameters passed to it as command line. In this case, the tool
reports that your DLL is registered successfully.

To register your DLL, you can use regsvr32.exe in your system32 directory:

Dim NewProcess As Process = Process.Start("regsvr32.exe", "/s
d:\Test\VB6\MyProg.exe " & CStr(Arg1) & " " & CStr(Arg2))
To know whether the registration is successful or not, wait it to exit and
read its ExitCode:

NewProcess.WaitForExit()
if NewProcess.ExitCode = 0 then
Console.WriteLine("Registration successful")
else
Console.WriteLine("Registration failed")
end if
Hope this helps.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


" Galen Somerville" < ga *** @ community.nospamschrieb:
"Galen Somerville" <ga***@community.nospamschrieb:

>我有一个使用VB6 ActiveX.dll的应用程序,我也将其作为exe。
dll和exe都有完全相同的代码并从Sub Main开始。
没有涉及的形式。


我启动这个activex作为一个过程如下:


昏暗NewProcess As Process =新工艺


然后我使用其中一个:


Process.Start(" D:\Test\VB6 \dll \ MyProg.dll",CStr(Arg1)&""&

CStr(Arg2))


Process.Start(" D:\ Test \ VB6 \ MyProg.exe",CStr(Arg1)&"& CStr(Arg2))


如果我启动exe版本一切顺利。但是,如果我启动dll版本一个

MsgBox弹出(并搞定时间)这个消息


Dll寄存器服务器在D:\ Test \ VB6 \ dll \ MyProg.dll成功
>I have an app using a VB6 ActiveX.dll which I also have made as an exe.
Both the dll and exe have exactly the same code and start in Sub Main.
There is no form involved.

I start this activex as a Process like so:

Dim NewProcess As Process = New Process

Then I use one of these:

Process.Start("D:\Test\VB6\dll\MyProg.dll", CStr(Arg1) & " " &
CStr(Arg2))

Process.Start("D:\Test\VB6\MyProg.exe", CStr(Arg1) & " " & CStr(Arg2))

If I start the exe version all goes well. But if I start the dll version a
MsgBox pops up (and screws up the timing) with this message

"Dll RegisterServer in D:\Test\VB6\dll\MyProg.dll succeeded"



除非使用rundll.exe,否则无法直接启动DLL。但是,

只是启动使用DLL文件的可执行文件。如果这个DLL已经正确注册,这将有效,这可以通过使用

" regsvr32.exe"来实现。用于VB6和regasm.exe。在基于.NET的

应用程序中使用。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>

DLLs cannot be started directly except maybe using "rundll.exe". However,
just start your executable file that uses the DLL file. This will work if
the DLL has been registered properly, which can be archieved using
"regsvr32.exe" for use with VB6 and "regasm.exe" for use within .NET-based
applications.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>




" Herfried K. Wagner [MVP]" < hi *************** @ gmx.atwrote in message

news:eF ************* @ TK2MSFTNGP04 .phx.gbl ...

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eF*************@TK2MSFTNGP04.phx.gbl...

" Galen Somerville" < ga *** @ community.nospamschrieb:
"Galen Somerville" <ga***@community.nospamschrieb:

>>我有一个使用VB6 ActiveX.dll的应用程序,我也作为exe。
dll和exe都有完全相同的代码并从Sub Main开始。
没有涉及的形式。

我将这个activex作为一个过程启动如下:

Dim NewProcess As Process = New Process

然后我使用其中一个:

Process.Start(" D:\Test\VB6 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \ VB6 \ MyProg.exe",CStr(Arg1)&""& CStr(Arg2))

如果我启动exe版本一切顺利。但是,如果我启动dll版本
一个MsgBox弹出(并搞砸了时间)这个消息

Dll RegisterServer在D:\ Test \ VB6 \ d'll \\ MyProg.dll成功了
>>I have an app using a VB6 ActiveX.dll which I also have made as an exe.
Both the dll and exe have exactly the same code and start in Sub Main.
There is no form involved.

I start this activex as a Process like so:

Dim NewProcess As Process = New Process

Then I use one of these:

Process.Start("D:\Test\VB6\dll\MyProg.dll", CStr(Arg1) & " " &
CStr(Arg2))

Process.Start("D:\Test\VB6\MyProg.exe", CStr(Arg1) & " " & CStr(Arg2))

If I start the exe version all goes well. But if I start the dll version
a MsgBox pops up (and screws up the timing) with this message

"Dll RegisterServer in D:\Test\VB6\dll\MyProg.dll succeeded"



除非使用rundll.exe,否则无法直接启动DLL。但是,

只是启动使用DLL文件的可执行文件。如果这个DLL已经正确注册,这将有效,这可以通过使用

" regsvr32.exe"来实现。用于VB6和regasm.exe。在基于.NET的

应用程序中使用。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>


DLLs cannot be started directly except maybe using "rundll.exe". However,
just start your executable file that uses the DLL file. This will work if
the DLL has been registered properly, which can be archieved using
"regsvr32.exe" for use with VB6 and "regasm.exe" for use within .NET-based
applications.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



感谢回复Herfried和Walter。


因为它的本质是dll在注册时才被注册创造了。如果我移动它我将使用Regsvr32注册它。
让我很好奇。


使用dll或exe无法解决我的真正问题。正如Walter

所知,此过程基于COM进行USB设备调用以提高速度。

VB2005应用程序使用引用的VB6 dll,其中包含所有USB

接口代码。


这样工作正常但是USB响应非常慢。太慢捕获

实时数据。所以需要快速的一个USB调用就是在这个过程中运行它自己的COM线程的
。问题是USB呼叫返回未找到设备的

状态。一个Jungo监控程序显示USB连接上没有活动




因为其中一个USB设置参数是主窗体hWdw(或无论如何)

问题可能是单独的进程不在那个hWdw之下。要获得

来自Jungo的帮助是一个问题,因为我让我的订阅失效(

Thanks for the replies Herfried and Walter.

By it''s very nature the dll is registered when it''s created. If I move it I
use Regsvr32 to register it. Just made me curious.

Using either the dll or the exe doesn''t solve my real problem. As Walter
knows, this process makes a USB device call based on COM for speed. The
VB2005 app uses a referenced VB6 dll which contains all of the USB
interfacing code.

This works fine but the USB responses are very slow. Too slow to capture
real time data. So the one USB call that needs to be fast is in this Process
running in it''s own COM thread. The problem is that the USB call returns a
status of "Device not found". A Jungo monitoring program shows no activity
on the USB connection when this takes place.

Since one of the USB setup parameters is the Main form hWdw (or whatever)
the problem may be that the separate Process is not under that hWdw. To get
help from Jungo is a problem as I let my subscription lapse (


这篇关于VB2005注册了一个dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆