Try calling CoInitialize(Nil) first and make sure you call CoUninitialize
before exiting.  You can also try OLEInitialize and OLEUninitialize.

These are called during application.initialize but (I think) only if the
app is an automation server.  Also, if you are doing this in your won
thread, then you must call the coinitialize yourself.






"Jeremy Coulter" <[EMAIL PROTECTED]> on 09/04/99 13:12:13

Please respond to [EMAIL PROTECTED]

To:   Multiple recipients of list delphi <[EMAIL PROTECTED]>
cc:    (bcc: Peter Jones/Logistics&Information
      Technology/Christchurch/Foodstuffs)
Subject:  [DUG]:  CreateOLEObject Error




Hi all I am trying to use an activeX dll that I got that checks NT Users to
see if they exist (and log them on if the exist).

It works fine under VB and VBScript, but when I run it in Delphi, I get the
error "CoInitialize can not been Called"

What does this mean !!! I have seen the error before, but not sure what the
error means.
Heres my code

var
  fLogonObject: OLEVariant;
begin
 fLogonObject:= CreateOLEObject('NTAccess.User.1');
{my other code goes here but the line above is the offending line}
  fLogonObject:=Unassigned;

thanks,

Jeremy Coulter (chief software engineer)
Visual Software Solutions
Christchurch, New Zealand
PH 03-3521595
FAX 03-3521596
MOBILE 021-2150435
www.vss.co.nz




(UUEncoded file named: att1.htm follows)
(Its format is: Internet HTML )

begin 644 att1.htm
M/"%$3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4
M<F%N<VET:6]N86PO+T5.(CX-"CQ(5$U,/CQ(14%$/@T*/$U%5$$@8V]N=&5N
M=#TB=&5X="]H=&UL.R!C:&%R<V5T/6ES;RTX.#4Y+3$B(&AT='`M97%U:78]
M0V]N=&5N="U4>7!E/@T*/$U%5$$@8V]N=&5N=#TB35-(5$U,(#4N,#`N,C`Q
M-"XR,3`B(&YA;64]1T5.15)!5$]2/CPO2$5!1#X-"CQ"3T19(&)G0V]L;W(]
M(V9F9F9F9CX-"CQ$258^/$9/3E0@9F%C93U!<FEA;"!S:7IE/3(^/%-004X@
M8VQA<W,],S,U,S(P-S`P+3`Y,#0Q.3DY/DAI(&%L;"!)(&%M('1R>6EN9R`-
M"G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-3Q"4CYW
M=W<N=G-S+F-O+FYZ(#PO1D].5#X\+T9/3E0^/"]0/CPO1$E6/@T*/$1)5CXF
=;F)S<#L\+T1)5CX\+T)/1%D^/"](5$U,/@T*#0H`
`
end


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to