Solved

edit  HKEY_CURRENT_USER  registry from app running as a service

Posted on 2004-09-07
4
172 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

679 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