Solved

edit  HKEY_CURRENT_USER  registry from app running as a service

Posted on 2004-09-07
4
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA filters 2 81
Notepad++ how to remove delimiter : from beggning of the line? 3 135
Getting warning: You are about to delete 1 row(s) 9 61
Passing a Text Box name to a Sub 6 104
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

734 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