Board index » cppbuilder » Can't create an automation object

Can't create an automation object

I have an interesting problem: BCB can't create an automation object.

I have created a new application, saved it, then tried to create an
automation object. All I get is a message box titled "Error" containing
the message "The parameter is incorrect."

Now what? Anyone else had this problem? I'm running BCB4 with SP1 on
NT4SP5.

BTW, Borland, this kind of error message that doesn't indicate the
operation being performed or any other context for the error is pretty
useless. It doesn't belong in production code. I'd have failed one of my
introductory programming students for doing this.

    ++PLS

 

Re:Can't create an automation object


Paul, could you provide the exact steps of what you are doing? As it is,
info you've given us is pretty vague.

Thanx,
Alex

Quote
Paul Schauble wrote:

[snip]

Re:Can't create an automation object


In article <37BCD6B1.4083A...@thekeep.com>,
Paul Schauble  <p...@thekeep.com> wrote:

Quote
>I have an interesting problem: BCB can't create an automation object.

>I have created a new application, saved it, then tried to create an
>automation object. All I get is a message box titled "Error" containing
>the message "The parameter is incorrect."

>Now what? Anyone else had this problem? I'm running BCB4 with SP1 on
>NT4SP5.

I've seen this happen. I was unable to figure out what caused
it, and after twiddling around with some packages, it went away.

Does it work differently if you do
File|New AXLib
File|New Auto Object

instead of doing it in a .exe?

[I wish I could be more helpful, but unless I can get it to fail
on my machine, I can't pinpoint what's causing it ...]

Quote
>BTW, Borland, this kind of error message that doesn't indicate the
>operation being performed or any other context for the error is pretty
>useless. It doesn't belong in production code. I'd have failed one of my
>introductory programming students for doing this.

Uh .. .the error message is defined in winerror.h, line 683 ---
most likely BCB calls FormatMessage() and passes it the
return result of GetLastError(), which would generate
the message in question. (IOW: hold your fire, it's aimed
at the wrong target here. :))

--
Caminante, son tus huellas el camino, y nada mas;
caminante, no hay camino, se hace camino al andar ...
Caminante, no hay camino, sino estelas en el mar.

Re:Can't create an automation object


No, that was complete and specific. I'm not doing that much to get the
error. Here it is, click by click:

Start CBuilder 4
Click File | New Application
Click File | Save Project; specifying an empty directory
Click File | New... | Activex | Automation Object
Enter CoClass Name = "THost",
    Threading Model = "Apartment",
    Description = "Server",
    Generate Event support code = unchecked
Click OK
See message box with title = "Error", content = "The parameter is
incorrect"

BCB has added project1.tlb and project1_TLB.cpp, but not
project1_ATL and hasn't added the suport code to project1.cpp.

    ++PLS

Quote
"Alex Bakaev [TeamB]" wrote:

> Paul, could you provide the exact steps of what you are doing? As it is,
> info you've given us is pretty vague.

> Thanx,
> Alex

> Paul Schauble wrote:
> [snip]

Re:Can't create an automation object


Quote
aphr...@magescave.blackforest.org wrote:
> I've seen this happen. I was unable to figure out what caused
> it, and after twiddling around with some packages, it went away.

> Does it work differently if you do
> File|New AXLib
> File|New Auto Object

> instead of doing it in a .exe?

No, that produces the same error.

Quote
> >BTW, Borland, this kind of error message that doesn't indicate the
> >operation being performed or any other context for the error is pretty
> >useless. It doesn't belong in production code. I'd have failed one of my
> >introductory programming students for doing this.

> Uh .. .the error message is defined in winerror.h, line 683 ---
> most likely BCB calls FormatMessage() and passes it the
> return result of GetLastError(), which would generate
> the message in question. (IOW: hold your fire, it's aimed
> at the wrong target here. :))

You miss my point. Microsoft provides the interpretation of the error
code, but doesn't, and can't provide the context of the error. Here's
the format I usually use for unexpected errors:
    While painting screen, API call CreateFont
    at e:\project\vHost\vUdp\StatusScreen.cpp #133
    returned error "The parameter is incorrect".

In other words, what was the program doing when it encountered that
error. If the error involves a file, then show the full path of the
file. I've spent far too much time chasing down errors in some program's
setup that could have been fixed in 30 seconds if an error message had
told me what file path was involved. Life is too short.

    ++PLS

Re:Can't create an automation object


In article <37C1B645.8A5E...@thekeep.com>,
Paul Schauble  <p...@thekeep.com> wrote:

Quote
>> Does it work differently if you do
>> File|New AXLib
>> File|New Auto Object

>> instead of doing it in a .exe?

>No, that produces the same error.

OK. With that and the other description I might be able to get somewhere. :)

--
Caminante, son tus huellas el camino, y nada mas;
caminante, no hay camino, se hace camino al andar ...
Caminante, no hay camino, sino estelas en el mar.

Re:Can't create an automation object


I seem to have found the problem. BCB4 wants write access to
$(BCB)/ObjRepos in order to do a New... | ActiveX | Automation Object.
Providing this fixed the problem.

I don't understand why it wants this. It didn't put anything there.

And this should make my point about error messages. If the error message
has said something about
"Access Denied" and given given a path name, this would have been very
easy to fix. Instead what probably happened is that no one checked the
return from the OpenFile or CreateFile call which returned
INVALID_HANDLE_VALUE. The reported error comes from a later file I/O
call that was given the invalid handle.

    ++PLS

Re:Can't create an automation object


In article <37C1DBDD.BE0FE...@thekeep.com>,
Paul Schauble  <p...@thekeep.com> wrote:

Quote
>I seem to have found the problem. BCB4 wants write access to
>$(BCB)/ObjRepos in order to do a New... | ActiveX | Automation Object.
>Providing this fixed the problem.

>I don't understand why it wants this. It didn't put anything there.

It read stuff out of it, and opened it asking for write access.
I've submitted a bug report with respect to this.

--
Caminante, son tus huellas el camino, y nada mas;
caminante, no hay camino, se hace camino al andar ...
Caminante, no hay camino, sino estelas en el mar.

Other Threads