Calling COM properties!

Questions, Support, etc.

Calling COM properties!

Postby PrimusEng on Fri Sep 19, 2008 11:50 pm

I have some code in my main application which accesses COM properties, supposing that object is succesfully registered in Windows. Do I need in initialisation procedure only to call procedure for registering this COM and all my code will function?

Code for accesing COM properties:

try
iAnchSBar := GetActiveOleObject('AnchSBar.AnchSBarObj') ;
except
iAnchSBar := CreateOleObject('AnchSBar.AnchSBarObj') ;
end;

// Define properties
iAnchSBar.barDiam := barDiam;
iAnchSBar.barType := barType;
iAnchSBar.bondCond := bondCond;
iAnchSBar.fck := fck;
iAnchSBar.fctk05 := fctk05;
iAnchSBar.fyk := fyk;
iAnchSBar.gamac := gamac;
iAnchSBar.gamas := gamas;

Regards, P.
PrimusEng
 
Posts: 5
Joined: Wed Sep 17, 2008 7:03 pm

Re: Calling COM properties!

Postby Artem A. Razin on Sat Sep 20, 2008 5:25 am

Thank you for your question.

At application startup you just add something like:

Code: Select all
initialization

   BoxedAppSDK_Init;

   BoxedAppSDK_RegisterCOMLibraryInVirtualRegistry('AnchSBar.ocx');


Then you can call this code successfully:

Code: Select all
try
      iAnchSBar := GetActiveOleObject('AnchSBar.AnchSBarObj') ;
    except
      iAnchSBar := CreateOleObject('AnchSBar.AnchSBarObj') ;
    end;

    // Define properties
    iAnchSBar.barDiam     := barDiam;
    iAnchSBar.barType     := barType;
    iAnchSBar.bondCond    := bondCond;
    iAnchSBar.fck         := fck;
    iAnchSBar.fctk05      := fctk05;
    iAnchSBar.fyk         := fyk;
    iAnchSBar.gamac       := gamac;
    iAnchSBar.gamas       := gamas;


Thank you.
Artem A. Razin
Site Admin
 
Posts: 746
Joined: Mon Jul 28, 2008 5:04 pm
Location: St.Petersburg, Russia


Return to BoxedApp SDK

cron