Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calling Com Server from Corba object

Posted on 2000-02-24
8
Medium Priority
?
229 Views
Last Modified: 2010-04-04
I am running into a problem calling out to a COM server from within a corba object.  Everytime I make the following call....

        oComServer := CoComServerTest.Create;

I get an error message stating that "CoInitialize Has not been called".  I realize that CoInitialize needs to be called on each thread before COM can be used but The Corba server is setup as single threaded.  What is going on?  If I make the same exact call from a regular client then all works fine.  

I have sample programs that I have been playing with.  If you send me your email address to Randy_Michak@usiva.com I can forward the code.  It is a little much to paste here though.
0
Comment
Question by:blitz051697
[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
8 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 2555901
Hi blitz,

I don't know much about COM servers, but maybe these articles will help :

part I

http://www.delphizine.com/features/1998/06/di199806bl_f/di199806bl_f.asp

part II&III (links see article part I)

Zif.

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2555908
Please send to epsylon3@hotmail.com
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2557082
Have you tried creating your COM object using variants?

VAR
  vCOM_Obj : Variant;
BEGIN
  vCOM_Obj := CreateOLEObject('ErrEvntLog.ErrEvntLogging');
  IF NOT(VarIsEmpty)
  THEN
  BEGIN
    //Do whatever you need to do
    vCOM_Obj.RaiseEventMsg(...);
  END;
END;

Just make sure that you have the ComServ object in your USES clause

Just a suggestion

The Neil
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Accepted Solution

by:
florisb earned 2000 total points
ID: 2557903
I got the same error message when creating a COM object from a dll. It had something to do with the fact that no application.initialize is called (or something....).

Fixed it with a line before the createCOmObject:
CoInitialize(nil);
and then:
Outlook := CreateComObject(CLASS_OutlookApplication) as _Application;

Had to include Ole2 for this in the uses list, that's from Delphi2 if I remember correctly. If you don;t have that file I can send it.

Good luck,
Floris.



0
 

Author Comment

by:blitz051697
ID: 2558530
florish,

That seemed to work.  THe only question that I have is that since this is a single threaded Corba Object I shouldn't have to all the CoInitialize() more than once.  I would think that if I call CoInitialize on the main thread it would work.  It doesn't appear to be the case though.  Even though the Corba Object is single threaded it must be on an entirely different thread than the main program.
0
 
LVL 2

Expert Comment

by:florisb
ID: 2558583
One call for one CreateCOMObject should be enough...

Hmmm, so can can't just CoInitialize before you create the COMObject? You have it working with a special thread for this statement? I'm not sure I totally understand what you explain.

You put a lot of points on this question, I wouldn't mind to look in your code, I only have no experience with Corba, might be interesting because of that... If you like me to look into it, you can mail me at florisb@euronet.nl, will be in the weekend then (almost evening here now).

Going home now, nice weekend!

Floris.
0
 

Author Comment

by:blitz051697
ID: 2620657
thanks
0
 
LVL 2

Expert Comment

by:florisb
ID: 2622758
your welcome,
Floris.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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