good i'ts working! 
Author Message
 good i'ts working!

hi, i've thinking about u've said forlong time,
and this's what i've done and it work goodly:

we'll begin with the code source in the class initilialize
of the DLL that load's the activex exe:

private MyMainObject as object

private sub class_initiliaze()
'look for the object if it's loaded with the getobject
function

set MyMainObject = GetObject("","MyMainObjectName.mainCs")

'look for error if ther's one: of the existance of
the 'object or not
if Err.Number <> 0 then
        err.clear
'i'm ussing the two definitions because on without the
other doesn't work on another macihne when the activex
isn't regitred
        set MyMainObject =  GetObject
(,"MyMainObjectName.mainCs")

endif

'if there's no instance already created ,create one
if Err.Number <> 0 then
        Err.clear
        set MyMainObject = CreateObject
("MyMainObjectName.mainCs","")  
        if Err.Number <>0 then
                 Err.clear
                 set MyMainObject = CreateObject
("MyMainObjectName.mainCs")  
        endif

        if Err.number <>  then
                'here's a message for the user to get the
number error and for technical support
                MsgBox"For Displyain help and error message
                err.clear
        endif

endif
end sub

and now the standard executable code source taht
initilialize the previous DLL

private MySndObject as object

'the startup module is in the sub main Module

private sub Main()

'look for the object if it's loaded

set MySndObject = GetObject("","MyDLLObject.mainCs")

'look for error
        if Err.Number <> 0 then
                err.clear
                'i'm ussing the two definitions because on
without the other doesn't work on another macihne when the
activex isn't regitred
                set MySndObject=  GetObject
(,"MyDLLObject.mainCs")

        endif

if Err.Number <> 0 then
'if there's no instance already created ,create one
        Err.clear
        set MySndObject= CreateObject
("MyDLLObject.mainCs","")  
        if Err.Number <>0 then
                 Err.clear
                 set MySndObject= CreateObject
("MyDLLObject.mainCs")  
        endif

        if Err.number <>  then
                'here's a message for the user to get the
number error and for technical support
                MsgBox"For Displyain help and error message
                err.clear
        endif

endif
end sub

the reason i've worked with the two notations of the
CreateObject and the GetObejct function is that when
i'm deploying on aother  machine(PC) that run Windows2002
server and professional it dosn't work properly
but now it's working properly.
thank u for u'r idea that help's me a lot and gives me a
good idea!
let's look for another if u want to propose!
thank's !



Tue, 22 Feb 2005 04:44:16 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Do's and Don'ts of UpdateBatch and Disconnected Recordsets

2. Wha'ts wrong with this code

3. A Better PrevInstance Example: Can't get it to work

4. MovePrevious don't work but the MoveNext work's fine

5. Script works, script don't work

6. Windows Service Calling VB6 dll doesn't work but works with VB6

7. IE3 doesn't work after working with webbrowser control

8. Why LoadPicture() works on local pathes and doesn't work on the URLS

9. Work Around doesn't work for RichTextBox

10. Passing a Parameter its works and it doesn't work

11. Works/Doesn't Work

12. ActiveX-Exe: .Value=True doesn't work while direct click on button works

 

 
Powered by phpBB® Forum Software