Interfacing with act database using API (i think)

G

garyusenet

At least I think it's using an API (i don't totally understand the
concept.)

I'm using Act 6. I need to interface with the act database and add
'contacts' to the database. The reason I need to do this is because i'm

writing a little program to add a new prospect to the database when a
telephone lead rings through, the receptionist will use this program,
enter a few pieces of information and then transfer the call to the
salesman - at which point the salesman can pick up the new contact in
the Act program. This should be fairly straightforward.


I'm stuck. I cant figure out how to connect to the database. Or how to
add contacts to it. There is an extensive SDK pack which shows you how
to do this but i've had no joy (partly because the examples are in c++
and i use c# (i've only been learning it over the past couple of
months.)


PLEASE can you take a look www.strident.net/act i've included all the
files and the SDK. And can you then please offer any advice you can on
how I can do this.


So far i've managed to get access to the act namespace, but thats about

it - i can't figure out how to use it. (I got access by running tlbimp
on a .tlb file and referenceing the .dll this created - all of this has

been a very steep learning curve for me!)


I'd really appreciate your effort, i'm totally stumped at the moment.


I just need to


(a) connect to a database.
(b) write / edit it.


Thanks for your time, and do please take a look / offer any advice you
can.


Gary.
 
D

Dmytro Lapshyn [MVP]

Hi,

Two somewhat harsh but IMO necessary comments first:

a) I believe that most of the people willing to help you are quite busy to
deal with a whole SDK. You could have posted a couple of C++ examples so we
would be able to suggest the best way to convert them to C#
b) A better place for such questions is
microsoft.public.dotnet.framework.interop newsgroup - your inquiry is not
about Windows Forms but rather about interoperating with unmanaged code.

Now, on to the topic.

Since you have listed a couple of .tlb files on your webpage, these are the
first to look at. Please refer to the SDK docs on those type libraries
(and/or relevant DLLs). Since it looks like Act has a COM interface, it
makes things a lot easier.

My guess is what you should try first is using the tlbimp.exe tool to create
interop assemblies for the TLB files supplied in Act SDK and then figuring
out from the SDK docs what is the right way to use the COM automation
interface (it may be named an OLE automation interface). After you've
understood the logic and sequence of calling the Act objects and their
methods, create a sample project, reference the interop assemblies created
as described above and try to replicate the same logic and sequence in your
code.

If you feel you don't have enough background in COM Interop, please refer to
MSDN docs on consuming COM objects from managed code. The "Exposing COM
Components to the .NET Framework" topic should be your starting point - do a
search for this exact phrase.
 
G

garyusenet

Thankyou I have tried what you have said over the past few days and am
now stumped at this stage. After converting the act.tlb into an act.dll
using tlbimp - i tried to add it to my project and am getting an error
that "self-registration failed".

Any ideas?
 
D

Dmytro Lapshyn [MVP]

Have you added the DLL to the deployment project? If so, turn off any
registration for the DLL.
 
G

garyusenet

Please elaborate i'd like to try what you suggest... but don't know how
- can you tell me the exact steps to follow.

all i've done in c# project is act.dll as a reference.
in the visual basic i couldn't find references so used the toolbox 'add
com' section to add it

both generated the same "self-registration error" - how do you turn off
self registration? and does this mean i have to manually register? if
so how do i do that?
 
D

Dmytro Lapshyn [MVP]

Are you adding the act.dll generated by tlbimp.exe as a COM reference? If
so, this is wrong. You should reference it as a regular .NET assembly (in
Visual C#, use the .NET tab of the Add Reference dialog. Not so sure about
VB .NET - haven't used it for a while).
 
G

garyusenet

It doesn't appear under the .net listing, if i choose browse, and
navigate to it - it lets me add it as a reference but when I go back to
references and recent, i notice it doesnt list its type as .net but as
'file'

is this the problem do you think? or does this sound right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top