473,624 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Late bind ActiveX DLL problem

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim AESobj As Object
Dim boolResult As Boolean
Const HKEY_CURRENT_US ER As Integer = &H80000001
Dim strResult As String
AESobj = CreateObject("A ESRegLib.AESReg istryObject")
boolResult = AESobj.WriteStr ing(HKEY_CURREN T_USER, "Software\Examp le Reg
Path", "Example String Value", "hellovb.ne t")
If boolResult Then
MsgBox("Write: Success")
Else
MsgBox("Write: Failed")
End If
boolResult = AESobj.ReadStri ng(HKEY_CURRENT _USER, "Software\Examp le Reg
Path", "Example String Value", strResult)
'MsgBox(strResu lt)
'http://groups.google.c om/groups?q=vb+.NE T+late+bind+byr ef&hl=en&lr=&ie =UTF-
8&oe=UTF-8&selm=bdbb913a .0401151204.93c 973c%40posting. google.com&rnum =1
End Sub
The above code work in its entirety, except the

boolResult = AESobj.ReadStri ng(HKEY_CURRENT _USER, "Software\Examp le Reg
Path", "Example String Value", strResult)

It keeps giving me back " An unhandled exception of type
'System.Runtime .InteropService s.COMException' occurred in
microsoft.visua lbasic.dll

Additional information: Type mismatch. " .

Not sure why it's giving this, code looks fine to me. Anyone got any ideas?
The following is the working code in VB6.

Thanks
The VB6 code (working):

Option Explicit
Dim reg As New AESRegistryObje ct
Dim strResult As String
Dim boolResult As Boolean '
Private Sub Form_Load()
boolResult = reg.WriteString (HKEY_CURRENT_U SER, "Software\Examp le Reg Path",
"Example String Value", "hello")

If boolResult Then MsgBox "Write : Success" Else MsgBox "Write : Fail"
boolResult = reg.ReadString( HKEY_CURRENT_US ER, "Software\Examp le Reg Path",
"Example String Value", strResult)
If boolResult Then
MsgBox "Read result = " & strResult
Else
MsgBox "Registry read failed"
End If
End Sub
Nov 20 '05 #1
2 1696
"Chris" <jt******@comca st.net> schrieb
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim AESobj As Object
Dim boolResult As Boolean
Const HKEY_CURRENT_US ER As Integer = &H80000001
Dim strResult As String
AESobj = CreateObject("A ESRegLib.AESReg istryObject")


Why don't you use the Registry and RegistryKey classes (namespace
Microsoft.Win32 )?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
I obviously can, but I've ben asked to do this.

"Armin Zingler" <az*******@free net.de> wrote in message
news:uN******** ******@TK2MSFTN GP09.phx.gbl...
"Chris" <jt******@comca st.net> schrieb
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim AESobj As Object
Dim boolResult As Boolean
Const HKEY_CURRENT_US ER As Integer = &H80000001
Dim strResult As String
AESobj = CreateObject("A ESRegLib.AESReg istryObject")


Why don't you use the Registry and RegistryKey classes (namespace
Microsoft.Win32 )?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
982
by: Shelby | last post by:
Hi, I need help with deploying ActiveX. I can run the activex on my computer, but when access from another computer, it stop running after prompt "Do you want to..." dialog box. Which newsgroup should I go to? Shelby
0
1327
by: J.S | last post by:
I create 2 forms in a basic project. on the first i put the Wmp activex and run an url. then I click on a button on this first form.It opens the second form. When I move this second form on my wmp activex the video is hidden(it's playing but you don't see it). when I remove this form the video is visible. is this a bug known and how solving it? thanks
5
6322
by: Chris | last post by:
Greetings, I'm trying to late bind a ActiveX DLL that was made with VB6 in C#. Can you give me an example or URL of this? I've been trying to google it, just cant find a straight answer. Thanks!
0
1595
by: Xavier MT | last post by:
Hi, I have a small problem I solve easily in VB.NET but now I need to implement it in C#. The problem is: I have a COM component written in C++ and the methods are like this: STDMETHOD(get_OpeningBalance)(double *pVal); In VB.NET I do the following:
0
1125
by: birdinhand | last post by:
Hello, all. After trying to wade through a great deal of undocumented and uncommented code in order to speed up a frame capture rate, I've decided that, for my sanity and that of my boss and any coders to follow me, I should start over and write it myself. I reuse a great deal of the old code, but I can't really get much further until I get the passthrough working (Passthrough is the 'live' video feed captured by the camera and card).
3
2501
by: Dick Sutton | last post by:
Hi all, I just made the mistake of posting this question in the Microsoft.Public.VB.General.Discussion group. I was told that VB 2005 Express is NOT VB. Oh, well, must have touched a nerve. Anyway, here's the situation. I am using VB 2005 Express to build a program and I have found that the easiest way to generate a 'text page' (for viewing and/or printing) for my app is to create an HTML page using the IE document object. I know,...
0
1114
by: =?utf-8?B?5LiA6aaW6K+X?= | last post by:
Hi all! Have u tried genaxmodule.py provided by wxPython to create a wrapper module for an activex control? For me, some times it works, but some times, it doesn't. ----------------------------------------------------- Traceback (most recent call last): File "genaxmodule.py", line 42, in ? main(sys.argv)
4
1444
by: Akhilez | last post by:
I am writing an activeX control in VB 6. I am using the ocx outside of VB and Microsoft, in another application. I dropped the Forms 2.0 textbox on a User Control (activex) form to make the ocx. If the Host environment changes the .text property for the ocx, the text box updates. If I enter data into the ocx textbox, the value is not available to the host environment. It seems that the way I have set it up, VB does not expose the...
5
1078
Ali Rizwan
by: Ali Rizwan | last post by:
Hi Anybody know about activex files. I have an activex control by which we can make fadeeffect to buttons. But when we click 4 times the button a messagebox will appear i want that msgbox doesnot appear. I m attatching rh .ocx file plz help me
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.