Solved

edit  HKEY_CURRENT_USER  registry from app running as a service

Posted on 2004-09-07
4
168 Views
Last Modified: 2010-05-02
hi,

re ;  http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21091221.html

EDDYKT's answer might be what i need :
-----
You can create another activeX exe to do the registry changes.

Call this activeX from your service

ALso make sure change this activeX exe to run as interactive user from the identity tab by
using dcomcnfg.exe
----

im feeling so dumb,  ive never used active exe's    

pls help me in de right direction,  ive opened a new activex exe project,  a class mod is shown,  ive added the reg edit code,  and in its sub main i call the reg change  ?? is that correct ?

then, how do i call the activex from the service   (sorry for these stupid questions,  i really never had to use active x)

thx a bunch guys

cheers

sander
0
Comment
Question by:mokum95
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11995665
you have to create method in your class module (e.g RegChange). Then from your service you should call ActiveX exe in the following way:

Dim MyObject as ProjectName.ClassName

Set MyObject = New ProjectName.ClassName

Call MyObject.RegChange

Set MyObject = Nothing
0
 

Author Comment

by:mokum95
ID: 11996979
thanks M.

im now heading in the right direction,,    looked for a few hours,  seems i need to learn a lot more   !  lol        please any 1 else

got some tips i must be aware of,  being new to active x...

thx a bunch

0
 

Author Comment

by:mokum95
ID: 12121138
im still struggeling :( :(     why have i not gone to college and study more..  fool i am  :D

gents please.. im stuck..

i created a  active x exe.    a cls file is shown, i added the reg change code, and added a  private function regchange..     i updated dconcnfg,  it shows
project1.class1   its identity is now interactive user..

then i wanted to test if it works.. created a new app just to test.. instead of calling it from the service..

:  

Private Sub Form_Load()
Dim myobject As projectname.classname
Set myobject = New Project1.class1
Call Project1.regchange
Set myobject = Nothing
End Sub

(is this correct ?? )

when launched it says,  user defined type not defined..      this usually refers to a reference not set...       only  i dont know which reference...

thnx a bunch
regards, sander
0
 
LVL 8

Accepted Solution

by:
mladenovicz earned 500 total points
ID: 12121198
First of all regchange function has to be public not private in order to call it outside ActiveX EXE. You should compile your activeX EXE (File menu -? Make ProjectName.exe). In your main app go to Project->References and add reference to your ActivexEXE. You should see it in the list of available references. If it is not there, there is Browse button, so you can browse to exe file you created.
HTH
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now