Solved

edit  HKEY_CURRENT_USER  registry from app running as a service

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

24 Experts available now in Live!

Get 1:1 Help Now